X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fbindings.c;h=aa2a9f13ec762b9a6d51c0749e968fdbebbe6ca5;hb=HEAD;hp=5f7c5c2e2f235a0c96bd4ad3a7863aa12ee00a5f;hpb=d8656f7b597edd7ae8c34cb677c35d3b1635efd5;p=ldk-java diff --git a/c_sharp/bindings.c b/c_sharp/bindings.c index 5f7c5c2e..ee78f2ad 100644 --- a/c_sharp/bindings.c +++ b/c_sharp/bindings.c @@ -31,6 +31,18 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), _Static_assert(sizeof(void*) <= 8, "Pointers must fit into 64 bits"); +// Int types across Windows/Linux are different, so make sure we're using the right headers. +_Static_assert(sizeof(void*) == sizeof(uintptr_t), "stdints must be correct"); +_Static_assert(sizeof(void*) == sizeof(intptr_t), "stdints must be correct"); +_Static_assert(sizeof(uint64_t) == 8, "stdints must be correct"); +_Static_assert(sizeof(int64_t) == 8, "stdints must be correct"); +_Static_assert(sizeof(uint32_t) == 4, "stdints must be correct"); +_Static_assert(sizeof(int32_t) == 4, "stdints must be correct"); +_Static_assert(sizeof(uint16_t) == 2, "stdints must be correct"); +_Static_assert(sizeof(int16_t) == 2, "stdints must be correct"); +_Static_assert(sizeof(uint8_t) == 1, "stdints must be correct"); +_Static_assert(sizeof(int8_t) == 1, "stdints must be correct"); + #define DECL_ARR_TYPE(ty, name) \ struct name##array { \ uint64_t arr_len; /* uint32_t would suffice but we want to align uint64_ts as well */ \ @@ -69,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"); @@ -115,6 +128,13 @@ int CS_LDK_register_void_l_invoker(invoker_void_l invoker) { return 0; } +typedef int64_t (*invoker_l_lll)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c); +static invoker_l_lll js_invoke_function_l_lll; +int CS_LDK_register_l_lll_invoker(invoker_l_lll invoker) { + js_invoke_function_l_lll = invoker; + return 0; +} + typedef int64_t (*invoker_l_llll)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c, int64_t d); static invoker_l_llll js_invoke_function_l_llll; int CS_LDK_register_l_llll_invoker(invoker_l_llll invoker) { @@ -129,10 +149,10 @@ int CS_LDK_register_l_lllll_invoker(invoker_l_lllll invoker) { return 0; } -typedef int64_t (*invoker_l_lll)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c); -static invoker_l_lll js_invoke_function_l_lll; -int CS_LDK_register_l_lll_invoker(invoker_l_lll invoker) { - js_invoke_function_l_lll = invoker; +typedef void (*invoker_void_lll)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c); +static invoker_void_lll js_invoke_function_void_lll; +int CS_LDK_register_void_lll_invoker(invoker_void_lll invoker) { + js_invoke_function_void_lll = invoker; return 0; } @@ -206,6 +226,13 @@ int CS_LDK_register_l_lllb_invoker(invoker_l_lllb invoker) { return 0; } +typedef int64_t (*invoker_l_lllil)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c, int32_t d, int64_t e); +static invoker_l_lllil js_invoke_function_l_lllil; +int CS_LDK_register_l_lllil_invoker(invoker_l_lllil invoker) { + js_invoke_function_l_lllil = invoker; + return 0; +} + typedef int32_t (*invoker_ChannelMonitorUpdateStatus_lll)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c); static invoker_ChannelMonitorUpdateStatus_lll js_invoke_function_ChannelMonitorUpdateStatus_lll; int CS_LDK_register_ChannelMonitorUpdateStatus_lll_invoker(invoker_ChannelMonitorUpdateStatus_lll invoker) { @@ -220,13 +247,6 @@ int CS_LDK_register_ChannelMonitorUpdateStatus_llll_invoker(invoker_ChannelMonit return 0; } -typedef void (*invoker_void_)(int obj_ptr, int fn_id); -static invoker_void_ js_invoke_function_void_; -int CS_LDK_register_void__invoker(invoker_void_ invoker) { - js_invoke_function_void_ = invoker; - return 0; -} - typedef void (*invoker_void_lli)(int obj_ptr, int fn_id, int64_t a, int64_t b, int32_t c); static invoker_void_lli js_invoke_function_void_lli; int CS_LDK_register_void_lli_invoker(invoker_void_lli invoker) { @@ -241,6 +261,13 @@ int CS_LDK_register_void_li_invoker(invoker_void_li invoker) { return 0; } +typedef void (*invoker_void_)(int obj_ptr, int fn_id); +static invoker_void_ js_invoke_function_void_; +int CS_LDK_register_void__invoker(invoker_void_ invoker) { + js_invoke_function_void_ = invoker; + return 0; +} + typedef int64_t (*invoker_l_llb)(int obj_ptr, int fn_id, int64_t a, int64_t b, jboolean c); static invoker_l_llb js_invoke_function_l_llb; int CS_LDK_register_l_llb_invoker(invoker_l_llb invoker) { @@ -339,6 +366,20 @@ static inline uint64_t tag_ptr(const void* ptr, bool is_owned) { } } +static inline LDKBlindedFailure LDKBlindedFailure_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKBlindedFailure_FromIntroductionNode; + case 1: return LDKBlindedFailure_FromBlindedNode; + default: abort(); + } +} +static inline int32_t LDKBlindedFailure_to_cs(LDKBlindedFailure val) { + switch (val) { + case LDKBlindedFailure_FromIntroductionNode: return 0; + case LDKBlindedFailure_FromBlindedNode: return 1; + default: abort(); + } +} static inline LDKBolt11SemanticError LDKBolt11SemanticError_from_cs(int32_t ord) { switch (ord) { case 0: return LDKBolt11SemanticError_NoPaymentHash; @@ -394,10 +435,11 @@ static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_cs(int32_t ord) case 20: return LDKBolt12SemanticError_MissingPayerId; case 21: return LDKBolt12SemanticError_DuplicatePaymentId; case 22: return LDKBolt12SemanticError_MissingPaths; - case 23: return LDKBolt12SemanticError_InvalidPayInfo; - case 24: return LDKBolt12SemanticError_MissingCreationTime; - case 25: return LDKBolt12SemanticError_MissingPaymentHash; - case 26: return LDKBolt12SemanticError_MissingSignature; + case 23: return LDKBolt12SemanticError_UnexpectedPaths; + case 24: return LDKBolt12SemanticError_InvalidPayInfo; + case 25: return LDKBolt12SemanticError_MissingCreationTime; + case 26: return LDKBolt12SemanticError_MissingPaymentHash; + case 27: return LDKBolt12SemanticError_MissingSignature; default: abort(); } } @@ -426,10 +468,11 @@ static inline int32_t LDKBolt12SemanticError_to_cs(LDKBolt12SemanticError val) { case LDKBolt12SemanticError_MissingPayerId: return 20; case LDKBolt12SemanticError_DuplicatePaymentId: return 21; case LDKBolt12SemanticError_MissingPaths: return 22; - case LDKBolt12SemanticError_InvalidPayInfo: return 23; - case LDKBolt12SemanticError_MissingCreationTime: return 24; - case LDKBolt12SemanticError_MissingPaymentHash: return 25; - case LDKBolt12SemanticError_MissingSignature: return 26; + case LDKBolt12SemanticError_UnexpectedPaths: return 23; + case LDKBolt12SemanticError_InvalidPayInfo: return 24; + case LDKBolt12SemanticError_MissingCreationTime: return 25; + case LDKBolt12SemanticError_MissingPaymentHash: return 26; + case LDKBolt12SemanticError_MissingSignature: return 27; default: abort(); } } @@ -486,24 +529,24 @@ static inline int32_t LDKChannelShutdownState_to_cs(LDKChannelShutdownState val) static inline LDKConfirmationTarget LDKConfirmationTarget_from_cs(int32_t ord) { switch (ord) { case 0: return LDKConfirmationTarget_OnChainSweep; - case 1: return LDKConfirmationTarget_MaxAllowedNonAnchorChannelRemoteFee; - case 2: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; - case 3: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; - case 4: return LDKConfirmationTarget_AnchorChannelFee; - case 5: return LDKConfirmationTarget_NonAnchorChannelFee; - case 6: return LDKConfirmationTarget_ChannelCloseMinimum; + case 1: return LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee; + case 2: return LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee; + case 3: return LDKConfirmationTarget_AnchorChannelFee; + case 4: return LDKConfirmationTarget_NonAnchorChannelFee; + case 5: return LDKConfirmationTarget_ChannelCloseMinimum; + case 6: return LDKConfirmationTarget_OutputSpendingFee; default: abort(); } } static inline int32_t LDKConfirmationTarget_to_cs(LDKConfirmationTarget val) { switch (val) { case LDKConfirmationTarget_OnChainSweep: return 0; - case LDKConfirmationTarget_MaxAllowedNonAnchorChannelRemoteFee: return 1; - case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return 2; - case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: return 3; - case LDKConfirmationTarget_AnchorChannelFee: return 4; - case LDKConfirmationTarget_NonAnchorChannelFee: return 5; - case LDKConfirmationTarget_ChannelCloseMinimum: return 6; + case LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee: return 1; + case LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee: return 2; + case LDKConfirmationTarget_AnchorChannelFee: return 3; + case LDKConfirmationTarget_NonAnchorChannelFee: return 4; + case LDKConfirmationTarget_ChannelCloseMinimum: return 5; + case LDKConfirmationTarget_OutputSpendingFee: return 6; default: abort(); } } @@ -549,6 +592,20 @@ static inline int32_t LDKCurrency_to_cs(LDKCurrency val) { default: abort(); } } +static inline LDKDirection LDKDirection_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKDirection_NodeOne; + case 1: return LDKDirection_NodeTwo; + default: abort(); + } +} +static inline int32_t LDKDirection_to_cs(LDKDirection val) { + switch (val) { + case LDKDirection_NodeOne: return 0; + case LDKDirection_NodeTwo: return 1; + default: abort(); + } +} static inline LDKHTLCClaim LDKHTLCClaim_from_cs(int32_t ord) { switch (ord) { case 0: return LDKHTLCClaim_OfferedTimeout; @@ -615,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; @@ -655,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; @@ -739,6 +832,22 @@ static inline int32_t LDKSecp256k1Error_to_cs(LDKSecp256k1Error val) { default: abort(); } } +static inline LDKShortChannelIdError LDKShortChannelIdError_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKShortChannelIdError_BlockOverflow; + case 1: return LDKShortChannelIdError_TxIndexOverflow; + case 2: return LDKShortChannelIdError_VoutIndexOverflow; + default: abort(); + } +} +static inline int32_t LDKShortChannelIdError_to_cs(LDKShortChannelIdError val) { + switch (val) { + case LDKShortChannelIdError_BlockOverflow: return 0; + case LDKShortChannelIdError_TxIndexOverflow: return 1; + case LDKShortChannelIdError_VoutIndexOverflow: return 2; + default: abort(); + } +} static inline LDKSiPrefix LDKSiPrefix_from_cs(int32_t ord) { switch (ord) { case 0: return LDKSiPrefix_Milli; @@ -789,6 +898,11 @@ static inline int32_t LDKUtxoLookupError_to_cs(LDKUtxoLookupError val) { default: abort(); } } +static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) { + LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen }; + memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen); + return ret; +} struct LDKThirtyTwoBytes BigEndianScalar_get_bytes (struct LDKBigEndianScalar* thing) { LDKThirtyTwoBytes ret = { .data = *thing->big_endian_bytes }; return ret; @@ -835,60 +949,51 @@ int8_t CS_LDK_LDKBech32Error_InvalidData_get_invalid_data(int64_t ptr) { int8_t invalid_data_conv = obj->invalid_data; return invalid_data_conv; } -static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) { - LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen }; - memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen); +static inline struct LDKRefundMaybeWithDerivedMetadataBuilder CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKRefundMaybeWithDerivedMetadataBuilder ret = *owner->contents.result; + ret.is_owned = false; return ret; } -struct LDKWitness TxIn_get_witness (struct LDKTxIn* thing) { return Witness_clone(&thing->witness);}int8_tArray CS_LDK_TxIn_get_witness(int64_t thing) { - LDKTxIn* thing_conv = (LDKTxIn*)untag_ptr(thing); - LDKWitness ret_var = TxIn_get_witness(thing_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - Witness_free(ret_var); - return ret_arr; -} - -struct LDKCVec_u8Z TxIn_get_script_sig (struct LDKTxIn* thing) { return CVec_u8Z_clone(&thing->script_sig);}int8_tArray CS_LDK_TxIn_get_script_sig(int64_t thing) { - LDKTxIn* thing_conv = (LDKTxIn*)untag_ptr(thing); - LDKCVec_u8Z ret_var = TxIn_get_script_sig(thing_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.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_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -LDKThirtyTwoBytes TxIn_get_previous_txid (struct LDKTxIn* thing) { return thing->previous_txid;}int8_tArray CS_LDK_TxIn_get_previous_txid(int64_t thing) { - LDKTxIn* thing_conv = (LDKTxIn*)untag_ptr(thing); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, TxIn_get_previous_txid(thing_conv).data, 32); - return ret_arr; +static inline enum LDKBolt12SemanticError CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); } - -uint32_t TxIn_get_previous_vout (struct LDKTxIn* thing) { return thing->previous_vout;}int32_t CS_LDK_TxIn_get_previous_vout(int64_t thing) { - LDKTxIn* thing_conv = (LDKTxIn*)untag_ptr(thing); - int32_t ret_conv = TxIn_get_previous_vout(thing_conv); +int32_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(owner_conv)); return ret_conv; } -uint32_t TxIn_get_sequence (struct LDKTxIn* thing) { return thing->sequence;}int32_t CS_LDK_TxIn_get_sequence(int64_t thing) { - LDKTxIn* thing_conv = (LDKTxIn*)untag_ptr(thing); - int32_t ret_conv = TxIn_get_sequence(thing_conv); - return ret_conv; +static inline struct LDKRefund CResult_RefundBolt12SemanticErrorZ_get_ok(LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKRefund ret = *owner->contents.result; + ret.is_owned = false; + return ret; } - -struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) { return CVec_u8Z_clone(&thing->script_pubkey);}int8_tArray CS_LDK_TxOut_get_script_pubkey(int64_t thing) { - LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing); - LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.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_RefundBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_RefundBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(owner); + LDKRefund ret_var = CResult_RefundBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}int64_t CS_LDK_TxOut_get_value(int64_t thing) { - LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing); - int64_t ret_conv = TxOut_get_value(thing_conv); +static inline enum LDKBolt12SemanticError CResult_RefundBolt12SemanticErrorZ_get_err(LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_RefundBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_RefundBolt12SemanticErrorZ_get_err(owner_conv)); return ret_conv; } @@ -971,6 +1076,7 @@ uint32_t CS_LDK_LDKDecodeError_ty_from_ptr(int64_t ptr) { case LDKDecodeError_BadLengthDescriptor: return 4; case LDKDecodeError_Io: return 5; case LDKDecodeError_UnsupportedCompression: return 6; + case LDKDecodeError_DangerousValue: return 7; default: abort(); } } @@ -1202,6 +1308,74 @@ void CS_LDK_CResult_RecipientOnionFieldsNoneZ_get_err(int64_t owner) { CResult_RecipientOnionFieldsNoneZ_get_err(owner_conv); } +static inline struct LDKUnsignedBolt12Invoice CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKUnsignedBolt12Invoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKUnsignedBolt12Invoice ret_var = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKBolt12SemanticError CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKBolt12Invoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKBolt12SemanticError CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKSchnorrSignature CResult_SchnorrSignatureNoneZ_get_ok(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +int8_tArray CS_LDK_CResult_SchnorrSignatureNoneZ_get_ok(int64_t owner) { + LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, CResult_SchnorrSignatureNoneZ_get_ok(owner_conv).compact_form, 64); + return ret_arr; +} + +static inline void CResult_SchnorrSignatureNoneZ_get_err(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_SchnorrSignatureNoneZ_get_err(int64_t owner) { + LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); + CResult_SchnorrSignatureNoneZ_get_err(owner_conv); +} + static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) { LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1232,6 +1406,76 @@ ptrArray CS_LDK_LDKCOption_CVec_ThirtyTwoBytesZZ_Some_get_some(int64_t ptr) { return some_arr; } +uint32_t CS_LDK_LDKAmount_ty_from_ptr(int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + switch(obj->tag) { + case LDKAmount_Bitcoin: return 0; + case LDKAmount_Currency: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKAmount_Bitcoin_get_amount_msats(int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + CHECK(obj->tag == LDKAmount_Bitcoin); + int64_t amount_msats_conv = obj->bitcoin.amount_msats; + return amount_msats_conv; +} +int8_tArray CS_LDK_LDKAmount_Currency_get_iso4217_code(int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + CHECK(obj->tag == LDKAmount_Currency); + int8_tArray iso4217_code_arr = init_int8_tArray(3, __LINE__); + memcpy(iso4217_code_arr->elems, obj->currency.iso4217_code.data, 3); + return iso4217_code_arr; +} +int64_t CS_LDK_LDKAmount_Currency_get_amount(int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + CHECK(obj->tag == LDKAmount_Currency); + int64_t amount_conv = obj->currency.amount; + return amount_conv; +} +uint32_t CS_LDK_LDKCOption_AmountZ_ty_from_ptr(int64_t ptr) { + LDKCOption_AmountZ *obj = (LDKCOption_AmountZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_AmountZ_Some: return 0; + case LDKCOption_AmountZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_AmountZ_Some_get_some(int64_t ptr) { + LDKCOption_AmountZ *obj = (LDKCOption_AmountZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_AmountZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} +uint32_t CS_LDK_LDKQuantity_ty_from_ptr(int64_t ptr) { + LDKQuantity *obj = (LDKQuantity*)untag_ptr(ptr); + switch(obj->tag) { + case LDKQuantity_Bounded: return 0; + case LDKQuantity_Unbounded: return 1; + case LDKQuantity_One: return 2; + default: abort(); + } +} +int64_t CS_LDK_LDKQuantity_Bounded_get_bounded(int64_t ptr) { + LDKQuantity *obj = (LDKQuantity*)untag_ptr(ptr); + CHECK(obj->tag == LDKQuantity_Bounded); + int64_t bounded_conv = obj->bounded; + return bounded_conv; +} +uint32_t CS_LDK_LDKCOption_QuantityZ_ty_from_ptr(int64_t ptr) { + LDKCOption_QuantityZ *obj = (LDKCOption_QuantityZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_QuantityZ_Some: return 0; + case LDKCOption_QuantityZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_QuantityZ_Some_get_some(int64_t ptr) { + LDKCOption_QuantityZ *obj = (LDKCOption_QuantityZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_QuantityZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} static inline struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesNoneZ_get_ok(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return ThirtyTwoBytes_clone(&*owner->contents.result); @@ -1354,6 +1598,13 @@ int64_t CS_LDK_LDKSpendableOutputDescriptor_StaticOutput_get_output(int64_t ptr) LDKTxOut* output_ref = &obj->static_output.output; return tag_ptr(output_ref, false); } +int8_tArray CS_LDK_LDKSpendableOutputDescriptor_StaticOutput_get_channel_keys_id(int64_t ptr) { + LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr); + CHECK(obj->tag == LDKSpendableOutputDescriptor_StaticOutput); + int8_tArray channel_keys_id_arr = init_int8_tArray(32, __LINE__); + memcpy(channel_keys_id_arr->elems, obj->static_output.channel_keys_id.data, 32); + return channel_keys_id_arr; +} int64_t CS_LDK_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(int64_t ptr) { LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr); CHECK(obj->tag == LDKSpendableOutputDescriptor_DelayedPaymentOutput); @@ -1424,45 +1675,45 @@ int32_t CS_LDK_LDKCOption_u32Z_Some_get_some(int64_t ptr) { int32_t some_conv = obj->some; return some_conv; } -static inline struct LDKCVec_u8Z C2Tuple_CVec_u8ZusizeZ_get_a(LDKC2Tuple_CVec_u8ZusizeZ *NONNULL_PTR owner){ +static inline struct LDKCVec_u8Z C2Tuple_CVec_u8Zu64Z_get_a(LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR owner){ return CVec_u8Z_clone(&owner->a); } -int8_tArray CS_LDK_C2Tuple_CVec_u8ZusizeZ_get_a(int64_t owner) { - LDKC2Tuple_CVec_u8ZusizeZ* owner_conv = (LDKC2Tuple_CVec_u8ZusizeZ*)untag_ptr(owner); - LDKCVec_u8Z ret_var = C2Tuple_CVec_u8ZusizeZ_get_a(owner_conv); +int8_tArray CS_LDK_C2Tuple_CVec_u8Zu64Z_get_a(int64_t owner) { + LDKC2Tuple_CVec_u8Zu64Z* owner_conv = (LDKC2Tuple_CVec_u8Zu64Z*)untag_ptr(owner); + LDKCVec_u8Z ret_var = C2Tuple_CVec_u8Zu64Z_get_a(owner_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -static inline uintptr_t C2Tuple_CVec_u8ZusizeZ_get_b(LDKC2Tuple_CVec_u8ZusizeZ *NONNULL_PTR owner){ +static inline uint64_t C2Tuple_CVec_u8Zu64Z_get_b(LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR owner){ return owner->b; } -int64_t CS_LDK_C2Tuple_CVec_u8ZusizeZ_get_b(int64_t owner) { - LDKC2Tuple_CVec_u8ZusizeZ* owner_conv = (LDKC2Tuple_CVec_u8ZusizeZ*)untag_ptr(owner); - int64_t ret_conv = C2Tuple_CVec_u8ZusizeZ_get_b(owner_conv); +int64_t CS_LDK_C2Tuple_CVec_u8Zu64Z_get_b(int64_t owner) { + LDKC2Tuple_CVec_u8Zu64Z* owner_conv = (LDKC2Tuple_CVec_u8Zu64Z*)untag_ptr(owner); + int64_t ret_conv = C2Tuple_CVec_u8Zu64Z_get_b(owner_conv); return ret_conv; } -static inline struct LDKC2Tuple_CVec_u8ZusizeZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_get_ok(LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR owner){ +static inline struct LDKC2Tuple_CVec_u8Zu64Z CResult_C2Tuple_CVec_u8Zu64ZNoneZ_get_ok(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return C2Tuple_CVec_u8ZusizeZ_clone(&*owner->contents.result); + return C2Tuple_CVec_u8Zu64Z_clone(&*owner->contents.result); } -int64_t CS_LDK_CResult_C2Tuple_CVec_u8ZusizeZNoneZ_get_ok(int64_t owner) { - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ* owner_conv = (LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ*)untag_ptr(owner); - LDKC2Tuple_CVec_u8ZusizeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_u8ZusizeZ), "LDKC2Tuple_CVec_u8ZusizeZ"); - *ret_conv = CResult_C2Tuple_CVec_u8ZusizeZNoneZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_C2Tuple_CVec_u8Zu64ZNoneZ_get_ok(int64_t owner) { + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* owner_conv = (LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ*)untag_ptr(owner); + LDKC2Tuple_CVec_u8Zu64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_u8Zu64Z), "LDKC2Tuple_CVec_u8Zu64Z"); + *ret_conv = CResult_C2Tuple_CVec_u8Zu64ZNoneZ_get_ok(owner_conv); return tag_ptr(ret_conv, true); } -static inline void CResult_C2Tuple_CVec_u8ZusizeZNoneZ_get_err(LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR owner){ +static inline void CResult_C2Tuple_CVec_u8Zu64ZNoneZ_get_err(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -void CS_LDK_CResult_C2Tuple_CVec_u8ZusizeZNoneZ_get_err(int64_t owner) { - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ* owner_conv = (LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ*)untag_ptr(owner); - CResult_C2Tuple_CVec_u8ZusizeZNoneZ_get_err(owner_conv); +void CS_LDK_CResult_C2Tuple_CVec_u8Zu64ZNoneZ_get_err(int64_t owner) { + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* owner_conv = (LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ*)untag_ptr(owner); + CResult_C2Tuple_CVec_u8Zu64ZNoneZ_get_err(owner_conv); } static inline struct LDKChannelDerivationParameters CResult_ChannelDerivationParametersDecodeErrorZ_get_ok(LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR owner){ @@ -1535,74 +1786,6 @@ void CS_LDK_CResult_NoneNoneZ_get_err(int64_t owner) { CResult_NoneNoneZ_get_err(owner_conv); } -static inline struct LDKECDSASignature C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_a(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR owner){ - return owner->a; -} -int8_tArray CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_a(int64_t owner) { - LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* owner_conv = (LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_a(owner_conv).compact_form, 64); - return ret_arr; -} - -static inline struct LDKCVec_ECDSASignatureZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_b(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR owner){ - return owner->b; -} -ptrArray CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_b(int64_t owner) { - LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* owner_conv = (LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)untag_ptr(owner); - LDKCVec_ECDSASignatureZ ret_var = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_b(owner_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_var.data[i].compact_form, 64); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - return ret_arr; -} - -static inline struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(&*owner->contents.result); -} -int64_t CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_ok(int64_t owner) { - LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)untag_ptr(owner); - LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ), "LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ"); - *ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_ok(owner_conv); - return tag_ptr(ret_conv, true); -} - -static inline void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_err(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -void CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_err(int64_t owner) { - LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)untag_ptr(owner); - CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_err(owner_conv); -} - -static inline struct LDKECDSASignature CResult_ECDSASignatureNoneZ_get_ok(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -int8_tArray CS_LDK_CResult_ECDSASignatureNoneZ_get_ok(int64_t owner) { - LDKCResult_ECDSASignatureNoneZ* owner_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, CResult_ECDSASignatureNoneZ_get_ok(owner_conv).compact_form, 64); - return ret_arr; -} - -static inline void CResult_ECDSASignatureNoneZ_get_err(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -void CS_LDK_CResult_ECDSASignatureNoneZ_get_err(int64_t owner) { - LDKCResult_ECDSASignatureNoneZ* owner_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(owner); - CResult_ECDSASignatureNoneZ_get_err(owner_conv); -} - static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; @@ -1657,24 +1840,93 @@ void CS_LDK_CResult_RecoverableSignatureNoneZ_get_err(int64_t owner) { CResult_RecoverableSignatureNoneZ_get_err(owner_conv); } -static inline struct LDKSchnorrSignature CResult_SchnorrSignatureNoneZ_get_ok(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +static inline struct LDKECDSASignature CResult_ECDSASignatureNoneZ_get_ok(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; } -int8_tArray CS_LDK_CResult_SchnorrSignatureNoneZ_get_ok(int64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); +int8_tArray CS_LDK_CResult_ECDSASignatureNoneZ_get_ok(int64_t owner) { + LDKCResult_ECDSASignatureNoneZ* owner_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(owner); int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, CResult_SchnorrSignatureNoneZ_get_ok(owner_conv).compact_form, 64); + memcpy(ret_arr->elems, CResult_ECDSASignatureNoneZ_get_ok(owner_conv).compact_form, 64); return ret_arr; } -static inline void CResult_SchnorrSignatureNoneZ_get_err(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +static inline void CResult_ECDSASignatureNoneZ_get_err(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -void CS_LDK_CResult_SchnorrSignatureNoneZ_get_err(int64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); - CResult_SchnorrSignatureNoneZ_get_err(owner_conv); +void CS_LDK_CResult_ECDSASignatureNoneZ_get_err(int64_t owner) { + LDKCResult_ECDSASignatureNoneZ* owner_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(owner); + CResult_ECDSASignatureNoneZ_get_err(owner_conv); +} + +static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +int8_tArray CS_LDK_CResult_TransactionNoneZ_get_ok(int64_t owner) { + LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner); + LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; +} + +static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_TransactionNoneZ_get_err(int64_t owner) { + LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner); + CResult_TransactionNoneZ_get_err(owner_conv); +} + +static inline struct LDKECDSASignature C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_a(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR owner){ + return owner->a; +} +int8_tArray CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_a(int64_t owner) { + LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* owner_conv = (LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_a(owner_conv).compact_form, 64); + return ret_arr; +} + +static inline struct LDKCVec_ECDSASignatureZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_b(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR owner){ + return owner->b; +} +ptrArray CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_b(int64_t owner) { + LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* owner_conv = (LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)untag_ptr(owner); + LDKCVec_ECDSASignatureZ ret_var = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_b(owner_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_conv_8_arr->elems, ret_var.data[i].compact_form, 64); + ret_arr_ptr[i] = ret_conv_8_arr; + } + + return ret_arr; +} + +static inline struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_ok(int64_t owner) { + LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)untag_ptr(owner); + LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ), "LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ"); + *ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_ok(owner_conv); + return tag_ptr(ret_conv, true); +} + +static inline void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_err(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_err(int64_t owner) { + LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)untag_ptr(owner); + CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_get_err(owner_conv); } typedef struct LDKChannelSigner_JCalls { @@ -1705,25 +1957,37 @@ LDKThirtyTwoBytes release_commitment_secret_LDKChannelSigner_jcall(const void* t memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } -LDKCResult_NoneNoneZ validate_holder_commitment_LDKChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_ThirtyTwoBytesZ preimages) { +LDKCResult_NoneNoneZ validate_holder_commitment_LDKChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; LDKHolderCommitmentTransaction holder_tx_var = *holder_tx; int64_t holder_tx_ref = 0; holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); holder_tx_ref = tag_ptr(holder_tx_var.inner, holder_tx_var.is_owned); - LDKCVec_ThirtyTwoBytesZ preimages_var = preimages; - ptrArray preimages_arr = NULL; - preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__); - int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8); - for (size_t i = 0; i < preimages_var.datalen; i++) { - int8_tArray preimages_conv_8_arr = init_int8_tArray(32, __LINE__); - memcpy(preimages_conv_8_arr->elems, preimages_var.data[i].data, 32); - preimages_arr_ptr[i] = preimages_conv_8_arr; + LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages_var = outbound_htlc_preimages; + ptrArray outbound_htlc_preimages_arr = NULL; + outbound_htlc_preimages_arr = init_ptrArray(outbound_htlc_preimages_var.datalen, __LINE__); + int8_tArray *outbound_htlc_preimages_arr_ptr = (int8_tArray*)(((uint8_t*)outbound_htlc_preimages_arr) + 8); + for (size_t i = 0; i < outbound_htlc_preimages_var.datalen; i++) { + int8_tArray outbound_htlc_preimages_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(outbound_htlc_preimages_conv_8_arr->elems, outbound_htlc_preimages_var.data[i].data, 32); + outbound_htlc_preimages_arr_ptr[i] = outbound_htlc_preimages_conv_8_arr; } - FREE(preimages_var.data); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 2, holder_tx_ref, (int64_t)preimages_arr); + FREE(outbound_htlc_preimages_var.data); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 2, holder_tx_ref, (int64_t)outbound_htlc_preimages_arr); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) { + LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; + int64_t idx_conv = idx; + int8_tArray secret_arr = init_int8_tArray(32, __LINE__); + memcpy(secret_arr->elems, *secret, 32); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 3, idx_conv, (int64_t)secret_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); @@ -1732,7 +1996,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKChannelSigner_jcall(const voi } LDKThirtyTwoBytes channel_keys_id_LDKChannelSigner_jcall(const void* this_arg) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 3); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 4); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); @@ -1745,7 +2009,7 @@ void provide_channel_parameters_LDKChannelSigner_jcall(void* this_arg, const LDK channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var); channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned); - js_invoke_function_void_l(j_calls->instance_ptr, 4, channel_parameters_ref); + js_invoke_function_void_l(j_calls->instance_ptr, 5, channel_parameters_ref); } static void LDKChannelSigner_JCalls_cloned(LDKChannelSigner* new_obj) { LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) new_obj->this_arg; @@ -1766,6 +2030,7 @@ static inline LDKChannelSigner LDKChannelSigner_init (int64_t o, int64_t pubkeys .get_per_commitment_point = get_per_commitment_point_LDKChannelSigner_jcall, .release_commitment_secret = release_commitment_secret_LDKChannelSigner_jcall, .validate_holder_commitment = validate_holder_commitment_LDKChannelSigner_jcall, + .validate_counterparty_revocation = validate_counterparty_revocation_LDKChannelSigner_jcall, .channel_keys_id = channel_keys_id_LDKChannelSigner_jcall, .provide_channel_parameters = provide_channel_parameters_LDKChannelSigner_jcall, .free = LDKChannelSigner_JCalls_free, @@ -1797,7 +2062,7 @@ int8_tArray CS_LDK_ChannelSigner_release_commitment_secret(int64_t this_arg, in return ret_arr; } -int64_t CS_LDK_ChannelSigner_validate_holder_commitment(int64_t this_arg, int64_t holder_tx, ptrArray preimages) { +int64_t CS_LDK_ChannelSigner_validate_holder_commitment(int64_t this_arg, int64_t holder_tx, ptrArray outbound_htlc_preimages) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr; @@ -1806,23 +2071,36 @@ int64_t CS_LDK_ChannelSigner_validate_holder_commitment(int64_t this_arg, int64 holder_tx_conv.is_owned = ptr_is_owned(holder_tx); CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv); holder_tx_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ preimages_constr; - preimages_constr.datalen = preimages->arr_len; - if (preimages_constr.datalen > 0) - preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); + LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages_constr; + outbound_htlc_preimages_constr.datalen = outbound_htlc_preimages->arr_len; + if (outbound_htlc_preimages_constr.datalen > 0) + outbound_htlc_preimages_constr.data = MALLOC(outbound_htlc_preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); else - preimages_constr.data = NULL; - int8_tArray* preimages_vals = (void*) preimages->elems; - for (size_t i = 0; i < preimages_constr.datalen; i++) { - int8_tArray preimages_conv_8 = preimages_vals[i]; - LDKThirtyTwoBytes preimages_conv_8_ref; - CHECK(preimages_conv_8->arr_len == 32); - memcpy(preimages_conv_8_ref.data, preimages_conv_8->elems, 32); FREE(preimages_conv_8); - preimages_constr.data[i] = preimages_conv_8_ref; - } - FREE(preimages); + outbound_htlc_preimages_constr.data = NULL; + int8_tArray* outbound_htlc_preimages_vals = (void*) outbound_htlc_preimages->elems; + for (size_t i = 0; i < outbound_htlc_preimages_constr.datalen; i++) { + int8_tArray outbound_htlc_preimages_conv_8 = outbound_htlc_preimages_vals[i]; + LDKThirtyTwoBytes outbound_htlc_preimages_conv_8_ref; + CHECK(outbound_htlc_preimages_conv_8->arr_len == 32); + memcpy(outbound_htlc_preimages_conv_8_ref.data, outbound_htlc_preimages_conv_8->elems, 32); FREE(outbound_htlc_preimages_conv_8); + outbound_htlc_preimages_constr.data[i] = outbound_htlc_preimages_conv_8_ref; + } + FREE(outbound_htlc_preimages); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, outbound_htlc_preimages_constr); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_ChannelSigner_validate_counterparty_revocation(int64_t this_arg, int64_t idx, int8_tArray secret) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr; + uint8_t secret_arr[32]; + CHECK(secret->arr_len == 32); + memcpy(secret_arr, secret->elems, 32); FREE(secret); + uint8_t (*secret_ref)[32] = &secret_arr; LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr); + *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref); return tag_ptr(ret_conv, true); } @@ -1874,43 +2152,42 @@ static void LDKEcdsaChannelSigner_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ sign_counterparty_commitment_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_ThirtyTwoBytesZ preimages) { +LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ sign_counterparty_commitment_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_ThirtyTwoBytesZ inbound_htlc_preimages, LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages) { LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg; LDKCommitmentTransaction commitment_tx_var = *commitment_tx; int64_t commitment_tx_ref = 0; commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned); - LDKCVec_ThirtyTwoBytesZ preimages_var = preimages; - ptrArray preimages_arr = NULL; - preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__); - int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8); - for (size_t i = 0; i < preimages_var.datalen; i++) { - int8_tArray preimages_conv_8_arr = init_int8_tArray(32, __LINE__); - memcpy(preimages_conv_8_arr->elems, preimages_var.data[i].data, 32); - preimages_arr_ptr[i] = preimages_conv_8_arr; + LDKCVec_ThirtyTwoBytesZ inbound_htlc_preimages_var = inbound_htlc_preimages; + ptrArray inbound_htlc_preimages_arr = NULL; + inbound_htlc_preimages_arr = init_ptrArray(inbound_htlc_preimages_var.datalen, __LINE__); + int8_tArray *inbound_htlc_preimages_arr_ptr = (int8_tArray*)(((uint8_t*)inbound_htlc_preimages_arr) + 8); + for (size_t i = 0; i < inbound_htlc_preimages_var.datalen; i++) { + int8_tArray inbound_htlc_preimages_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(inbound_htlc_preimages_conv_8_arr->elems, inbound_htlc_preimages_var.data[i].data, 32); + inbound_htlc_preimages_arr_ptr[i] = inbound_htlc_preimages_conv_8_arr; + } + + FREE(inbound_htlc_preimages_var.data); + LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages_var = outbound_htlc_preimages; + ptrArray outbound_htlc_preimages_arr = NULL; + outbound_htlc_preimages_arr = init_ptrArray(outbound_htlc_preimages_var.datalen, __LINE__); + int8_tArray *outbound_htlc_preimages_arr_ptr = (int8_tArray*)(((uint8_t*)outbound_htlc_preimages_arr) + 8); + for (size_t i = 0; i < outbound_htlc_preimages_var.datalen; i++) { + int8_tArray outbound_htlc_preimages_conv_8_arr = init_int8_tArray(32, __LINE__); + memcpy(outbound_htlc_preimages_conv_8_arr->elems, outbound_htlc_preimages_var.data[i].data, 32); + outbound_htlc_preimages_arr_ptr[i] = outbound_htlc_preimages_conv_8_arr; } - FREE(preimages_var.data); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 5, commitment_tx_ref, (int64_t)preimages_arr); + FREE(outbound_htlc_preimages_var.data); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 6, commitment_tx_ref, (int64_t)inbound_htlc_preimages_arr, (int64_t)outbound_htlc_preimages_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKEcdsaChannelSigner_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) { - LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg; - int64_t idx_conv = idx; - int8_tArray secret_arr = init_int8_tArray(32, __LINE__); - memcpy(secret_arr->elems, *secret, 32); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 6, idx_conv, (int64_t)secret_arr); - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - FREE(untag_ptr(ret)); - return ret_conv; -} LDKCResult_ECDSASignatureNoneZ sign_holder_commitment_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) { LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg; LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx; @@ -2065,7 +2342,6 @@ static inline LDKEcdsaChannelSigner LDKEcdsaChannelSigner_init (int64_t o, int64 LDKEcdsaChannelSigner ret = { .this_arg = (void*) calls, .sign_counterparty_commitment = sign_counterparty_commitment_LDKEcdsaChannelSigner_jcall, - .validate_counterparty_revocation = validate_counterparty_revocation_LDKEcdsaChannelSigner_jcall, .sign_holder_commitment = sign_holder_commitment_LDKEcdsaChannelSigner_jcall, .sign_justice_revoked_output = sign_justice_revoked_output_LDKEcdsaChannelSigner_jcall, .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKEcdsaChannelSigner_jcall, @@ -2085,7 +2361,7 @@ uint64_t CS_LDK_LDKEcdsaChannelSigner_new(int32_t o, int32_t ChannelSigner, int *res_ptr = LDKEcdsaChannelSigner_init(o, ChannelSigner, pubkeys); return tag_ptr(res_ptr, true); } -int64_t CS_LDK_EcdsaChannelSigner_sign_counterparty_commitment(int64_t this_arg, int64_t commitment_tx, ptrArray preimages) { +int64_t CS_LDK_EcdsaChannelSigner_sign_counterparty_commitment(int64_t this_arg, int64_t commitment_tx, ptrArray inbound_htlc_preimages, ptrArray outbound_htlc_preimages) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr; @@ -2094,36 +2370,38 @@ int64_t CS_LDK_EcdsaChannelSigner_sign_counterparty_commitment(int64_t this_arg commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx); CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); commitment_tx_conv.is_owned = false; - LDKCVec_ThirtyTwoBytesZ preimages_constr; - preimages_constr.datalen = preimages->arr_len; - if (preimages_constr.datalen > 0) - preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); + LDKCVec_ThirtyTwoBytesZ inbound_htlc_preimages_constr; + inbound_htlc_preimages_constr.datalen = inbound_htlc_preimages->arr_len; + if (inbound_htlc_preimages_constr.datalen > 0) + inbound_htlc_preimages_constr.data = MALLOC(inbound_htlc_preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); + else + inbound_htlc_preimages_constr.data = NULL; + int8_tArray* inbound_htlc_preimages_vals = (void*) inbound_htlc_preimages->elems; + for (size_t i = 0; i < inbound_htlc_preimages_constr.datalen; i++) { + int8_tArray inbound_htlc_preimages_conv_8 = inbound_htlc_preimages_vals[i]; + LDKThirtyTwoBytes inbound_htlc_preimages_conv_8_ref; + CHECK(inbound_htlc_preimages_conv_8->arr_len == 32); + memcpy(inbound_htlc_preimages_conv_8_ref.data, inbound_htlc_preimages_conv_8->elems, 32); FREE(inbound_htlc_preimages_conv_8); + inbound_htlc_preimages_constr.data[i] = inbound_htlc_preimages_conv_8_ref; + } + FREE(inbound_htlc_preimages); + LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages_constr; + outbound_htlc_preimages_constr.datalen = outbound_htlc_preimages->arr_len; + if (outbound_htlc_preimages_constr.datalen > 0) + outbound_htlc_preimages_constr.data = MALLOC(outbound_htlc_preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); else - preimages_constr.data = NULL; - int8_tArray* preimages_vals = (void*) preimages->elems; - for (size_t i = 0; i < preimages_constr.datalen; i++) { - int8_tArray preimages_conv_8 = preimages_vals[i]; - LDKThirtyTwoBytes preimages_conv_8_ref; - CHECK(preimages_conv_8->arr_len == 32); - memcpy(preimages_conv_8_ref.data, preimages_conv_8->elems, 32); FREE(preimages_conv_8); - preimages_constr.data[i] = preimages_conv_8_ref; - } - FREE(preimages); + outbound_htlc_preimages_constr.data = NULL; + int8_tArray* outbound_htlc_preimages_vals = (void*) outbound_htlc_preimages->elems; + for (size_t i = 0; i < outbound_htlc_preimages_constr.datalen; i++) { + int8_tArray outbound_htlc_preimages_conv_8 = outbound_htlc_preimages_vals[i]; + LDKThirtyTwoBytes outbound_htlc_preimages_conv_8_ref; + CHECK(outbound_htlc_preimages_conv_8->arr_len == 32); + memcpy(outbound_htlc_preimages_conv_8_ref.data, outbound_htlc_preimages_conv_8->elems, 32); FREE(outbound_htlc_preimages_conv_8); + outbound_htlc_preimages_constr.data[i] = outbound_htlc_preimages_conv_8_ref; + } + FREE(outbound_htlc_preimages); LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ), "LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ"); - *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, preimages_constr); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_EcdsaChannelSigner_validate_counterparty_revocation(int64_t this_arg, int64_t idx, int8_tArray secret) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr; - uint8_t secret_arr[32]; - CHECK(secret->arr_len == 32); - memcpy(secret_arr, secret->elems, 32); FREE(secret); - uint8_t (*secret_ref)[32] = &secret_arr; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref); + *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, inbound_htlc_preimages_constr, outbound_htlc_preimages_constr); return tag_ptr(ret_conv, true); } @@ -2425,42 +2703,26 @@ jboolean CS_LDK_LDKCOption_boolZ_Some_get_some(int64_t ptr) { jboolean some_conv = obj->some; return some_conv; } -static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) { - LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = CVec_u8Z_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){ +static inline struct LDKWitness CResult_WitnessNoneZ_get_ok(LDKCResult_WitnessNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return CVec_CVec_u8ZZ_clone(&*owner->contents.result); + return Witness_clone(&*owner->contents.result); } -ptrArray CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_get_ok(int64_t owner) { - LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner); - LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - LDKCVec_u8Z ret_conv_8_var = ret_var.data[i]; - int8_tArray ret_conv_8_arr = init_int8_tArray(ret_conv_8_var.datalen, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_conv_8_var.data, ret_conv_8_var.datalen); - CVec_u8Z_free(ret_conv_8_var); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); +int8_tArray CS_LDK_CResult_WitnessNoneZ_get_ok(int64_t owner) { + LDKCResult_WitnessNoneZ* owner_conv = (LDKCResult_WitnessNoneZ*)untag_ptr(owner); + LDKWitness ret_var = CResult_WitnessNoneZ_get_ok(owner_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Witness_free(ret_var); return ret_arr; } -static inline void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){ +static inline void CResult_WitnessNoneZ_get_err(LDKCResult_WitnessNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -void CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_get_err(int64_t owner) { - LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner); - CResult_CVec_CVec_u8ZZNoneZ_get_err(owner_conv); +void CS_LDK_CResult_WitnessNoneZ_get_err(int64_t owner) { + LDKCResult_WitnessNoneZ* owner_conv = (LDKCResult_WitnessNoneZ*)untag_ptr(owner); + CResult_WitnessNoneZ_get_err(owner_conv); } static inline struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){ @@ -2489,27 +2751,62 @@ int64_t CS_LDK_CResult_InMemorySignerDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -int8_tArray CS_LDK_CResult_TransactionNoneZ_get_ok(int64_t owner) { - LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner); - LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; -} - -static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +uint32_t CS_LDK_LDKCandidateRouteHop_ty_from_ptr(int64_t ptr) { + LDKCandidateRouteHop *obj = (LDKCandidateRouteHop*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCandidateRouteHop_FirstHop: return 0; + case LDKCandidateRouteHop_PublicHop: return 1; + case LDKCandidateRouteHop_PrivateHop: return 2; + case LDKCandidateRouteHop_Blinded: return 3; + case LDKCandidateRouteHop_OneHopBlinded: return 4; + default: abort(); + } } -void CS_LDK_CResult_TransactionNoneZ_get_err(int64_t owner) { - LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner); - CResult_TransactionNoneZ_get_err(owner_conv); +int64_t CS_LDK_LDKCandidateRouteHop_FirstHop_get_first_hop(int64_t ptr) { + LDKCandidateRouteHop *obj = (LDKCandidateRouteHop*)untag_ptr(ptr); + CHECK(obj->tag == LDKCandidateRouteHop_FirstHop); + LDKFirstHopCandidate first_hop_var = obj->first_hop; + int64_t first_hop_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hop_var); + first_hop_ref = tag_ptr(first_hop_var.inner, false); + return first_hop_ref; +} +int64_t CS_LDK_LDKCandidateRouteHop_PublicHop_get_public_hop(int64_t ptr) { + LDKCandidateRouteHop *obj = (LDKCandidateRouteHop*)untag_ptr(ptr); + CHECK(obj->tag == LDKCandidateRouteHop_PublicHop); + LDKPublicHopCandidate public_hop_var = obj->public_hop; + int64_t public_hop_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(public_hop_var); + public_hop_ref = tag_ptr(public_hop_var.inner, false); + return public_hop_ref; +} +int64_t CS_LDK_LDKCandidateRouteHop_PrivateHop_get_private_hop(int64_t ptr) { + LDKCandidateRouteHop *obj = (LDKCandidateRouteHop*)untag_ptr(ptr); + CHECK(obj->tag == LDKCandidateRouteHop_PrivateHop); + LDKPrivateHopCandidate private_hop_var = obj->private_hop; + int64_t private_hop_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(private_hop_var); + private_hop_ref = tag_ptr(private_hop_var.inner, false); + return private_hop_ref; +} +int64_t CS_LDK_LDKCandidateRouteHop_Blinded_get_blinded(int64_t ptr) { + LDKCandidateRouteHop *obj = (LDKCandidateRouteHop*)untag_ptr(ptr); + CHECK(obj->tag == LDKCandidateRouteHop_Blinded); + LDKBlindedPathCandidate blinded_var = obj->blinded; + int64_t blinded_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_var); + blinded_ref = tag_ptr(blinded_var.inner, false); + return blinded_ref; +} +int64_t CS_LDK_LDKCandidateRouteHop_OneHopBlinded_get_one_hop_blinded(int64_t ptr) { + LDKCandidateRouteHop *obj = (LDKCandidateRouteHop*)untag_ptr(ptr); + CHECK(obj->tag == LDKCandidateRouteHop_OneHopBlinded); + LDKOneHopBlindedPathCandidate one_hop_blinded_var = obj->one_hop_blinded; + int64_t one_hop_blinded_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(one_hop_blinded_var); + one_hop_blinded_ref = tag_ptr(one_hop_blinded_var.inner, false); + return one_hop_blinded_ref; } - typedef struct LDKScoreLookUp_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -2520,19 +2817,11 @@ static void LDKScoreLookUp_JCalls_free(void* this_arg) { FREE(j_calls); } } -uint64_t channel_penalty_msat_LDKScoreLookUp_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage, const LDKProbabilisticScoringFeeParameters * score_params) { +uint64_t channel_penalty_msat_LDKScoreLookUp_jcall(const void* this_arg, const LDKCandidateRouteHop * candidate, LDKChannelUsage usage, const LDKProbabilisticScoringFeeParameters * score_params) { LDKScoreLookUp_JCalls *j_calls = (LDKScoreLookUp_JCalls*) this_arg; - int64_t short_channel_id_conv = short_channel_id; - LDKNodeId source_var = *source; - int64_t source_ref = 0; - source_var = NodeId_clone(&source_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); - source_ref = tag_ptr(source_var.inner, source_var.is_owned); - LDKNodeId target_var = *target; - int64_t target_ref = 0; - target_var = NodeId_clone(&target_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); - target_ref = tag_ptr(target_var.inner, target_var.is_owned); + LDKCandidateRouteHop *ret_candidate = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop ret conversion"); + *ret_candidate = CandidateRouteHop_clone(candidate); + int64_t ref_candidate = tag_ptr(ret_candidate, true); LDKChannelUsage usage_var = usage; int64_t usage_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var); @@ -2542,7 +2831,7 @@ uint64_t channel_penalty_msat_LDKScoreLookUp_jcall(const void* this_arg, uint64_ score_params_var = ProbabilisticScoringFeeParameters_clone(&score_params_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_var); score_params_ref = tag_ptr(score_params_var.inner, score_params_var.is_owned); - return js_invoke_function_l_lllll(j_calls->instance_ptr, 16, short_channel_id_conv, source_ref, target_ref, usage_ref, score_params_ref); + return js_invoke_function_l_lll(j_calls->instance_ptr, 16, ref_candidate, usage_ref, score_params_ref); } static void LDKScoreLookUp_JCalls_cloned(LDKScoreLookUp* new_obj) { LDKScoreLookUp_JCalls *j_calls = (LDKScoreLookUp_JCalls*) new_obj->this_arg; @@ -2565,20 +2854,11 @@ uint64_t CS_LDK_LDKScoreLookUp_new(int32_t o) { *res_ptr = LDKScoreLookUp_init(o); return tag_ptr(res_ptr, true); } -int64_t CS_LDK_ScoreLookUp_channel_penalty_msat(int64_t this_arg, int64_t short_channel_id, int64_t source, int64_t target, int64_t usage, int64_t score_params) { +int64_t CS_LDK_ScoreLookUp_channel_penalty_msat(int64_t this_arg, int64_t candidate, int64_t usage, int64_t score_params) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKScoreLookUp* this_arg_conv = (LDKScoreLookUp*)this_arg_ptr; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; + LDKCandidateRouteHop* candidate_conv = (LDKCandidateRouteHop*)untag_ptr(candidate); LDKChannelUsage usage_conv; usage_conv.inner = untag_ptr(usage); usage_conv.is_owned = ptr_is_owned(usage); @@ -2589,7 +2869,7 @@ int64_t CS_LDK_ScoreLookUp_channel_penalty_msat(int64_t this_arg, int64_t short score_params_conv.is_owned = ptr_is_owned(score_params); CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); score_params_conv.is_owned = false; - int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv, &score_params_conv); + int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, candidate_conv, usage_conv, &score_params_conv); return ret_conv; } @@ -2603,7 +2883,7 @@ static void LDKScoreUpdate_JCalls_free(void* this_arg) { FREE(j_calls); } } -void payment_path_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id) { +void payment_path_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; LDKPath path_var = *path; int64_t path_ref = 0; @@ -2611,18 +2891,20 @@ void payment_path_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * pa CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t short_channel_id_conv = short_channel_id; - js_invoke_function_void_ll(j_calls->instance_ptr, 17, path_ref, short_channel_id_conv); + int64_t duration_since_epoch_conv = duration_since_epoch; + js_invoke_function_void_lll(j_calls->instance_ptr, 17, path_ref, short_channel_id_conv, duration_since_epoch_conv); } -void payment_path_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path) { +void payment_path_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; LDKPath path_var = *path; int64_t path_ref = 0; path_var = Path_clone(&path_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); path_ref = tag_ptr(path_var.inner, path_var.is_owned); - js_invoke_function_void_l(j_calls->instance_ptr, 18, path_ref); + int64_t duration_since_epoch_conv = duration_since_epoch; + js_invoke_function_void_ll(j_calls->instance_ptr, 18, path_ref, duration_since_epoch_conv); } -void probe_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id) { +void probe_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; LDKPath path_var = *path; int64_t path_ref = 0; @@ -2630,16 +2912,23 @@ void probe_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uin CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t short_channel_id_conv = short_channel_id; - js_invoke_function_void_ll(j_calls->instance_ptr, 19, path_ref, short_channel_id_conv); + int64_t duration_since_epoch_conv = duration_since_epoch; + js_invoke_function_void_lll(j_calls->instance_ptr, 19, path_ref, short_channel_id_conv, duration_since_epoch_conv); } -void probe_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path) { +void probe_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; LDKPath path_var = *path; int64_t path_ref = 0; path_var = Path_clone(&path_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); path_ref = tag_ptr(path_var.inner, path_var.is_owned); - js_invoke_function_void_l(j_calls->instance_ptr, 20, path_ref); + int64_t duration_since_epoch_conv = duration_since_epoch; + js_invoke_function_void_ll(j_calls->instance_ptr, 20, path_ref, duration_since_epoch_conv); +} +void time_passed_LDKScoreUpdate_jcall(void* this_arg, uint64_t duration_since_epoch) { + LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; + int64_t duration_since_epoch_conv = duration_since_epoch; + js_invoke_function_void_l(j_calls->instance_ptr, 21, duration_since_epoch_conv); } static void LDKScoreUpdate_JCalls_cloned(LDKScoreUpdate* new_obj) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) new_obj->this_arg; @@ -2656,6 +2945,7 @@ static inline LDKScoreUpdate LDKScoreUpdate_init (int64_t o) { .payment_path_successful = payment_path_successful_LDKScoreUpdate_jcall, .probe_failed = probe_failed_LDKScoreUpdate_jcall, .probe_successful = probe_successful_LDKScoreUpdate_jcall, + .time_passed = time_passed_LDKScoreUpdate_jcall, .free = LDKScoreUpdate_JCalls_free, }; return ret; @@ -2665,7 +2955,7 @@ uint64_t CS_LDK_LDKScoreUpdate_new(int32_t o) { *res_ptr = LDKScoreUpdate_init(o); return tag_ptr(res_ptr, true); } -void CS_LDK_ScoreUpdate_payment_path_failed(int64_t this_arg, int64_t path, int64_t short_channel_id) { +void CS_LDK_ScoreUpdate_payment_path_failed(int64_t this_arg, int64_t path, int64_t short_channel_id, int64_t duration_since_epoch) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKScoreUpdate* this_arg_conv = (LDKScoreUpdate*)this_arg_ptr; @@ -2674,10 +2964,10 @@ void CS_LDK_ScoreUpdate_payment_path_failed(int64_t this_arg, int64_t path, int path_conv.is_owned = ptr_is_owned(path); CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); path_conv.is_owned = false; - (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, &path_conv, short_channel_id); + (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, &path_conv, short_channel_id, duration_since_epoch); } -void CS_LDK_ScoreUpdate_payment_path_successful(int64_t this_arg, int64_t path) { +void CS_LDK_ScoreUpdate_payment_path_successful(int64_t this_arg, int64_t path, int64_t duration_since_epoch) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKScoreUpdate* this_arg_conv = (LDKScoreUpdate*)this_arg_ptr; @@ -2686,10 +2976,10 @@ void CS_LDK_ScoreUpdate_payment_path_successful(int64_t this_arg, int64_t path) path_conv.is_owned = ptr_is_owned(path); CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); path_conv.is_owned = false; - (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, &path_conv); + (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, &path_conv, duration_since_epoch); } -void CS_LDK_ScoreUpdate_probe_failed(int64_t this_arg, int64_t path, int64_t short_channel_id) { +void CS_LDK_ScoreUpdate_probe_failed(int64_t this_arg, int64_t path, int64_t short_channel_id, int64_t duration_since_epoch) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKScoreUpdate* this_arg_conv = (LDKScoreUpdate*)this_arg_ptr; @@ -2698,10 +2988,10 @@ void CS_LDK_ScoreUpdate_probe_failed(int64_t this_arg, int64_t path, int64_t sh path_conv.is_owned = ptr_is_owned(path); CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); path_conv.is_owned = false; - (this_arg_conv->probe_failed)(this_arg_conv->this_arg, &path_conv, short_channel_id); + (this_arg_conv->probe_failed)(this_arg_conv->this_arg, &path_conv, short_channel_id, duration_since_epoch); } -void CS_LDK_ScoreUpdate_probe_successful(int64_t this_arg, int64_t path) { +void CS_LDK_ScoreUpdate_probe_successful(int64_t this_arg, int64_t path, int64_t duration_since_epoch) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKScoreUpdate* this_arg_conv = (LDKScoreUpdate*)this_arg_ptr; @@ -2710,7 +3000,14 @@ void CS_LDK_ScoreUpdate_probe_successful(int64_t this_arg, int64_t path) { path_conv.is_owned = ptr_is_owned(path); CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); path_conv.is_owned = false; - (this_arg_conv->probe_successful)(this_arg_conv->this_arg, &path_conv); + (this_arg_conv->probe_successful)(this_arg_conv->this_arg, &path_conv, duration_since_epoch); +} + +void CS_LDK_ScoreUpdate_time_passed(int64_t this_arg, int64_t duration_since_epoch) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKScoreUpdate* this_arg_conv = (LDKScoreUpdate*)this_arg_ptr; + (this_arg_conv->time_passed)(this_arg_conv->this_arg, duration_since_epoch); } typedef struct LDKLockableScore_JCalls { @@ -2725,7 +3022,7 @@ static void LDKLockableScore_JCalls_free(void* this_arg) { } LDKScoreLookUp read_lock_LDKLockableScore_jcall(const void* this_arg) { LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 21); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 22); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKScoreLookUp ret_conv = *(LDKScoreLookUp*)(ret_ptr); @@ -2738,7 +3035,7 @@ LDKScoreLookUp read_lock_LDKLockableScore_jcall(const void* this_arg) { } LDKScoreUpdate write_lock_LDKLockableScore_jcall(const void* this_arg) { LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 22); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 23); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKScoreUpdate ret_conv = *(LDKScoreUpdate*)(ret_ptr); @@ -2802,7 +3099,7 @@ static void LDKWriteableScore_JCalls_free(void* this_arg) { } LDKCVec_u8Z write_LDKWriteableScore_jcall(const void* this_arg) { LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 23); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 24); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -2918,6 +3215,124 @@ int64_t CS_LDK_CResult_RouteLightningErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ + LDKBlindedPayInfo ret = owner->a; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_a(int64_t owner) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); + LDKBlindedPayInfo ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ + LDKBlindedPath ret = owner->b; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_b(int64_t owner) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); + LDKBlindedPath ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(const LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *orig) { + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ) * orig->datalen, "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_BlindedPayInfoBlindedPathZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(&*owner->contents.result); +} +int64_tArray CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(int64_t owner) { + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(owner); + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret_var = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_ok(owner_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t l = 0; l < ret_var.datalen; l++) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); + *ret_conv_37_conv = ret_var.data[l]; + ret_arr_ptr[l] = tag_ptr(ret_conv_37_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + +static inline void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(int64_t owner) { + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(owner); + CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_get_err(owner_conv); +} + +static inline struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ + LDKOnionMessagePath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_OnionMessagePathNoneZ_get_ok(int64_t owner) { + LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); + LDKOnionMessagePath ret_var = CResult_OnionMessagePathNoneZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline void CResult_OnionMessagePathNoneZ_get_err(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_OnionMessagePathNoneZ_get_err(int64_t owner) { + LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); + CResult_OnionMessagePathNoneZ_get_err(owner_conv); +} + +static inline struct LDKCVec_BlindedPathZ CResult_CVec_BlindedPathZNoneZ_get_ok(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return CVec_BlindedPathZ_clone(&*owner->contents.result); +} +int64_tArray CS_LDK_CResult_CVec_BlindedPathZNoneZ_get_ok(int64_t owner) { + LDKCResult_CVec_BlindedPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(owner); + LDKCVec_BlindedPathZ ret_var = CResult_CVec_BlindedPathZNoneZ_get_ok(owner_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t n = 0; n < ret_var.datalen; n++) { + LDKBlindedPath ret_conv_13_var = ret_var.data[n]; + int64_t ret_conv_13_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); + ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); + ret_arr_ptr[n] = ret_conv_13_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +static inline void CResult_CVec_BlindedPathZNoneZ_get_err(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_CVec_BlindedPathZNoneZ_get_err(int64_t owner) { + LDKCResult_CVec_BlindedPathZNoneZ* owner_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(owner); + CResult_CVec_BlindedPathZNoneZ_get_err(owner_conv); +} + static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ LDKInFlightHtlcs ret = *owner->contents.result; ret.is_owned = false; @@ -3100,41 +3515,6 @@ int64_t CS_LDK_CResult_PaymentParametersDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline struct LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPayInfo ret = owner->a; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_a(int64_t owner) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); - LDKBlindedPayInfo ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_a(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ - LDKBlindedPath ret = owner->b; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_get_b(int64_t owner) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); - LDKBlindedPath ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_b(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(const LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *orig) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ) * orig->datalen, "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_BlindedPayInfoBlindedPathZ_clone(&orig->data[i]); - } - return ret; -} static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3347,14 +3727,13 @@ static void LDKLogger_JCalls_free(void* this_arg) { FREE(j_calls); } } -void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { +void log_LDKLogger_jcall(const void* this_arg, LDKRecord record) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; - LDKRecord record_var = *record; + LDKRecord record_var = record; int64_t record_ref = 0; - record_var = Record_clone(&record_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); record_ref = tag_ptr(record_var.inner, record_var.is_owned); - js_invoke_function_void_l(j_calls->instance_ptr, 24, record_ref); + js_invoke_function_void_l(j_calls->instance_ptr, 25, record_ref); } static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg; @@ -3403,6 +3782,32 @@ int64_t CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKBestBlock CResult_BestBlockDecodeErrorZ_get_ok(LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR owner){ + LDKBestBlock ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BestBlockDecodeErrorZ* owner_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(owner); + LDKBestBlock ret_var = CResult_BestBlockDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_BestBlockDecodeErrorZ_get_err(LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_BestBlockDecodeErrorZ* owner_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BestBlockDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ return owner->a; } @@ -3430,31 +3835,40 @@ static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ } return ret; } -static inline struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_get_a(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *NONNULL_PTR owner){ +static inline struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_get_a(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } -int8_tArray CS_LDK_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_get_a(int64_t owner) { - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ* owner_conv = (LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ*)untag_ptr(owner); +int8_tArray CS_LDK_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_get_a(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ*)untag_ptr(owner); int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_get_a(owner_conv).data, 32); + memcpy(ret_arr->elems, C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_get_a(owner_conv).data, 32); return ret_arr; } -static inline struct LDKCOption_ThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_get_b(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *NONNULL_PTR owner){ - return COption_ThirtyTwoBytesZ_clone(&owner->b); +static inline uint32_t C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_get_b(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR owner){ + return owner->b; } -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_get_b(int64_t owner) { - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ* owner_conv = (LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ*)untag_ptr(owner); +int32_t CS_LDK_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_get_b(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ*)untag_ptr(owner); + int32_t ret_conv = C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_get_b(owner_conv); + return ret_conv; +} + +static inline struct LDKCOption_ThirtyTwoBytesZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_get_c(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR owner){ + return COption_ThirtyTwoBytesZ_clone(&owner->c); +} +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_get_c(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ*)untag_ptr(owner); LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_get_b(owner_conv); + *ret_copy = C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_get_c(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ CVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ_clone(const LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ *orig) { - LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ) * orig->datalen, "LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_clone(const LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ *orig) { + LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ) * orig->datalen, "LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone(&orig->data[i]); + ret.data[i] = C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(&orig->data[i]); } return ret; } @@ -3477,12 +3891,48 @@ void CS_LDK_CResult_ChannelMonitorUpdateStatusNoneZ_get_err(int64_t owner) { CResult_ChannelMonitorUpdateStatusNoneZ_get_err(owner_conv); } +uint32_t CS_LDK_LDKClosureReason_ty_from_ptr(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + switch(obj->tag) { + case LDKClosureReason_CounterpartyForceClosed: return 0; + case LDKClosureReason_HolderForceClosed: return 1; + case LDKClosureReason_LegacyCooperativeClosure: return 2; + case LDKClosureReason_CounterpartyInitiatedCooperativeClosure: return 3; + case LDKClosureReason_LocallyInitiatedCooperativeClosure: return 4; + case LDKClosureReason_CommitmentTxConfirmed: return 5; + case LDKClosureReason_FundingTimedOut: return 6; + case LDKClosureReason_ProcessingError: return 7; + case LDKClosureReason_DisconnectedPeer: return 8; + case LDKClosureReason_OutdatedChannelManager: return 9; + case LDKClosureReason_CounterpartyCoopClosedUnfundedChannel: return 10; + case LDKClosureReason_FundingBatchClosure: return 11; + case LDKClosureReason_HTLCsTimedOut: return 12; + default: abort(); + } +} +int64_t CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_CounterpartyForceClosed); + LDKUntrustedString peer_msg_var = obj->counterparty_force_closed.peer_msg; + int64_t peer_msg_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_var); + peer_msg_ref = tag_ptr(peer_msg_var.inner, false); + return peer_msg_ref; +} +jstring CS_LDK_LDKClosureReason_ProcessingError_get_err(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_ProcessingError); + LDKStr err_str = obj->processing_error.err; + jstring err_conv = str_ref_to_cs(err_str.chars, err_str.len); + return err_conv; +} uint32_t CS_LDK_LDKMonitorEvent_ty_from_ptr(int64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); switch(obj->tag) { case LDKMonitorEvent_HTLCEvent: return 0; - case LDKMonitorEvent_HolderForceClosed: return 1; - case LDKMonitorEvent_Completed: return 2; + case LDKMonitorEvent_HolderForceClosedWithInfo: return 1; + case LDKMonitorEvent_HolderForceClosed: return 2; + case LDKMonitorEvent_Completed: return 3; default: abort(); } } @@ -3495,6 +3945,30 @@ int64_t CS_LDK_LDKMonitorEvent_HTLCEvent_get_htlc_event(int64_t ptr) { htlc_event_ref = tag_ptr(htlc_event_var.inner, false); return htlc_event_ref; } +int64_t CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_reason(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + int64_t reason_ref = tag_ptr(&obj->holder_force_closed_with_info.reason, false); + return reason_ref; +} +int64_t CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_outpoint(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + LDKOutPoint outpoint_var = obj->holder_force_closed_with_info.outpoint; + int64_t outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); + outpoint_ref = tag_ptr(outpoint_var.inner, false); + return outpoint_ref; +} +int64_t CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_channel_id(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + LDKChannelId channel_id_var = obj->holder_force_closed_with_info.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; +} int64_t CS_LDK_LDKMonitorEvent_HolderForceClosed_get_holder_force_closed(int64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKMonitorEvent_HolderForceClosed); @@ -3513,6 +3987,15 @@ int64_t CS_LDK_LDKMonitorEvent_Completed_get_funding_txo(int64_t ptr) { funding_txo_ref = tag_ptr(funding_txo_var.inner, false); return funding_txo_ref; } +int64_t CS_LDK_LDKMonitorEvent_Completed_get_channel_id(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_Completed); + LDKChannelId channel_id_var = obj->completed.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; +} int64_t CS_LDK_LDKMonitorEvent_Completed_get_monitor_update_id(int64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKMonitorEvent_Completed); @@ -3526,26 +4009,40 @@ static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_Monit } return ret; } -static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ +static inline struct LDKOutPoint C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ LDKOutPoint ret = owner->a; ret.is_owned = false; return ret; } -int64_t CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(int64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); - LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv); +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(int64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKOutPoint ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ - return CVec_MonitorEventZ_clone(&owner->b); +static inline struct LDKChannelId C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ + LDKChannelId ret = owner->b; + ret.is_owned = false; + return ret; } -int64_tArray CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(int64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); - LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv); +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(int64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKChannelId ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKCVec_MonitorEventZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ + return CVec_MonitorEventZ_clone(&owner->c); +} +int64_tArray CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(int64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKCVec_MonitorEventZ ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(owner_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); @@ -3560,20 +4057,20 @@ int64_tArray CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(int64_t return ret_arr; } -static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ - return owner->c; +static inline struct LDKPublicKey C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ + return owner->d; } -int8_tArray CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(int64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); +int8_tArray CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(int64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form, 33); + memcpy(ret_arr->elems, C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(owner_conv).compressed_form, 33); return ret_arr; } -static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) { - LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ *orig) { + LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]); + ret.data[i] = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]); } return ret; } @@ -3759,6 +4256,123 @@ int64_t CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKOfferId CResult_OfferIdDecodeErrorZ_get_ok(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR owner){ + LDKOfferId ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferIdDecodeErrorZ* owner_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(owner); + LDKOfferId ret_var = CResult_OfferIdDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OfferIdDecodeErrorZ_get_err(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_OfferIdDecodeErrorZ* owner_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OfferIdDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline void CResult_NoneBolt12SemanticErrorZ_get_ok(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +void CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); + CResult_NoneBolt12SemanticErrorZ_get_ok(owner_conv); +} + +static inline enum LDKBolt12SemanticError CResult_NoneBolt12SemanticErrorZ_get_err(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_NoneBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKOffer CResult_OfferBolt12SemanticErrorZ_get_ok(LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKOffer ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(owner); + LDKOffer ret_var = CResult_OfferBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKBolt12SemanticError CResult_OfferBolt12SemanticErrorZ_get_err(LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_OfferBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_OfferBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKInvoiceRequestWithDerivedPayerIdBuilder CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequestWithDerivedPayerIdBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequestWithDerivedPayerIdBuilder ret_var = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKBolt12SemanticError CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKInvoiceRequestWithExplicitPayerIdBuilder CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequestWithExplicitPayerIdBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequestWithExplicitPayerIdBuilder ret_var = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKBolt12SemanticError CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + static inline struct LDKOffer CResult_OfferBolt12ParseErrorZ_get_ok(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner){ LDKOffer ret = *owner->contents.result; ret.is_owned = false; @@ -3787,27 +4401,6 @@ int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline struct LDKPublicKey CResult_PublicKeySecp256k1ErrorZ_get_ok(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -int8_tArray CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_ok(int64_t owner) { - LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, CResult_PublicKeySecp256k1ErrorZ_get_ok(owner_conv).compressed_form, 33); - return ret_arr; -} - -static inline enum LDKSecp256k1Error CResult_PublicKeySecp256k1ErrorZ_get_err(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -int32_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_err(int64_t owner) { - LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKSecp256k1Error_to_cs(CResult_PublicKeySecp256k1ErrorZ_get_err(owner_conv)); - return ret_conv; -} - static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ LDKNodeId ret = *owner->contents.result; ret.is_owned = false; @@ -3834,6 +4427,27 @@ int64_t CS_LDK_CResult_NodeIdDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKPublicKey CResult_PublicKeySecp256k1ErrorZ_get_ok(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +int8_tArray CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_ok(int64_t owner) { + LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, CResult_PublicKeySecp256k1ErrorZ_get_ok(owner_conv).compressed_form, 33); + return ret_arr; +} + +static inline enum LDKSecp256k1Error CResult_PublicKeySecp256k1ErrorZ_get_err(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +int32_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_err(int64_t owner) { + LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKSecp256k1Error_to_cs(CResult_PublicKeySecp256k1ErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKNetworkUpdate_ty_from_ptr(int64_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); switch(obj->tag) { @@ -3976,7 +4590,7 @@ LDKUtxoResult get_utxo_LDKUtxoLookup_jcall(const void* this_arg, const uint8_t ( int8_tArray chain_hash_arr = init_int8_tArray(32, __LINE__); memcpy(chain_hash_arr->elems, *chain_hash, 32); int64_t short_channel_id_conv = short_channel_id; - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 25, (int64_t)chain_hash_arr, short_channel_id_conv); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 26, (int64_t)chain_hash_arr, short_channel_id_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKUtxoResult ret_conv = *(LDKUtxoResult*)(ret_ptr); @@ -4213,32 +4827,36 @@ uint32_t CS_LDK_LDKMessageSendEvent_ty_from_ptr(int64_t ptr) { case LDKMessageSendEvent_SendOpenChannelV2: return 3; case LDKMessageSendEvent_SendFundingCreated: return 4; case LDKMessageSendEvent_SendFundingSigned: return 5; - case LDKMessageSendEvent_SendTxAddInput: return 6; - case LDKMessageSendEvent_SendTxAddOutput: return 7; - case LDKMessageSendEvent_SendTxRemoveInput: return 8; - case LDKMessageSendEvent_SendTxRemoveOutput: return 9; - case LDKMessageSendEvent_SendTxComplete: return 10; - case LDKMessageSendEvent_SendTxSignatures: return 11; - case LDKMessageSendEvent_SendTxInitRbf: return 12; - case LDKMessageSendEvent_SendTxAckRbf: return 13; - case LDKMessageSendEvent_SendTxAbort: return 14; - case LDKMessageSendEvent_SendChannelReady: return 15; - case LDKMessageSendEvent_SendAnnouncementSignatures: return 16; - case LDKMessageSendEvent_UpdateHTLCs: return 17; - case LDKMessageSendEvent_SendRevokeAndACK: return 18; - case LDKMessageSendEvent_SendClosingSigned: return 19; - case LDKMessageSendEvent_SendShutdown: return 20; - case LDKMessageSendEvent_SendChannelReestablish: return 21; - case LDKMessageSendEvent_SendChannelAnnouncement: return 22; - case LDKMessageSendEvent_BroadcastChannelAnnouncement: return 23; - case LDKMessageSendEvent_BroadcastChannelUpdate: return 24; - case LDKMessageSendEvent_BroadcastNodeAnnouncement: return 25; - case LDKMessageSendEvent_SendChannelUpdate: return 26; - case LDKMessageSendEvent_HandleError: return 27; - case LDKMessageSendEvent_SendChannelRangeQuery: return 28; - case LDKMessageSendEvent_SendShortIdsQuery: return 29; - case LDKMessageSendEvent_SendReplyChannelRange: return 30; - case LDKMessageSendEvent_SendGossipTimestampFilter: return 31; + case LDKMessageSendEvent_SendStfu: return 6; + case LDKMessageSendEvent_SendSplice: return 7; + case LDKMessageSendEvent_SendSpliceAck: return 8; + case LDKMessageSendEvent_SendSpliceLocked: return 9; + case LDKMessageSendEvent_SendTxAddInput: return 10; + case LDKMessageSendEvent_SendTxAddOutput: return 11; + case LDKMessageSendEvent_SendTxRemoveInput: return 12; + case LDKMessageSendEvent_SendTxRemoveOutput: return 13; + case LDKMessageSendEvent_SendTxComplete: return 14; + case LDKMessageSendEvent_SendTxSignatures: return 15; + case LDKMessageSendEvent_SendTxInitRbf: return 16; + case LDKMessageSendEvent_SendTxAckRbf: return 17; + case LDKMessageSendEvent_SendTxAbort: return 18; + case LDKMessageSendEvent_SendChannelReady: return 19; + case LDKMessageSendEvent_SendAnnouncementSignatures: return 20; + case LDKMessageSendEvent_UpdateHTLCs: return 21; + case LDKMessageSendEvent_SendRevokeAndACK: return 22; + case LDKMessageSendEvent_SendClosingSigned: return 23; + case LDKMessageSendEvent_SendShutdown: return 24; + case LDKMessageSendEvent_SendChannelReestablish: return 25; + case LDKMessageSendEvent_SendChannelAnnouncement: return 26; + case LDKMessageSendEvent_BroadcastChannelAnnouncement: return 27; + case LDKMessageSendEvent_BroadcastChannelUpdate: return 28; + case LDKMessageSendEvent_BroadcastNodeAnnouncement: return 29; + case LDKMessageSendEvent_SendChannelUpdate: return 30; + case LDKMessageSendEvent_HandleError: return 31; + case LDKMessageSendEvent_SendChannelRangeQuery: return 32; + case LDKMessageSendEvent_SendShortIdsQuery: return 33; + case LDKMessageSendEvent_SendReplyChannelRange: return 34; + case LDKMessageSendEvent_SendGossipTimestampFilter: return 35; default: abort(); } } @@ -4338,6 +4956,70 @@ int64_t CS_LDK_LDKMessageSendEvent_SendFundingSigned_get_msg(int64_t ptr) { msg_ref = tag_ptr(msg_var.inner, false); return msg_ref; } +int8_tArray CS_LDK_LDKMessageSendEvent_SendStfu_get_node_id(int64_t ptr) { + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendEvent_SendStfu); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(node_id_arr->elems, obj->send_stfu.node_id.compressed_form, 33); + return node_id_arr; +} +int64_t CS_LDK_LDKMessageSendEvent_SendStfu_get_msg(int64_t ptr) { + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendEvent_SendStfu); + LDKStfu msg_var = obj->send_stfu.msg; + int64_t msg_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); + msg_ref = tag_ptr(msg_var.inner, false); + return msg_ref; +} +int8_tArray CS_LDK_LDKMessageSendEvent_SendSplice_get_node_id(int64_t ptr) { + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendEvent_SendSplice); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(node_id_arr->elems, obj->send_splice.node_id.compressed_form, 33); + return node_id_arr; +} +int64_t CS_LDK_LDKMessageSendEvent_SendSplice_get_msg(int64_t ptr) { + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendEvent_SendSplice); + LDKSplice msg_var = obj->send_splice.msg; + int64_t msg_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); + msg_ref = tag_ptr(msg_var.inner, false); + return msg_ref; +} +int8_tArray CS_LDK_LDKMessageSendEvent_SendSpliceAck_get_node_id(int64_t ptr) { + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendEvent_SendSpliceAck); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(node_id_arr->elems, obj->send_splice_ack.node_id.compressed_form, 33); + return node_id_arr; +} +int64_t CS_LDK_LDKMessageSendEvent_SendSpliceAck_get_msg(int64_t ptr) { + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendEvent_SendSpliceAck); + LDKSpliceAck msg_var = obj->send_splice_ack.msg; + int64_t msg_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); + msg_ref = tag_ptr(msg_var.inner, false); + return msg_ref; +} +int8_tArray CS_LDK_LDKMessageSendEvent_SendSpliceLocked_get_node_id(int64_t ptr) { + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendEvent_SendSpliceLocked); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(node_id_arr->elems, obj->send_splice_locked.node_id.compressed_form, 33); + return node_id_arr; +} +int64_t CS_LDK_LDKMessageSendEvent_SendSpliceLocked_get_msg(int64_t ptr) { + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMessageSendEvent_SendSpliceLocked); + LDKSpliceLocked msg_var = obj->send_splice_locked.msg; + int64_t msg_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); + msg_ref = tag_ptr(msg_var.inner, false); + return msg_ref; +} int8_tArray CS_LDK_LDKMessageSendEvent_SendTxAddInput_get_node_id(int64_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKMessageSendEvent_SendTxAddInput); @@ -5050,6 +5732,54 @@ int64_tArray CS_LDK_LDKCOption_CVec_SocketAddressZZ_Some_get_some(int64_t ptr) { return some_arr; } +static inline uint64_t CResult_u64ShortChannelIdErrorZ_get_ok(LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +int64_t CS_LDK_CResult_u64ShortChannelIdErrorZ_get_ok(int64_t owner) { + LDKCResult_u64ShortChannelIdErrorZ* owner_conv = (LDKCResult_u64ShortChannelIdErrorZ*)untag_ptr(owner); + int64_t ret_conv = CResult_u64ShortChannelIdErrorZ_get_ok(owner_conv); + return ret_conv; +} + +static inline enum LDKShortChannelIdError CResult_u64ShortChannelIdErrorZ_get_err(LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return ShortChannelIdError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_u64ShortChannelIdErrorZ_get_err(int64_t owner) { + LDKCResult_u64ShortChannelIdErrorZ* owner_conv = (LDKCResult_u64ShortChannelIdErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKShortChannelIdError_to_cs(CResult_u64ShortChannelIdErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKPendingHTLCInfo CResult_PendingHTLCInfoInboundHTLCErrZ_get_ok(LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR owner){ + LDKPendingHTLCInfo ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_get_ok(int64_t owner) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* owner_conv = (LDKCResult_PendingHTLCInfoInboundHTLCErrZ*)untag_ptr(owner); + LDKPendingHTLCInfo ret_var = CResult_PendingHTLCInfoInboundHTLCErrZ_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 LDKInboundHTLCErr CResult_PendingHTLCInfoInboundHTLCErrZ_get_err(LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR owner){ + LDKInboundHTLCErr ret = *owner->contents.err; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_get_err(int64_t owner) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* owner_conv = (LDKCResult_PendingHTLCInfoInboundHTLCErrZ*)untag_ptr(owner); + LDKInboundHTLCErr ret_var = CResult_PendingHTLCInfoInboundHTLCErrZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline LDKCVec_HTLCOutputInCommitmentZ CVec_HTLCOutputInCommitmentZ_clone(const LDKCVec_HTLCOutputInCommitmentZ *orig) { LDKCVec_HTLCOutputInCommitmentZ ret = { .data = MALLOC(sizeof(LDKHTLCOutputInCommitment) * orig->datalen, "LDKCVec_HTLCOutputInCommitmentZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5146,6 +5876,56 @@ void CS_LDK_CResult_CVec_UtxoZNoneZ_get_err(int64_t owner) { CResult_CVec_UtxoZNoneZ_get_err(owner_conv); } +uint32_t CS_LDK_LDKPaymentContext_ty_from_ptr(int64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + switch(obj->tag) { + case LDKPaymentContext_Unknown: return 0; + case LDKPaymentContext_Bolt12Offer: return 1; + case LDKPaymentContext_Bolt12Refund: return 2; + default: abort(); + } +} +int64_t CS_LDK_LDKPaymentContext_Unknown_get_unknown(int64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentContext_Unknown); + LDKUnknownPaymentContext unknown_var = obj->unknown; + int64_t unknown_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(unknown_var); + unknown_ref = tag_ptr(unknown_var.inner, false); + return unknown_ref; +} +int64_t CS_LDK_LDKPaymentContext_Bolt12Offer_get_bolt12_offer(int64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentContext_Bolt12Offer); + LDKBolt12OfferContext bolt12_offer_var = obj->bolt12_offer; + int64_t bolt12_offer_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(bolt12_offer_var); + bolt12_offer_ref = tag_ptr(bolt12_offer_var.inner, false); + return bolt12_offer_ref; +} +int64_t CS_LDK_LDKPaymentContext_Bolt12Refund_get_bolt12_refund(int64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentContext_Bolt12Refund); + LDKBolt12RefundContext bolt12_refund_var = obj->bolt12_refund; + int64_t bolt12_refund_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(bolt12_refund_var); + bolt12_refund_ref = tag_ptr(bolt12_refund_var.inner, false); + return bolt12_refund_ref; +} +uint32_t CS_LDK_LDKCOption_PaymentContextZ_ty_from_ptr(int64_t ptr) { + LDKCOption_PaymentContextZ *obj = (LDKCOption_PaymentContextZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_PaymentContextZ_Some: return 0; + case LDKCOption_PaymentContextZ_None: return 1; + default: abort(); + } +} +int64_t CS_LDK_LDKCOption_PaymentContextZ_Some_get_some(int64_t ptr) { + LDKCOption_PaymentContextZ *obj = (LDKCOption_PaymentContextZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_PaymentContextZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} static inline uint64_t C2Tuple_u64u16Z_get_a(LDKC2Tuple_u64u16Z *NONNULL_PTR owner){ return owner->a; } @@ -5180,39 +5960,28 @@ 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 LDKThirtyTwoBytes CResult_ThirtyTwoBytesAPIErrorZ_get_ok(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return ThirtyTwoBytes_clone(&*owner->contents.result); +static inline struct LDKChannelId CResult_ChannelIdAPIErrorZ_get_ok(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner){ + LDKChannelId ret = *owner->contents.result; + ret.is_owned = false; + return ret; } -int8_tArray CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_ok(int64_t owner) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, CResult_ThirtyTwoBytesAPIErrorZ_get_ok(owner_conv).data, 32); - return ret_arr; +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelIdAPIErrorZ* owner_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(owner); + LDKChannelId ret_var = CResult_ChannelIdAPIErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline struct LDKAPIError CResult_ThirtyTwoBytesAPIErrorZ_get_err(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner){ +static inline struct LDKAPIError CResult_ChannelIdAPIErrorZ_get_err(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return APIError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_err(int64_t owner) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_get_err(int64_t owner) { + LDKCResult_ChannelIdAPIErrorZ* owner_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(owner); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = CResult_ThirtyTwoBytesAPIErrorZ_get_err(owner_conv); + *ret_copy = CResult_ChannelIdAPIErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5547,33 +6316,68 @@ int64_t CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFail return ret_ref; } -static inline struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR owner){ - return ThirtyTwoBytes_clone(&owner->a); +static inline struct LDKChannelId C2Tuple_ChannelIdPublicKeyZ_get_a(LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR owner){ + LDKChannelId ret = owner->a; + ret.is_owned = false; + return ret; } -int8_tArray CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(int64_t owner) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* owner_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(owner_conv).data, 32); - return ret_arr; +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_get_a(int64_t owner) { + LDKC2Tuple_ChannelIdPublicKeyZ* owner_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(owner); + LDKChannelId ret_var = C2Tuple_ChannelIdPublicKeyZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline struct LDKPublicKey C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR owner){ +static inline struct LDKPublicKey C2Tuple_ChannelIdPublicKeyZ_get_b(LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR owner){ return owner->b; } -int8_tArray CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(int64_t owner) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* owner_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(owner); +int8_tArray CS_LDK_C2Tuple_ChannelIdPublicKeyZ_get_b(int64_t owner) { + LDKC2Tuple_ChannelIdPublicKeyZ* owner_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(owner); int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(owner_conv).compressed_form, 33); + memcpy(ret_arr->elems, C2Tuple_ChannelIdPublicKeyZ_get_b(owner_conv).compressed_form, 33); return ret_arr; } -static inline LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_clone(const LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ *orig) { - LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ) * orig->datalen, "LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C2Tuple_ChannelIdPublicKeyZZ CVec_C2Tuple_ChannelIdPublicKeyZZ_clone(const LDKCVec_C2Tuple_ChannelIdPublicKeyZZ *orig) { + LDKCVec_C2Tuple_ChannelIdPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_ChannelIdPublicKeyZ) * orig->datalen, "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_ChannelIdPublicKeyZ_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_ChannelIdZ CVec_ChannelIdZ_clone(const LDKCVec_ChannelIdZ *orig) { + LDKCVec_ChannelIdZ ret = { .data = MALLOC(sizeof(LDKChannelId) * orig->datalen, "LDKCVec_ChannelIdZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(&orig->data[i]); + ret.data[i] = ChannelId_clone(&orig->data[i]); } return ret; } +static inline struct LDKOfferWithDerivedMetadataBuilder CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKOfferWithDerivedMetadataBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKOfferWithDerivedMetadataBuilder ret_var = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKBolt12SemanticError CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKCOption_StrZ_ty_from_ptr(int64_t ptr) { LDKCOption_StrZ *obj = (LDKCOption_StrZ*)untag_ptr(ptr); switch(obj->tag) { @@ -5589,25 +6393,6 @@ jstring CS_LDK_LDKCOption_StrZ_Some_get_some(int64_t ptr) { jstring some_conv = str_ref_to_cs(some_str.chars, some_str.len); return some_conv; } -static inline void CResult_NoneBolt12SemanticErrorZ_get_ok(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -void CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_ok(int64_t owner) { - LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); - CResult_NoneBolt12SemanticErrorZ_get_ok(owner_conv); -} - -static inline enum LDKBolt12SemanticError CResult_NoneBolt12SemanticErrorZ_get_err(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt12SemanticError_clone(&*owner->contents.err); -} -int32_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_err(int64_t owner) { - LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_NoneBolt12SemanticErrorZ_get_err(owner_conv)); - return ret_conv; -} - static inline struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(&*owner->contents.result); @@ -5628,6 +6413,29 @@ void CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_err(int64_t CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_err(owner_conv); } +static inline struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesAPIErrorZ_get_ok(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ThirtyTwoBytes_clone(&*owner->contents.result); +} +int8_tArray CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_ok(int64_t owner) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, CResult_ThirtyTwoBytesAPIErrorZ_get_ok(owner_conv).data, 32); + return ret_arr; +} + +static inline struct LDKAPIError CResult_ThirtyTwoBytesAPIErrorZ_get_err(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return APIError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_err(int64_t owner) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(owner); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = CResult_ThirtyTwoBytesAPIErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint32_t CS_LDK_LDKOffersMessage_ty_from_ptr(int64_t ptr) { LDKOffersMessage *obj = (LDKOffersMessage*)untag_ptr(ptr); switch(obj->tag) { @@ -5745,128 +6553,265 @@ 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; +static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){ + LDKPhantomRouteHints 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 CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner); + LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_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){ +static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *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); +int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_PhantomRouteHintsDecodeErrorZ_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; +static inline struct LDKBlindedForward CResult_BlindedForwardDecodeErrorZ_get_ok(LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedForward 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 CS_LDK_CResult_BlindedForwardDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BlindedForwardDecodeErrorZ* owner_conv = (LDKCResult_BlindedForwardDecodeErrorZ*)untag_ptr(owner); + LDKBlindedForward ret_var = CResult_BlindedForwardDecodeErrorZ_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){ +static inline struct LDKDecodeError CResult_BlindedForwardDecodeErrorZ_get_err(LDKCResult_BlindedForwardDecodeErrorZ *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); +int64_t CS_LDK_CResult_BlindedForwardDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_BlindedForwardDecodeErrorZ* owner_conv = (LDKCResult_BlindedForwardDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_BlindedForwardDecodeErrorZ_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; +uint32_t CS_LDK_LDKPendingHTLCRouting_ty_from_ptr(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + switch(obj->tag) { + case LDKPendingHTLCRouting_Forward: return 0; + case LDKPendingHTLCRouting_Receive: return 1; + case LDKPendingHTLCRouting_ReceiveKeysend: return 2; + default: abort(); + } } -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); +int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_onion_packet(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Forward); + LDKOnionPacket onion_packet_var = obj->forward.onion_packet; + int64_t onion_packet_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_packet_var); + onion_packet_ref = tag_ptr(onion_packet_var.inner, false); + return onion_packet_ref; +} +int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_short_channel_id(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Forward); + int64_t short_channel_id_conv = obj->forward.short_channel_id; + return short_channel_id_conv; +} +int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_blinded(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Forward); + LDKBlindedForward blinded_var = obj->forward.blinded; + int64_t blinded_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_var); + blinded_ref = tag_ptr(blinded_var.inner, false); + return blinded_ref; +} +int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_data(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Receive); + LDKFinalOnionHopData payment_data_var = obj->receive.payment_data; + int64_t payment_data_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_var); + payment_data_ref = tag_ptr(payment_data_var.inner, false); + return payment_data_ref; +} +int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_metadata(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Receive); + int64_t payment_metadata_ref = tag_ptr(&obj->receive.payment_metadata, false); + return payment_metadata_ref; +} +int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_context(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Receive); + int64_t payment_context_ref = tag_ptr(&obj->receive.payment_context, false); + return payment_context_ref; +} +int32_t CS_LDK_LDKPendingHTLCRouting_Receive_get_incoming_cltv_expiry(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Receive); + int32_t incoming_cltv_expiry_conv = obj->receive.incoming_cltv_expiry; + return incoming_cltv_expiry_conv; +} +int8_tArray CS_LDK_LDKPendingHTLCRouting_Receive_get_phantom_shared_secret(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Receive); + int8_tArray phantom_shared_secret_arr = init_int8_tArray(32, __LINE__); + memcpy(phantom_shared_secret_arr->elems, obj->receive.phantom_shared_secret.data, 32); + return phantom_shared_secret_arr; +} +int64_tArray CS_LDK_LDKPendingHTLCRouting_Receive_get_custom_tlvs(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Receive); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_var = obj->receive.custom_tlvs; + int64_tArray custom_tlvs_arr = NULL; + custom_tlvs_arr = init_int64_tArray(custom_tlvs_var.datalen, __LINE__); + int64_t *custom_tlvs_arr_ptr = (int64_t*)(((uint8_t*)custom_tlvs_arr) + 8); + for (size_t x = 0; x < custom_tlvs_var.datalen; x++) { + LDKC2Tuple_u64CVec_u8ZZ* custom_tlvs_conv_23_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *custom_tlvs_conv_23_conv = custom_tlvs_var.data[x]; + *custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone(custom_tlvs_conv_23_conv); + custom_tlvs_arr_ptr[x] = tag_ptr(custom_tlvs_conv_23_conv, true); + } + + return custom_tlvs_arr; +} +jboolean CS_LDK_LDKPendingHTLCRouting_Receive_get_requires_blinded_error(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Receive); + jboolean requires_blinded_error_conv = obj->receive.requires_blinded_error; + return requires_blinded_error_conv; +} +int64_t CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_payment_data(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_ReceiveKeysend); + LDKFinalOnionHopData payment_data_var = obj->receive_keysend.payment_data; + int64_t payment_data_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_var); + payment_data_ref = tag_ptr(payment_data_var.inner, false); + return payment_data_ref; +} +int8_tArray CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_payment_preimage(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_ReceiveKeysend); + int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_preimage_arr->elems, obj->receive_keysend.payment_preimage.data, 32); + return payment_preimage_arr; +} +int64_t CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_payment_metadata(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_ReceiveKeysend); + int64_t payment_metadata_ref = tag_ptr(&obj->receive_keysend.payment_metadata, false); + return payment_metadata_ref; +} +int32_t CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_incoming_cltv_expiry(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_ReceiveKeysend); + int32_t incoming_cltv_expiry_conv = obj->receive_keysend.incoming_cltv_expiry; + return incoming_cltv_expiry_conv; +} +int64_tArray CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_custom_tlvs(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_ReceiveKeysend); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_var = obj->receive_keysend.custom_tlvs; + int64_tArray custom_tlvs_arr = NULL; + custom_tlvs_arr = init_int64_tArray(custom_tlvs_var.datalen, __LINE__); + int64_t *custom_tlvs_arr_ptr = (int64_t*)(((uint8_t*)custom_tlvs_arr) + 8); + for (size_t x = 0; x < custom_tlvs_var.datalen; x++) { + LDKC2Tuple_u64CVec_u8ZZ* custom_tlvs_conv_23_conv = MALLOC(sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKC2Tuple_u64CVec_u8ZZ"); + *custom_tlvs_conv_23_conv = custom_tlvs_var.data[x]; + *custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone(custom_tlvs_conv_23_conv); + custom_tlvs_arr_ptr[x] = tag_ptr(custom_tlvs_conv_23_conv, true); + } + + return custom_tlvs_arr; +} +jboolean CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_requires_blinded_error(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_ReceiveKeysend); + jboolean requires_blinded_error_conv = obj->receive_keysend.requires_blinded_error; + return requires_blinded_error_conv; +} +static inline struct LDKPendingHTLCRouting CResult_PendingHTLCRoutingDecodeErrorZ_get_ok(LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return PendingHTLCRouting_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_PendingHTLCRoutingDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_PendingHTLCRoutingDecodeErrorZ* owner_conv = (LDKCResult_PendingHTLCRoutingDecodeErrorZ*)untag_ptr(owner); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = CResult_PendingHTLCRoutingDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_PendingHTLCRoutingDecodeErrorZ_get_err(LDKCResult_PendingHTLCRoutingDecodeErrorZ *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); +int64_t CS_LDK_CResult_PendingHTLCRoutingDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_PendingHTLCRoutingDecodeErrorZ* owner_conv = (LDKCResult_PendingHTLCRoutingDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_PendingHTLCRoutingDecodeErrorZ_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; +static inline struct LDKPendingHTLCInfo CResult_PendingHTLCInfoDecodeErrorZ_get_ok(LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR owner){ + LDKPendingHTLCInfo ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner); - LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_PendingHTLCInfoDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_PendingHTLCInfoDecodeErrorZ* owner_conv = (LDKCResult_PendingHTLCInfoDecodeErrorZ*)untag_ptr(owner); + LDKPendingHTLCInfo ret_var = CResult_PendingHTLCInfoDecodeErrorZ_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_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_PendingHTLCInfoDecodeErrorZ_get_err(LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_PendingHTLCInfoDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_PendingHTLCInfoDecodeErrorZ* owner_conv = (LDKCResult_PendingHTLCInfoDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_PendingHTLCInfoDecodeErrorZ_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){ +static inline enum LDKBlindedFailure CResult_BlindedFailureDecodeErrorZ_get_ok(LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return ChannelShutdownState_clone(&*owner->contents.result); + return BlindedFailure_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)); +int32_t CS_LDK_CResult_BlindedFailureDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BlindedFailureDecodeErrorZ* owner_conv = (LDKCResult_BlindedFailureDecodeErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBlindedFailure_to_cs(CResult_BlindedFailureDecodeErrorZ_get_ok(owner_conv)); return ret_conv; } -static inline struct LDKDecodeError CResult_ChannelShutdownStateDecodeErrorZ_get_err(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_BlindedFailureDecodeErrorZ_get_err(LDKCResult_BlindedFailureDecodeErrorZ *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); +int64_t CS_LDK_CResult_BlindedFailureDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_BlindedFailureDecodeErrorZ* owner_conv = (LDKCResult_BlindedFailureDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelShutdownStateDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_BlindedFailureDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5898,7 +6843,7 @@ LDKCResult_ChannelMonitorUpdateStatusNoneZ watch_channel_LDKWatch_jcall(const vo int64_t monitor_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 26, funding_txo_ref, monitor_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 27, funding_txo_ref, monitor_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ChannelMonitorUpdateStatusNoneZ ret_conv = *(LDKCResult_ChannelMonitorUpdateStatusNoneZ*)(ret_ptr); @@ -5916,27 +6861,27 @@ LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg update_var = ChannelMonitorUpdate_clone(&update_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = tag_ptr(update_var.inner, update_var.is_owned); - uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_ll(j_calls->instance_ptr, 27, funding_txo_ref, update_ref); + uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_ll(j_calls->instance_ptr, 28, funding_txo_ref, update_ref); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); return ret_conv; } -LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { +LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 28); - LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr; + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 29); + LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ Elements"); else ret_constr.data = NULL; int64_t* ret_vals = ret->elems; - for (size_t x = 0; x < ret_constr.datalen; x++) { - int64_t ret_conv_49 = ret_vals[x]; - void* ret_conv_49_ptr = untag_ptr(ret_conv_49); - CHECK_ACCESS(ret_conv_49_ptr); - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr); - FREE(untag_ptr(ret_conv_49)); - ret_constr.data[x] = ret_conv_49_conv; + for (size_t f = 0; f < ret_constr.datalen; f++) { + int64_t ret_conv_57 = ret_vals[f]; + void* ret_conv_57_ptr = untag_ptr(ret_conv_57); + CHECK_ACCESS(ret_conv_57_ptr); + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ ret_conv_57_conv = *(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)(ret_conv_57_ptr); + FREE(untag_ptr(ret_conv_57)); + ret_constr.data[f] = ret_conv_57_conv; } FREE(ret); return ret_constr; @@ -6005,14 +6950,14 @@ int64_tArray CS_LDK_Watch_release_pending_monitor_events(int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; - LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); + LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + for (size_t f = 0; f < ret_var.datalen; f++) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* ret_conv_57_conv = MALLOC(sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ"); + *ret_conv_57_conv = ret_var.data[f]; + ret_arr_ptr[f] = tag_ptr(ret_conv_57_conv, true); } FREE(ret_var.data); @@ -6044,7 +6989,7 @@ void broadcast_transactions_LDKBroadcasterInterface_jcall(const void* this_arg, } FREE(txs_var.data); - js_invoke_function_void_l(j_calls->instance_ptr, 29, (int64_t)txs_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 30, (int64_t)txs_arr); } static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) { LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg; @@ -6103,7 +7048,7 @@ static void LDKEntropySource_JCalls_free(void* this_arg) { } LDKThirtyTwoBytes get_secure_random_bytes_LDKEntropySource_jcall(const void* this_arg) { LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 30); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 31); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); @@ -6187,7 +7132,7 @@ static void LDKNodeSigner_JCalls_free(void* this_arg) { } LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const void* this_arg) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 31); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 32); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); @@ -6196,7 +7141,7 @@ LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const voi LDKCResult_PublicKeyNoneZ get_node_id_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient) { LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; int32_t recipient_conv = LDKRecipient_to_cs(recipient); - uint64_t ret = js_invoke_function_l_Recipient(j_calls->instance_ptr, 32, recipient_conv); + uint64_t ret = js_invoke_function_l_Recipient(j_calls->instance_ptr, 33, recipient_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr); @@ -6211,7 +7156,7 @@ LDKCResult_ThirtyTwoBytesNoneZ ecdh_LDKNodeSigner_jcall(const void* this_arg, LD LDKCOption_BigEndianScalarZ *tweak_copy = MALLOC(sizeof(LDKCOption_BigEndianScalarZ), "LDKCOption_BigEndianScalarZ"); *tweak_copy = tweak; int64_t tweak_ref = tag_ptr(tweak_copy, true); - uint64_t ret = js_invoke_function_l_Recipientll(j_calls->instance_ptr, 33, recipient_conv, (int64_t)other_key_arr, tweak_ref); + uint64_t ret = js_invoke_function_l_Recipientll(j_calls->instance_ptr, 34, recipient_conv, (int64_t)other_key_arr, tweak_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ThirtyTwoBytesNoneZ ret_conv = *(LDKCResult_ThirtyTwoBytesNoneZ*)(ret_ptr); @@ -6234,7 +7179,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void FREE(invoice_data_var.data); int32_t recipient_conv = LDKRecipient_to_cs(recipient); - uint64_t ret = js_invoke_function_l_llRecipient(j_calls->instance_ptr, 34, (int64_t)hrp_bytes_arr, (int64_t)invoice_data_arr, recipient_conv); + uint64_t ret = js_invoke_function_l_llRecipient(j_calls->instance_ptr, 35, (int64_t)hrp_bytes_arr, (int64_t)invoice_data_arr, recipient_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr); @@ -6245,10 +7190,10 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_request_LDKNodeSigner_jcall LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; LDKUnsignedInvoiceRequest invoice_request_var = *invoice_request; int64_t invoice_request_ref = 0; - // WARNING: we may need a move here but no clone is available for LDKUnsignedInvoiceRequest + invoice_request_var = UnsignedInvoiceRequest_clone(&invoice_request_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_var); invoice_request_ref = tag_ptr(invoice_request_var.inner, invoice_request_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 35, invoice_request_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 36, invoice_request_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); @@ -6259,10 +7204,10 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_LDKNodeSigner_jcall(const v LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; LDKUnsignedBolt12Invoice invoice_var = *invoice; int64_t invoice_ref = 0; - // WARNING: we may need a move here but no clone is available for LDKUnsignedBolt12Invoice + invoice_var = UnsignedBolt12Invoice_clone(&invoice_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_var); invoice_ref = tag_ptr(invoice_var.inner, invoice_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 36, invoice_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 37, invoice_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); @@ -6274,7 +7219,7 @@ LDKCResult_ECDSASignatureNoneZ sign_gossip_message_LDKNodeSigner_jcall(const voi LDKUnsignedGossipMessage *msg_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage"); *msg_copy = msg; int64_t msg_ref = tag_ptr(msg_copy, true); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 37, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 38, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ECDSASignatureNoneZ ret_conv = *(LDKCResult_ECDSASignatureNoneZ*)(ret_ptr); @@ -6428,7 +7373,7 @@ LDKThirtyTwoBytes generate_channel_keys_id_LDKSignerProvider_jcall(const void* t int64_t channel_value_satoshis_conv = channel_value_satoshis; int8_tArray user_channel_id_arr = init_int8_tArray(16, __LINE__); memcpy(user_channel_id_arr->elems, user_channel_id.le_bytes, 16); - int8_tArray ret = (int8_tArray)js_invoke_function_l_bll(j_calls->instance_ptr, 38, inbound_conv, channel_value_satoshis_conv, (int64_t)user_channel_id_arr); + int8_tArray ret = (int8_tArray)js_invoke_function_l_bll(j_calls->instance_ptr, 39, inbound_conv, channel_value_satoshis_conv, (int64_t)user_channel_id_arr); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); memcpy(ret_ref.data, ret->elems, 32); FREE(ret); @@ -6439,7 +7384,7 @@ LDKWriteableEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(con int64_t channel_value_satoshis_conv = channel_value_satoshis; int8_tArray channel_keys_id_arr = init_int8_tArray(32, __LINE__); memcpy(channel_keys_id_arr->elems, channel_keys_id.data, 32); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 39, channel_value_satoshis_conv, (int64_t)channel_keys_id_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 40, channel_value_satoshis_conv, (int64_t)channel_keys_id_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKWriteableEcdsaChannelSigner ret_conv = *(LDKWriteableEcdsaChannelSigner*)(ret_ptr); @@ -6451,16 +7396,18 @@ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerPro LDKu8slice reader_var = reader; int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__); memcpy(reader_arr->elems, reader_var.data, reader_var.datalen); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 40, (int64_t)reader_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 41, (int64_t)reader_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_CVec_u8ZNoneZ get_destination_script_LDKSignerProvider_jcall(const void* this_arg) { +LDKCResult_CVec_u8ZNoneZ get_destination_script_LDKSignerProvider_jcall(const void* this_arg, LDKThirtyTwoBytes channel_keys_id) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 41); + int8_tArray channel_keys_id_arr = init_int8_tArray(32, __LINE__); + memcpy(channel_keys_id_arr->elems, channel_keys_id.data, 32); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 42, (int64_t)channel_keys_id_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); @@ -6469,7 +7416,7 @@ LDKCResult_CVec_u8ZNoneZ get_destination_script_LDKSignerProvider_jcall(const vo } LDKCResult_ShutdownScriptNoneZ get_shutdown_scriptpubkey_LDKSignerProvider_jcall(const void* this_arg) { LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 42); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 43); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_ShutdownScriptNoneZ ret_conv = *(LDKCResult_ShutdownScriptNoneZ*)(ret_ptr); @@ -6538,12 +7485,15 @@ int64_t CS_LDK_SignerProvider_read_chan_signer(int64_t this_arg, int8_tArray re return tag_ptr(ret_conv, true); } -int64_t CS_LDK_SignerProvider_get_destination_script(int64_t this_arg) { +int64_t CS_LDK_SignerProvider_get_destination_script(int64_t this_arg, int8_tArray channel_keys_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr; + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK(channel_keys_id->arr_len == 32); + memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); - *ret_conv = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg); + *ret_conv = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg, channel_keys_id_ref); return tag_ptr(ret_conv, true); } @@ -6569,7 +7519,7 @@ static void LDKFeeEstimator_JCalls_free(void* this_arg) { uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) { LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; int32_t confirmation_target_conv = LDKConfirmationTarget_to_cs(confirmation_target); - return js_invoke_function_i_ConfirmationTarget(j_calls->instance_ptr, 43, confirmation_target_conv); + return js_invoke_function_i_ConfirmationTarget(j_calls->instance_ptr, 44, confirmation_target_conv); } static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) { LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg; @@ -6601,9 +7551,147 @@ int32_t CS_LDK_FeeEstimator_get_est_sat_per_1000_weight(int64_t this_arg, int32 return ret_conv; } +typedef struct LDKMessageRouter_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKMessageRouter_JCalls; +static void LDKMessageRouter_JCalls_free(void* this_arg) { + LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCResult_OnionMessagePathNoneZ find_path_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey sender, LDKCVec_PublicKeyZ peers, LDKDestination destination) { + LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; + int8_tArray sender_arr = init_int8_tArray(33, __LINE__); + memcpy(sender_arr->elems, sender.compressed_form, 33); + LDKCVec_PublicKeyZ peers_var = peers; + ptrArray peers_arr = NULL; + peers_arr = init_ptrArray(peers_var.datalen, __LINE__); + int8_tArray *peers_arr_ptr = (int8_tArray*)(((uint8_t*)peers_arr) + 8); + for (size_t i = 0; i < peers_var.datalen; i++) { + int8_tArray peers_conv_8_arr = init_int8_tArray(33, __LINE__); + memcpy(peers_conv_8_arr->elems, peers_var.data[i].compressed_form, 33); + peers_arr_ptr[i] = peers_conv_8_arr; + } + + FREE(peers_var.data); + LDKDestination *destination_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *destination_copy = destination; + int64_t destination_ref = tag_ptr(destination_copy, true); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 45, (int64_t)sender_arr, (int64_t)peers_arr, destination_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_OnionMessagePathNoneZ ret_conv = *(LDKCResult_OnionMessagePathNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +LDKCResult_CVec_BlindedPathZNoneZ create_blinded_paths_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_PublicKeyZ peers) { + LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; + int8_tArray recipient_arr = init_int8_tArray(33, __LINE__); + memcpy(recipient_arr->elems, recipient.compressed_form, 33); + LDKCVec_PublicKeyZ peers_var = peers; + ptrArray peers_arr = NULL; + peers_arr = init_ptrArray(peers_var.datalen, __LINE__); + int8_tArray *peers_arr_ptr = (int8_tArray*)(((uint8_t*)peers_arr) + 8); + for (size_t i = 0; i < peers_var.datalen; i++) { + int8_tArray peers_conv_8_arr = init_int8_tArray(33, __LINE__); + memcpy(peers_conv_8_arr->elems, peers_var.data[i].compressed_form, 33); + peers_arr_ptr[i] = peers_conv_8_arr; + } + + FREE(peers_var.data); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 46, (int64_t)recipient_arr, (int64_t)peers_arr); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_CVec_BlindedPathZNoneZ ret_conv = *(LDKCResult_CVec_BlindedPathZNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +static void LDKMessageRouter_JCalls_cloned(LDKMessageRouter* new_obj) { + LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKMessageRouter LDKMessageRouter_init (int64_t o) { + LDKMessageRouter_JCalls *calls = MALLOC(sizeof(LDKMessageRouter_JCalls), "LDKMessageRouter_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKMessageRouter ret = { + .this_arg = (void*) calls, + .find_path = find_path_LDKMessageRouter_jcall, + .create_blinded_paths = create_blinded_paths_LDKMessageRouter_jcall, + .free = LDKMessageRouter_JCalls_free, + }; + return ret; +} +uint64_t CS_LDK_LDKMessageRouter_new(int32_t o) { + LDKMessageRouter *res_ptr = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); + *res_ptr = LDKMessageRouter_init(o); + return tag_ptr(res_ptr, true); +} +int64_t CS_LDK_MessageRouter_find_path(int64_t this_arg, int8_tArray sender, ptrArray peers, int64_t destination) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; + LDKPublicKey sender_ref; + CHECK(sender->arr_len == 33); + memcpy(sender_ref.compressed_form, sender->elems, 33); FREE(sender); + LDKCVec_PublicKeyZ peers_constr; + peers_constr.datalen = peers->arr_len; + if (peers_constr.datalen > 0) + peers_constr.data = MALLOC(peers_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + peers_constr.data = NULL; + int8_tArray* peers_vals = (void*) peers->elems; + for (size_t i = 0; i < peers_constr.datalen; i++) { + int8_tArray peers_conv_8 = peers_vals[i]; + LDKPublicKey peers_conv_8_ref; + CHECK(peers_conv_8->arr_len == 33); + memcpy(peers_conv_8_ref.compressed_form, peers_conv_8->elems, 33); FREE(peers_conv_8); + peers_constr.data[i] = peers_conv_8_ref; + } + FREE(peers); + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = (this_arg_conv->find_path)(this_arg_conv->this_arg, sender_ref, peers_constr, destination_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_MessageRouter_create_blinded_paths(int64_t this_arg, int8_tArray recipient, ptrArray peers) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; + LDKPublicKey recipient_ref; + CHECK(recipient->arr_len == 33); + memcpy(recipient_ref.compressed_form, recipient->elems, 33); FREE(recipient); + LDKCVec_PublicKeyZ peers_constr; + peers_constr.datalen = peers->arr_len; + if (peers_constr.datalen > 0) + peers_constr.data = MALLOC(peers_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + peers_constr.data = NULL; + int8_tArray* peers_vals = (void*) peers->elems; + for (size_t i = 0; i < peers_constr.datalen; i++) { + int8_tArray peers_conv_8 = peers_vals[i]; + LDKPublicKey peers_conv_8_ref; + CHECK(peers_conv_8->arr_len == 33); + memcpy(peers_conv_8_ref.compressed_form, peers_conv_8->elems, 33); FREE(peers_conv_8); + peers_constr.data[i] = peers_conv_8_ref; + } + FREE(peers); + LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); + *ret_conv = (this_arg_conv->create_blinded_paths)(this_arg_conv->this_arg, recipient_ref, peers_constr); + return tag_ptr(ret_conv, true); +} + typedef struct LDKRouter_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; + LDKMessageRouter_JCalls* MessageRouter; } LDKRouter_JCalls; static void LDKRouter_JCalls_free(void* this_arg) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; @@ -6639,7 +7727,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, int64_t inflight_htlcs_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); - uint64_t ret = js_invoke_function_l_llll(j_calls->instance_ptr, 44, (int64_t)payer_arr, route_params_ref, (int64_t)first_hops_arr, inflight_htlcs_ref); + uint64_t ret = js_invoke_function_l_llll(j_calls->instance_ptr, 47, (int64_t)payer_arr, route_params_ref, (int64_t)first_hops_arr, inflight_htlcs_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr); @@ -6678,18 +7766,48 @@ LDKCResult_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* t memcpy(_payment_hash_arr->elems, _payment_hash.data, 32); int8_tArray _payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(_payment_id_arr->elems, _payment_id.data, 32); - uint64_t ret = js_invoke_function_l_llllll(j_calls->instance_ptr, 45, (int64_t)payer_arr, route_params_ref, (int64_t)first_hops_arr, inflight_htlcs_ref, (int64_t)_payment_hash_arr, (int64_t)_payment_id_arr); + uint64_t ret = js_invoke_function_l_llllll(j_calls->instance_ptr, 48, (int64_t)payer_arr, route_params_ref, (int64_t)first_hops_arr, inflight_htlcs_ref, (int64_t)_payment_hash_arr, (int64_t)_payment_id_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } +LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_paths_LDKRouter_jcall(const void* this_arg, LDKPublicKey recipient, LDKCVec_ChannelDetailsZ first_hops, LDKReceiveTlvs tlvs, uint64_t amount_msats) { + LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; + int8_tArray recipient_arr = init_int8_tArray(33, __LINE__); + memcpy(recipient_arr->elems, recipient.compressed_form, 33); + LDKCVec_ChannelDetailsZ first_hops_var = first_hops; + int64_tArray first_hops_arr = NULL; + first_hops_arr = init_int64_tArray(first_hops_var.datalen, __LINE__); + int64_t *first_hops_arr_ptr = (int64_t*)(((uint8_t*)first_hops_arr) + 8); + for (size_t q = 0; q < first_hops_var.datalen; q++) { + LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; + int64_t first_hops_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); + first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); + first_hops_arr_ptr[q] = first_hops_conv_16_ref; + } + + FREE(first_hops_var.data); + LDKReceiveTlvs tlvs_var = tlvs; + int64_t tlvs_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_var); + tlvs_ref = tag_ptr(tlvs_var.inner, tlvs_var.is_owned); + int64_t amount_msats_conv = amount_msats; + uint64_t ret = js_invoke_function_l_llll(j_calls->instance_ptr, 49, (int64_t)recipient_arr, (int64_t)first_hops_arr, tlvs_ref, amount_msats_conv); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_conv = *(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + atomic_fetch_add_explicit(&j_calls->MessageRouter->refcnt, 1, memory_order_release); } -static inline LDKRouter LDKRouter_init (int64_t o) { +static inline LDKRouter LDKRouter_init (int64_t o, int64_t MessageRouter) { LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls"); atomic_init(&calls->refcnt, 1); calls->instance_ptr = o; @@ -6698,13 +7816,16 @@ static inline LDKRouter LDKRouter_init (int64_t o) { .this_arg = (void*) calls, .find_route = find_route_LDKRouter_jcall, .find_route_with_id = find_route_with_id_LDKRouter_jcall, + .create_blinded_payment_paths = create_blinded_payment_paths_LDKRouter_jcall, .free = LDKRouter_JCalls_free, + .MessageRouter = LDKMessageRouter_init(MessageRouter), }; + calls->MessageRouter = ret.MessageRouter.this_arg; return ret; } -uint64_t CS_LDK_LDKRouter_new(int32_t o) { +uint64_t CS_LDK_LDKRouter_new(int32_t o, int32_t MessageRouter) { LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter"); - *res_ptr = LDKRouter_init(o); + *res_ptr = LDKRouter_init(o, MessageRouter); return tag_ptr(res_ptr, true); } int64_t CS_LDK_Router_find_route(int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs) { @@ -6801,6 +7922,40 @@ int64_t CS_LDK_Router_find_route_with_id(int64_t this_arg, int8_tArray payer, i return tag_ptr(ret_conv, true); } +int64_t CS_LDK_Router_create_blinded_payment_paths(int64_t this_arg, int8_tArray recipient, int64_tArray first_hops, int64_t tlvs, int64_t amount_msats) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; + LDKPublicKey recipient_ref; + CHECK(recipient->arr_len == 33); + memcpy(recipient_ref.compressed_form, recipient->elems, 33); FREE(recipient); + LDKCVec_ChannelDetailsZ first_hops_constr; + first_hops_constr.datalen = first_hops->arr_len; + if (first_hops_constr.datalen > 0) + first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + first_hops_constr.data = NULL; + int64_t* first_hops_vals = first_hops->elems; + for (size_t q = 0; q < first_hops_constr.datalen; q++) { + int64_t first_hops_conv_16 = first_hops_vals[q]; + LDKChannelDetails first_hops_conv_16_conv; + first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); + first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); + first_hops_conv_16_conv = ChannelDetails_clone(&first_hops_conv_16_conv); + first_hops_constr.data[q] = first_hops_conv_16_conv; + } + FREE(first_hops); + LDKReceiveTlvs tlvs_conv; + tlvs_conv.inner = untag_ptr(tlvs); + tlvs_conv.is_owned = ptr_is_owned(tlvs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(tlvs_conv); + tlvs_conv = ReceiveTlvs_clone(&tlvs_conv); + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); + *ret_conv = (this_arg_conv->create_blinded_payment_paths)(this_arg_conv->this_arg, recipient_ref, first_hops_constr, tlvs_conv, amount_msats); + return tag_ptr(ret_conv, true); +} + static inline struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesChannelManagerZ_get_a(LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -7384,17 +8539,17 @@ static void LDKType_JCalls_free(void* this_arg) { } uint16_t type_id_LDKType_jcall(const void* this_arg) { LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg; - return js_invoke_function_s_(j_calls->instance_ptr, 46); + return js_invoke_function_s_(j_calls->instance_ptr, 50); } LDKStr debug_str_LDKType_jcall(const void* this_arg) { LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg; - jstring ret = (jstring)js_invoke_function_l_(j_calls->instance_ptr, 47); + jstring ret = (jstring)js_invoke_function_l_(j_calls->instance_ptr, 51); LDKStr ret_conv = str_ref_to_owned_c(ret); return ret_conv; } LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) { LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 48); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 52); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -7481,6 +8636,43 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } +static inline struct LDKPublicKey C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner){ + return owner->a; +} +int8_tArray CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(int64_t owner) { + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, C2Tuple_PublicKeyCVec_SocketAddressZZ_get_a(owner_conv).compressed_form, 33); + return ret_arr; +} + +static inline struct LDKCVec_SocketAddressZ C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR owner){ + return CVec_SocketAddressZ_clone(&owner->b); +} +int64_tArray CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(int64_t owner) { + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(owner); + LDKCVec_SocketAddressZ ret_var = C2Tuple_PublicKeyCVec_SocketAddressZZ_get_b(owner_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKSocketAddress *ret_conv_15_copy = MALLOC(sizeof(LDKSocketAddress), "LDKSocketAddress"); + *ret_conv_15_copy = ret_var.data[p]; + int64_t ret_conv_15_ref = tag_ptr(ret_conv_15_copy, true); + ret_arr_ptr[p] = ret_conv_15_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_clone(const LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ *orig) { + LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(&orig->data[i]); + } + return ret; +} typedef struct LDKOnionMessageContents_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -7493,17 +8685,23 @@ static void LDKOnionMessageContents_JCalls_free(void* this_arg) { } uint64_t tlv_type_LDKOnionMessageContents_jcall(const void* this_arg) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; - return js_invoke_function_l_(j_calls->instance_ptr, 49); + return js_invoke_function_l_(j_calls->instance_ptr, 53); } LDKCVec_u8Z write_LDKOnionMessageContents_jcall(const void* this_arg) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 50); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 54); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); return ret_ref; } +LDKStr debug_str_LDKOnionMessageContents_jcall(const void* this_arg) { + LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) this_arg; + jstring ret = (jstring)js_invoke_function_l_(j_calls->instance_ptr, 55); + LDKStr ret_conv = str_ref_to_owned_c(ret); + return ret_conv; +} static void LDKOnionMessageContents_JCalls_cloned(LDKOnionMessageContents* new_obj) { LDKOnionMessageContents_JCalls *j_calls = (LDKOnionMessageContents_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); @@ -7517,6 +8715,7 @@ static inline LDKOnionMessageContents LDKOnionMessageContents_init (int64_t o) { .this_arg = (void*) calls, .tlv_type = tlv_type_LDKOnionMessageContents_jcall, .write = write_LDKOnionMessageContents_jcall, + .debug_str = debug_str_LDKOnionMessageContents_jcall, .cloned = LDKOnionMessageContents_JCalls_cloned, .free = LDKOnionMessageContents_JCalls_free, }; @@ -7546,6 +8745,16 @@ int8_tArray CS_LDK_OnionMessageContents_write(int64_t this_arg) { return ret_arr; } +jstring CS_LDK_OnionMessageContents_debug_str(int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKOnionMessageContents* this_arg_conv = (LDKOnionMessageContents*)this_arg_ptr; + LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + uint32_t CS_LDK_LDKCOption_OnionMessageContentsZ_ty_from_ptr(int64_t ptr) { LDKCOption_OnionMessageContentsZ *obj = (LDKCOption_OnionMessageContentsZ*)untag_ptr(ptr); switch(obj->tag) { @@ -7680,34 +8889,6 @@ int64_t CS_LDK_LDKCOption_SocketAddressZ_Some_get_some(int64_t ptr) { int64_t some_ref = tag_ptr(&obj->some, false); return some_ref; } -static inline struct LDKPublicKey C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR owner){ - return owner->a; -} -int8_tArray CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(int64_t owner) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(owner_conv).compressed_form, 33); - return ret_arr; -} - -static inline struct LDKCOption_SocketAddressZ C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR owner){ - return COption_SocketAddressZ_clone(&owner->b); -} -int64_t CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(int64_t owner) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)untag_ptr(owner); - LDKCOption_SocketAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_SocketAddressZ), "LDKCOption_SocketAddressZ"); - *ret_copy = C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_clone(const LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ *orig) { - LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return CVec_u8Z_clone(&*owner->contents.result); @@ -7937,6 +9118,54 @@ int32_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_err(in return ret_conv; } +static inline struct LDKUnsignedInvoiceRequest CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKUnsignedInvoiceRequest ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + LDKUnsignedInvoiceRequest ret_var = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKBolt12SemanticError CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKInvoiceRequest CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequest ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequest ret_var = CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKBolt12SemanticError CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKCOption_SecretKeyZ_ty_from_ptr(int64_t ptr) { LDKCOption_SecretKeyZ *obj = (LDKCOption_SecretKeyZ*)untag_ptr(ptr); switch(obj->tag) { @@ -7952,6 +9181,30 @@ int8_tArray CS_LDK_LDKCOption_SecretKeyZ_Some_get_some(int64_t ptr) { memcpy(some_arr->elems, obj->some.bytes, 32); return some_arr; } +static inline struct LDKInvoiceWithExplicitSigningPubkeyBuilder CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceWithExplicitSigningPubkeyBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceWithExplicitSigningPubkeyBuilder ret_var = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKBolt12SemanticError CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + static inline struct LDKVerifiedInvoiceRequest CResult_VerifiedInvoiceRequestNoneZ_get_ok(LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR owner){ LDKVerifiedInvoiceRequest ret = *owner->contents.result; ret.is_owned = false; @@ -7975,6 +9228,56 @@ void CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_get_err(int64_t owner) { CResult_VerifiedInvoiceRequestNoneZ_get_err(owner_conv); } +static inline struct LDKInvoiceWithDerivedSigningPubkeyBuilder CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceWithDerivedSigningPubkeyBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceWithDerivedSigningPubkeyBuilder ret_var = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKBolt12SemanticError CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +int32_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKInvoiceRequestFields CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequestFields ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(owner); + LDKInvoiceRequestFields ret_var = CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline LDKCVec_WitnessZ CVec_WitnessZ_clone(const LDKCVec_WitnessZ *orig) { LDKCVec_WitnessZ ret = { .data = MALLOC(sizeof(LDKWitness) * orig->datalen, "LDKCVec_WitnessZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -7982,6 +9285,21 @@ static inline LDKCVec_WitnessZ CVec_WitnessZ_clone(const LDKCVec_WitnessZ *orig) } return ret; } +uint32_t CS_LDK_LDKCOption_ECDSASignatureZ_ty_from_ptr(int64_t ptr) { + LDKCOption_ECDSASignatureZ *obj = (LDKCOption_ECDSASignatureZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_ECDSASignatureZ_Some: return 0; + case LDKCOption_ECDSASignatureZ_None: return 1; + default: abort(); + } +} +int8_tArray CS_LDK_LDKCOption_ECDSASignatureZ_Some_get_some(int64_t ptr) { + LDKCOption_ECDSASignatureZ *obj = (LDKCOption_ECDSASignatureZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_ECDSASignatureZ_Some); + int8_tArray some_arr = init_int8_tArray(64, __LINE__); + memcpy(some_arr->elems, obj->some.compact_form, 64); + return some_arr; +} uint32_t CS_LDK_LDKCOption_i64Z_ty_from_ptr(int64_t ptr) { LDKCOption_i64Z *obj = (LDKCOption_i64Z*)untag_ptr(ptr); switch(obj->tag) { @@ -8122,6 +9440,110 @@ int64_t CS_LDK_CResult_AcceptChannelV2DecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKStfu CResult_StfuDecodeErrorZ_get_ok(LDKCResult_StfuDecodeErrorZ *NONNULL_PTR owner){ + LDKStfu ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_StfuDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_StfuDecodeErrorZ* owner_conv = (LDKCResult_StfuDecodeErrorZ*)untag_ptr(owner); + LDKStfu ret_var = CResult_StfuDecodeErrorZ_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_StfuDecodeErrorZ_get_err(LDKCResult_StfuDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_StfuDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_StfuDecodeErrorZ* owner_conv = (LDKCResult_StfuDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_StfuDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKSplice CResult_SpliceDecodeErrorZ_get_ok(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner){ + LDKSplice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_SpliceDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_SpliceDecodeErrorZ* owner_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(owner); + LDKSplice ret_var = CResult_SpliceDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_SpliceDecodeErrorZ_get_err(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_SpliceDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_SpliceDecodeErrorZ* owner_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_SpliceDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKSpliceAck CResult_SpliceAckDecodeErrorZ_get_ok(LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR owner){ + LDKSpliceAck ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_SpliceAckDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_SpliceAckDecodeErrorZ* owner_conv = (LDKCResult_SpliceAckDecodeErrorZ*)untag_ptr(owner); + LDKSpliceAck ret_var = CResult_SpliceAckDecodeErrorZ_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_SpliceAckDecodeErrorZ_get_err(LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_SpliceAckDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_SpliceAckDecodeErrorZ* owner_conv = (LDKCResult_SpliceAckDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_SpliceAckDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKSpliceLocked CResult_SpliceLockedDecodeErrorZ_get_ok(LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR owner){ + LDKSpliceLocked ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_SpliceLockedDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_SpliceLockedDecodeErrorZ* owner_conv = (LDKCResult_SpliceLockedDecodeErrorZ*)untag_ptr(owner); + LDKSpliceLocked ret_var = CResult_SpliceLockedDecodeErrorZ_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_SpliceLockedDecodeErrorZ_get_err(LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_SpliceLockedDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_SpliceLockedDecodeErrorZ* owner_conv = (LDKCResult_SpliceLockedDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_SpliceLockedDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKTxAddInput CResult_TxAddInputDecodeErrorZ_get_ok(LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR owner){ LDKTxAddInput ret = *owner->contents.result; ret.is_owned = false; @@ -8798,6 +10220,32 @@ int64_t CS_LDK_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKOnionPacket CResult_OnionPacketDecodeErrorZ_get_ok(LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR owner){ + LDKOnionPacket ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_OnionPacketDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OnionPacketDecodeErrorZ* owner_conv = (LDKCResult_OnionPacketDecodeErrorZ*)untag_ptr(owner); + LDKOnionPacket ret_var = CResult_OnionPacketDecodeErrorZ_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_OnionPacketDecodeErrorZ_get_err(LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_OnionPacketDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_OnionPacketDecodeErrorZ* owner_conv = (LDKCResult_OnionPacketDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OnionPacketDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){ LDKUpdateAddHTLC ret = *owner->contents.result; ret.is_owned = false; @@ -8850,6 +10298,32 @@ int64_t CS_LDK_CResult_OnionMessageDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKFinalOnionHopData CResult_FinalOnionHopDataDecodeErrorZ_get_ok(LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR owner){ + LDKFinalOnionHopData ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_FinalOnionHopDataDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_FinalOnionHopDataDecodeErrorZ* owner_conv = (LDKCResult_FinalOnionHopDataDecodeErrorZ*)untag_ptr(owner); + LDKFinalOnionHopData ret_var = CResult_FinalOnionHopDataDecodeErrorZ_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_FinalOnionHopDataDecodeErrorZ_get_err(LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_FinalOnionHopDataDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_FinalOnionHopDataDecodeErrorZ* owner_conv = (LDKCResult_FinalOnionHopDataDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_FinalOnionHopDataDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){ LDKPing ret = *owner->contents.result; ret.is_owned = false; @@ -9287,13 +10761,262 @@ int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(int64_t owner) return ret_ref; } -static inline LDKCVec_FutureZ CVec_FutureZ_clone(const LDKCVec_FutureZ *orig) { - LDKCVec_FutureZ ret = { .data = MALLOC(sizeof(LDKFuture) * orig->datalen, "LDKCVec_FutureZ clone bytes"), .datalen = orig->datalen }; +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] = Future_clone(&orig->data[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); @@ -9711,24 +11434,70 @@ int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(int64_t own uint32_t CS_LDK_LDKPaymentPurpose_ty_from_ptr(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); switch(obj->tag) { - case LDKPaymentPurpose_InvoicePayment: return 0; - case LDKPaymentPurpose_SpontaneousPayment: return 1; + case LDKPaymentPurpose_Bolt11InvoicePayment: return 0; + case LDKPaymentPurpose_Bolt12OfferPayment: return 1; + case LDKPaymentPurpose_Bolt12RefundPayment: return 2; + case LDKPaymentPurpose_SpontaneousPayment: return 3; default: abort(); } } -int64_t CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(int64_t ptr) { +int64_t CS_LDK_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_preimage(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - CHECK(obj->tag == LDKPaymentPurpose_InvoicePayment); - int64_t payment_preimage_ref = tag_ptr(&obj->invoice_payment.payment_preimage, false); + CHECK(obj->tag == LDKPaymentPurpose_Bolt11InvoicePayment); + int64_t payment_preimage_ref = tag_ptr(&obj->bolt11_invoice_payment.payment_preimage, false); return payment_preimage_ref; } -int8_tArray CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_secret(int64_t ptr) { +int8_tArray CS_LDK_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_secret(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - CHECK(obj->tag == LDKPaymentPurpose_InvoicePayment); + CHECK(obj->tag == LDKPaymentPurpose_Bolt11InvoicePayment); int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); - memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32); + memcpy(payment_secret_arr->elems, obj->bolt11_invoice_payment.payment_secret.data, 32); return payment_secret_arr; } +int64_t CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_preimage(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12OfferPayment); + int64_t payment_preimage_ref = tag_ptr(&obj->bolt12_offer_payment.payment_preimage, false); + return payment_preimage_ref; +} +int8_tArray CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_secret(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12OfferPayment); + int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_secret_arr->elems, obj->bolt12_offer_payment.payment_secret.data, 32); + return payment_secret_arr; +} +int64_t CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_context(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12OfferPayment); + LDKBolt12OfferContext payment_context_var = obj->bolt12_offer_payment.payment_context; + int64_t payment_context_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_var); + payment_context_ref = tag_ptr(payment_context_var.inner, false); + return payment_context_ref; +} +int64_t CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_preimage(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); + int64_t payment_preimage_ref = tag_ptr(&obj->bolt12_refund_payment.payment_preimage, false); + return payment_preimage_ref; +} +int8_tArray CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_secret(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); + int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_secret_arr->elems, obj->bolt12_refund_payment.payment_secret.data, 32); + return payment_secret_arr; +} +int64_t CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_context(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); + LDKBolt12RefundContext payment_context_var = obj->bolt12_refund_payment.payment_context; + int64_t payment_context_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_var); + payment_context_ref = tag_ptr(payment_context_var.inner, false); + return payment_context_ref; +} int8_tArray CS_LDK_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); CHECK(obj->tag == LDKPaymentPurpose_SpontaneousPayment); @@ -9844,38 +11613,6 @@ int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_get_err(int64_t owner) return ret_ref; } -uint32_t CS_LDK_LDKClosureReason_ty_from_ptr(int64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); - switch(obj->tag) { - case LDKClosureReason_CounterpartyForceClosed: return 0; - case LDKClosureReason_HolderForceClosed: return 1; - case LDKClosureReason_CooperativeClosure: return 2; - case LDKClosureReason_CommitmentTxConfirmed: return 3; - case LDKClosureReason_FundingTimedOut: return 4; - case LDKClosureReason_ProcessingError: return 5; - case LDKClosureReason_DisconnectedPeer: return 6; - case LDKClosureReason_OutdatedChannelManager: return 7; - case LDKClosureReason_CounterpartyCoopClosedUnfundedChannel: return 8; - case LDKClosureReason_FundingBatchClosure: return 9; - default: abort(); - } -} -int64_t CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(int64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); - CHECK(obj->tag == LDKClosureReason_CounterpartyForceClosed); - LDKUntrustedString peer_msg_var = obj->counterparty_force_closed.peer_msg; - int64_t peer_msg_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_var); - peer_msg_ref = tag_ptr(peer_msg_var.inner, false); - return peer_msg_ref; -} -jstring CS_LDK_LDKClosureReason_ProcessingError_get_err(int64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); - CHECK(obj->tag == LDKClosureReason_ProcessingError); - LDKStr err_str = obj->processing_error.err; - jstring err_conv = str_ref_to_cs(err_str.chars, err_str.len); - return err_conv; -} uint32_t CS_LDK_LDKCOption_ClosureReasonZ_ty_from_ptr(int64_t ptr) { LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr); switch(obj->tag) { @@ -9920,7 +11657,8 @@ uint32_t CS_LDK_LDKHTLCDestination_ty_from_ptr(int64_t ptr) { case LDKHTLCDestination_NextHopChannel: return 0; case LDKHTLCDestination_UnknownNextHop: return 1; case LDKHTLCDestination_InvalidForward: return 2; - case LDKHTLCDestination_FailedPayment: return 3; + case LDKHTLCDestination_InvalidOnion: return 3; + case LDKHTLCDestination_FailedPayment: return 4; default: abort(); } } @@ -9931,12 +11669,14 @@ int8_tArray CS_LDK_LDKHTLCDestination_NextHopChannel_get_node_id(int64_t ptr) { memcpy(node_id_arr->elems, obj->next_hop_channel.node_id.compressed_form, 33); return node_id_arr; } -int8_tArray CS_LDK_LDKHTLCDestination_NextHopChannel_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKHTLCDestination_NextHopChannel_get_channel_id(int64_t ptr) { LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr); CHECK(obj->tag == LDKHTLCDestination_NextHopChannel); - int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(channel_id_arr->elems, obj->next_hop_channel.channel_id.data, 32); - return channel_id_arr; + LDKChannelId channel_id_var = obj->next_hop_channel.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; } int64_t CS_LDK_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(int64_t ptr) { LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr); @@ -10061,6 +11801,22 @@ uint32_t CS_LDK_LDKBumpTransactionEvent_ty_from_ptr(int64_t ptr) { default: abort(); } } +int64_t CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_channel_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKBumpTransactionEvent_ChannelClose); + LDKChannelId channel_id_var = obj->channel_close.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; +} +int8_tArray CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_counterparty_node_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKBumpTransactionEvent_ChannelClose); + int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(counterparty_node_id_arr->elems, obj->channel_close.counterparty_node_id.compressed_form, 33); + return counterparty_node_id_arr; +} int8_tArray CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_claim_id(int64_t ptr) { LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKBumpTransactionEvent_ChannelClose); @@ -10114,6 +11870,22 @@ int64_tArray CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_pending_htlcs(int64 return pending_htlcs_arr; } +int64_t CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_channel_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKBumpTransactionEvent_HTLCResolution); + LDKChannelId channel_id_var = obj->htlc_resolution.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; +} +int8_tArray CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_counterparty_node_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKBumpTransactionEvent_HTLCResolution); + int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(counterparty_node_id_arr->elems, obj->htlc_resolution.counterparty_node_id.compressed_form, 33); + return counterparty_node_id_arr; +} int8_tArray CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_claim_id(int64_t ptr) { LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKBumpTransactionEvent_HTLCResolution); @@ -10156,33 +11928,36 @@ uint32_t CS_LDK_LDKEvent_ty_from_ptr(int64_t ptr) { case LDKEvent_FundingGenerationReady: return 0; case LDKEvent_PaymentClaimable: return 1; case LDKEvent_PaymentClaimed: return 2; - case LDKEvent_InvoiceRequestFailed: return 3; - case LDKEvent_PaymentSent: return 4; - case LDKEvent_PaymentFailed: return 5; - case LDKEvent_PaymentPathSuccessful: return 6; - case LDKEvent_PaymentPathFailed: return 7; - case LDKEvent_ProbeSuccessful: return 8; - case LDKEvent_ProbeFailed: return 9; - case LDKEvent_PendingHTLCsForwardable: return 10; - case LDKEvent_HTLCIntercepted: return 11; - case LDKEvent_SpendableOutputs: return 12; - case LDKEvent_PaymentForwarded: return 13; - case LDKEvent_ChannelPending: return 14; - case LDKEvent_ChannelReady: return 15; - case LDKEvent_ChannelClosed: return 16; - case LDKEvent_DiscardFunding: return 17; - case LDKEvent_OpenChannelRequest: return 18; - case LDKEvent_HTLCHandlingFailed: return 19; - case LDKEvent_BumpTransaction: return 20; + case LDKEvent_ConnectionNeeded: return 3; + case LDKEvent_InvoiceRequestFailed: return 4; + case LDKEvent_PaymentSent: return 5; + case LDKEvent_PaymentFailed: return 6; + case LDKEvent_PaymentPathSuccessful: return 7; + case LDKEvent_PaymentPathFailed: return 8; + case LDKEvent_ProbeSuccessful: return 9; + case LDKEvent_ProbeFailed: return 10; + case LDKEvent_PendingHTLCsForwardable: return 11; + case LDKEvent_HTLCIntercepted: return 12; + case LDKEvent_SpendableOutputs: return 13; + case LDKEvent_PaymentForwarded: return 14; + case LDKEvent_ChannelPending: return 15; + case LDKEvent_ChannelReady: return 16; + case LDKEvent_ChannelClosed: return 17; + case LDKEvent_DiscardFunding: return 18; + case LDKEvent_OpenChannelRequest: return 19; + case LDKEvent_HTLCHandlingFailed: return 20; + case LDKEvent_BumpTransaction: return 21; default: abort(); } } -int8_tArray CS_LDK_LDKEvent_FundingGenerationReady_get_temporary_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_FundingGenerationReady_get_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_FundingGenerationReady); - int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(temporary_channel_id_arr->elems, obj->funding_generation_ready.temporary_channel_id.data, 32); - return temporary_channel_id_arr; + LDKChannelId temporary_channel_id_var = obj->funding_generation_ready.temporary_channel_id; + int64_t temporary_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_var); + temporary_channel_id_ref = tag_ptr(temporary_channel_id_var.inner, false); + return temporary_channel_id_ref; } int8_tArray CS_LDK_LDKEvent_FundingGenerationReady_get_counterparty_node_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10256,7 +12031,10 @@ int64_t CS_LDK_LDKEvent_PaymentClaimable_get_purpose(int64_t ptr) { int64_t CS_LDK_LDKEvent_PaymentClaimable_get_via_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentClaimable); - int64_t via_channel_id_ref = tag_ptr(&obj->payment_claimable.via_channel_id, false); + LDKChannelId via_channel_id_var = obj->payment_claimable.via_channel_id; + int64_t via_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(via_channel_id_var); + via_channel_id_ref = tag_ptr(via_channel_id_var.inner, false); return via_channel_id_ref; } int64_t CS_LDK_LDKEvent_PaymentClaimable_get_via_user_channel_id(int64_t ptr) { @@ -10320,6 +12098,27 @@ int64_t CS_LDK_LDKEvent_PaymentClaimed_get_sender_intended_total_msat(int64_t pt int64_t sender_intended_total_msat_ref = tag_ptr(&obj->payment_claimed.sender_intended_total_msat, false); return sender_intended_total_msat_ref; } +int8_tArray CS_LDK_LDKEvent_ConnectionNeeded_get_node_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_ConnectionNeeded); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(node_id_arr->elems, obj->connection_needed.node_id.compressed_form, 33); + return node_id_arr; +} +int64_tArray CS_LDK_LDKEvent_ConnectionNeeded_get_addresses(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_ConnectionNeeded); + LDKCVec_SocketAddressZ addresses_var = obj->connection_needed.addresses; + int64_tArray addresses_arr = NULL; + addresses_arr = init_int64_tArray(addresses_var.datalen, __LINE__); + int64_t *addresses_arr_ptr = (int64_t*)(((uint8_t*)addresses_arr) + 8); + for (size_t p = 0; p < addresses_var.datalen; p++) { + int64_t addresses_conv_15_ref = tag_ptr(&addresses_var.data[p], false); + addresses_arr_ptr[p] = addresses_conv_15_ref; + } + + return addresses_arr; +} int8_tArray CS_LDK_LDKEvent_InvoiceRequestFailed_get_payment_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_InvoiceRequestFailed); @@ -10542,26 +12341,53 @@ int64_tArray CS_LDK_LDKEvent_SpendableOutputs_get_outputs(int64_t ptr) { int64_t CS_LDK_LDKEvent_SpendableOutputs_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_SpendableOutputs); - int64_t channel_id_ref = tag_ptr(&obj->spendable_outputs.channel_id, false); + LDKChannelId channel_id_var = obj->spendable_outputs.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); return channel_id_ref; } int64_t CS_LDK_LDKEvent_PaymentForwarded_get_prev_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentForwarded); - int64_t prev_channel_id_ref = tag_ptr(&obj->payment_forwarded.prev_channel_id, false); + LDKChannelId prev_channel_id_var = obj->payment_forwarded.prev_channel_id; + int64_t prev_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_var); + prev_channel_id_ref = tag_ptr(prev_channel_id_var.inner, false); return prev_channel_id_ref; } int64_t CS_LDK_LDKEvent_PaymentForwarded_get_next_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentForwarded); - int64_t next_channel_id_ref = tag_ptr(&obj->payment_forwarded.next_channel_id, false); + LDKChannelId next_channel_id_var = obj->payment_forwarded.next_channel_id; + int64_t next_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(next_channel_id_var); + next_channel_id_ref = tag_ptr(next_channel_id_var.inner, false); return next_channel_id_ref; } -int64_t CS_LDK_LDKEvent_PaymentForwarded_get_fee_earned_msat(int64_t ptr) { +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_prev_user_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentForwarded); + int64_t prev_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.prev_user_channel_id, false); + return prev_user_channel_id_ref; +} +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_next_user_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentForwarded); - int64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false); - return fee_earned_msat_ref; + int64_t next_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.next_user_channel_id, false); + return next_user_channel_id_ref; +} +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_total_fee_earned_msat(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentForwarded); + int64_t total_fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.total_fee_earned_msat, false); + return total_fee_earned_msat_ref; +} +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_skimmed_fee_msat(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentForwarded); + int64_t skimmed_fee_msat_ref = tag_ptr(&obj->payment_forwarded.skimmed_fee_msat, false); + return skimmed_fee_msat_ref; } jboolean CS_LDK_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10575,12 +12401,14 @@ int64_t CS_LDK_LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(int6 int64_t outbound_amount_forwarded_msat_ref = tag_ptr(&obj->payment_forwarded.outbound_amount_forwarded_msat, false); return outbound_amount_forwarded_msat_ref; } -int8_tArray CS_LDK_LDKEvent_ChannelPending_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_ChannelPending_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_ChannelPending); - int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(channel_id_arr->elems, obj->channel_pending.channel_id.data, 32); - return channel_id_arr; + LDKChannelId channel_id_var = obj->channel_pending.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; } int8_tArray CS_LDK_LDKEvent_ChannelPending_get_user_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10592,7 +12420,10 @@ int8_tArray CS_LDK_LDKEvent_ChannelPending_get_user_channel_id(int64_t ptr) { int64_t CS_LDK_LDKEvent_ChannelPending_get_former_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_ChannelPending); - int64_t former_temporary_channel_id_ref = tag_ptr(&obj->channel_pending.former_temporary_channel_id, false); + LDKChannelId former_temporary_channel_id_var = obj->channel_pending.former_temporary_channel_id; + int64_t former_temporary_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_var); + former_temporary_channel_id_ref = tag_ptr(former_temporary_channel_id_var.inner, false); return former_temporary_channel_id_ref; } int8_tArray CS_LDK_LDKEvent_ChannelPending_get_counterparty_node_id(int64_t ptr) { @@ -10611,12 +12442,23 @@ int64_t CS_LDK_LDKEvent_ChannelPending_get_funding_txo(int64_t ptr) { funding_txo_ref = tag_ptr(funding_txo_var.inner, false); return funding_txo_ref; } -int8_tArray CS_LDK_LDKEvent_ChannelReady_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_ChannelPending_get_channel_type(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_ChannelPending); + LDKChannelTypeFeatures channel_type_var = obj->channel_pending.channel_type; + int64_t channel_type_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var); + channel_type_ref = tag_ptr(channel_type_var.inner, false); + return channel_type_ref; +} +int64_t CS_LDK_LDKEvent_ChannelReady_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_ChannelReady); - int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(channel_id_arr->elems, obj->channel_ready.channel_id.data, 32); - return channel_id_arr; + LDKChannelId channel_id_var = obj->channel_ready.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; } int8_tArray CS_LDK_LDKEvent_ChannelReady_get_user_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10641,12 +12483,14 @@ int64_t CS_LDK_LDKEvent_ChannelReady_get_channel_type(int64_t ptr) { channel_type_ref = tag_ptr(channel_type_var.inner, false); return channel_type_ref; } -int8_tArray CS_LDK_LDKEvent_ChannelClosed_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_ChannelClosed_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_ChannelClosed); - int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(channel_id_arr->elems, obj->channel_closed.channel_id.data, 32); - return channel_id_arr; + LDKChannelId channel_id_var = obj->channel_closed.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; } int8_tArray CS_LDK_LDKEvent_ChannelClosed_get_user_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10674,12 +12518,23 @@ int64_t CS_LDK_LDKEvent_ChannelClosed_get_channel_capacity_sats(int64_t ptr) { int64_t channel_capacity_sats_ref = tag_ptr(&obj->channel_closed.channel_capacity_sats, false); return channel_capacity_sats_ref; } -int8_tArray CS_LDK_LDKEvent_DiscardFunding_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_ChannelClosed_get_channel_funding_txo(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_ChannelClosed); + LDKOutPoint channel_funding_txo_var = obj->channel_closed.channel_funding_txo; + int64_t channel_funding_txo_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_txo_var); + channel_funding_txo_ref = tag_ptr(channel_funding_txo_var.inner, false); + return channel_funding_txo_ref; +} +int64_t CS_LDK_LDKEvent_DiscardFunding_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_DiscardFunding); - int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(channel_id_arr->elems, obj->discard_funding.channel_id.data, 32); - return channel_id_arr; + LDKChannelId channel_id_var = obj->discard_funding.channel_id; + int64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; } int8_tArray CS_LDK_LDKEvent_DiscardFunding_get_transaction(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10689,12 +12544,14 @@ int8_tArray CS_LDK_LDKEvent_DiscardFunding_get_transaction(int64_t ptr) { memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen); return transaction_arr; } -int8_tArray CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_OpenChannelRequest); - int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(temporary_channel_id_arr->elems, obj->open_channel_request.temporary_channel_id.data, 32); - return temporary_channel_id_arr; + LDKChannelId temporary_channel_id_var = obj->open_channel_request.temporary_channel_id; + int64_t temporary_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_var); + temporary_channel_id_ref = tag_ptr(temporary_channel_id_var.inner, false); + return temporary_channel_id_ref; } int8_tArray CS_LDK_LDKEvent_OpenChannelRequest_get_counterparty_node_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10724,12 +12581,14 @@ int64_t CS_LDK_LDKEvent_OpenChannelRequest_get_channel_type(int64_t ptr) { channel_type_ref = tag_ptr(channel_type_var.inner, false); return channel_type_ref; } -int8_tArray CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_HTLCHandlingFailed); - int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(prev_channel_id_arr->elems, obj->htlc_handling_failed.prev_channel_id.data, 32); - return prev_channel_id_arr; + LDKChannelId prev_channel_id_var = obj->htlc_handling_failed.prev_channel_id; + int64_t prev_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_var); + prev_channel_id_ref = tag_ptr(prev_channel_id_var.inner, false); + return prev_channel_id_ref; } int64_t CS_LDK_LDKEvent_HTLCHandlingFailed_get_failed_next_destination(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11267,32 +13126,51 @@ int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } -static inline struct LDKReceiveTlvs CResult_ReceiveTlvsDecodeErrorZ_get_ok(LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR owner){ - LDKReceiveTlvs ret = *owner->contents.result; +static inline struct LDKChannelId CResult_ChannelIdDecodeErrorZ_get_ok(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelId ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_ReceiveTlvsDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_ReceiveTlvsDecodeErrorZ* owner_conv = (LDKCResult_ReceiveTlvsDecodeErrorZ*)untag_ptr(owner); - LDKReceiveTlvs ret_var = CResult_ReceiveTlvsDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelIdDecodeErrorZ* owner_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(owner); + LDKChannelId ret_var = CResult_ChannelIdDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_ReceiveTlvsDecodeErrorZ_get_err(LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_ChannelIdDecodeErrorZ_get_err(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_ReceiveTlvsDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_ReceiveTlvsDecodeErrorZ* owner_conv = (LDKCResult_ReceiveTlvsDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_ChannelIdDecodeErrorZ* owner_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ReceiveTlvsDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_ChannelIdDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +static inline struct LDKThirtyTwoBytes C2Tuple__u832u16Z_get_a(LDKC2Tuple__u832u16Z *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); +} +int8_tArray CS_LDK_C2Tuple__u832u16Z_get_a(int64_t owner) { + LDKC2Tuple__u832u16Z* owner_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, C2Tuple__u832u16Z_get_a(owner_conv).data, 32); + return ret_arr; +} + +static inline uint16_t C2Tuple__u832u16Z_get_b(LDKC2Tuple__u832u16Z *NONNULL_PTR owner){ + return owner->b; +} +int16_t CS_LDK_C2Tuple__u832u16Z_get_b(int64_t owner) { + LDKC2Tuple__u832u16Z* owner_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(owner); + int16_t ret_conv = C2Tuple__u832u16Z_get_b(owner_conv); + return ret_conv; +} + static inline struct LDKPaymentRelay CResult_PaymentRelayDecodeErrorZ_get_ok(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR owner){ LDKPaymentRelay ret = *owner->contents.result; ret.is_owned = false; @@ -11345,120 +13223,104 @@ int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } -uint32_t CS_LDK_LDKPaymentError_ty_from_ptr(int64_t ptr) { - LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKPaymentError_Invoice: return 0; - case LDKPaymentError_Sending: return 1; - default: abort(); - } -} -jstring CS_LDK_LDKPaymentError_Invoice_get_invoice(int64_t ptr) { - LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr); - CHECK(obj->tag == LDKPaymentError_Invoice); - LDKStr invoice_str = obj->invoice; - jstring invoice_conv = str_ref_to_cs(invoice_str.chars, invoice_str.len); - return invoice_conv; -} -int32_t CS_LDK_LDKPaymentError_Sending_get_sending(int64_t ptr) { - LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr); - CHECK(obj->tag == LDKPaymentError_Sending); - int32_t sending_conv = LDKRetryableSendFailure_to_cs(obj->sending); - return sending_conv; -} -static inline struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesPaymentErrorZ_get_ok(LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR owner){ +static inline struct LDKPaymentContext CResult_PaymentContextDecodeErrorZ_get_ok(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return ThirtyTwoBytes_clone(&*owner->contents.result); + return PaymentContext_clone(&*owner->contents.result); } -int8_tArray CS_LDK_CResult_ThirtyTwoBytesPaymentErrorZ_get_ok(int64_t owner) { - LDKCResult_ThirtyTwoBytesPaymentErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesPaymentErrorZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, CResult_ThirtyTwoBytesPaymentErrorZ_get_ok(owner_conv).data, 32); - return ret_arr; +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_PaymentContextDecodeErrorZ* owner_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(owner); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = CResult_PaymentContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline struct LDKPaymentError CResult_ThirtyTwoBytesPaymentErrorZ_get_err(LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_PaymentContextDecodeErrorZ_get_err(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return PaymentError_clone(&*owner->contents.err); + return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_ThirtyTwoBytesPaymentErrorZ_get_err(int64_t owner) { - LDKCResult_ThirtyTwoBytesPaymentErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesPaymentErrorZ*)untag_ptr(owner); - LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); - *ret_copy = CResult_ThirtyTwoBytesPaymentErrorZ_get_err(owner_conv); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_PaymentContextDecodeErrorZ* owner_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_PaymentContextDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline void CResult_NonePaymentErrorZ_get_ok(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; +static inline struct LDKUnknownPaymentContext CResult_UnknownPaymentContextDecodeErrorZ_get_ok(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner){ + LDKUnknownPaymentContext ret = *owner->contents.result; + ret.is_owned = false; + return ret; } -void CS_LDK_CResult_NonePaymentErrorZ_get_ok(int64_t owner) { - LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner); - CResult_NonePaymentErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* owner_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(owner); + LDKUnknownPaymentContext ret_var = CResult_UnknownPaymentContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline struct LDKPaymentError CResult_NonePaymentErrorZ_get_err(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_UnknownPaymentContextDecodeErrorZ_get_err(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return PaymentError_clone(&*owner->contents.err); + return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_NonePaymentErrorZ_get_err(int64_t owner) { - LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner); - LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); - *ret_copy = CResult_NonePaymentErrorZ_get_err(owner_conv); +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* owner_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UnknownPaymentContextDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint32_t CS_LDK_LDKProbingError_ty_from_ptr(int64_t ptr) { - LDKProbingError *obj = (LDKProbingError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKProbingError_Invoice: return 0; - case LDKProbingError_Sending: return 1; - default: abort(); - } +static inline struct LDKBolt12OfferContext CResult_Bolt12OfferContextDecodeErrorZ_get_ok(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt12OfferContext ret = *owner->contents.result; + ret.is_owned = false; + return ret; } -jstring CS_LDK_LDKProbingError_Invoice_get_invoice(int64_t ptr) { - LDKProbingError *obj = (LDKProbingError*)untag_ptr(ptr); - CHECK(obj->tag == LDKProbingError_Invoice); - LDKStr invoice_str = obj->invoice; - jstring invoice_conv = str_ref_to_cs(invoice_str.chars, invoice_str.len); - return invoice_conv; +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(owner); + LDKBolt12OfferContext ret_var = CResult_Bolt12OfferContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int64_t CS_LDK_LDKProbingError_Sending_get_sending(int64_t ptr) { - LDKProbingError *obj = (LDKProbingError*)untag_ptr(ptr); - CHECK(obj->tag == LDKProbingError_Sending); - int64_t sending_ref = tag_ptr(&obj->sending, false); - return sending_ref; + +static inline struct LDKDecodeError CResult_Bolt12OfferContextDecodeErrorZ_get_err(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } -static inline struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_get_ok(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_clone(&*owner->contents.result); +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_Bolt12OfferContextDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_tArray CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_get_ok(int64_t owner) { - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* owner_conv = (LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ*)untag_ptr(owner); - LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ ret_var = CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_get_ok(owner_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t o = 0; o < ret_var.datalen; o++) { - LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ), "LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ"); - *ret_conv_40_conv = ret_var.data[o]; - ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true); - } - - FREE(ret_var.data); - return ret_arr; + +static inline struct LDKBolt12RefundContext CResult_Bolt12RefundContextDecodeErrorZ_get_ok(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt12RefundContext ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(owner); + LDKBolt12RefundContext ret_var = CResult_Bolt12RefundContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -static inline struct LDKProbingError CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_get_err(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_Bolt12RefundContextDecodeErrorZ_get_err(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return ProbingError_clone(&*owner->contents.err); + return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_get_err(int64_t owner) { - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* owner_conv = (LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ*)untag_ptr(owner); - LDKProbingError *ret_copy = MALLOC(sizeof(LDKProbingError), "LDKProbingError"); - *ret_copy = CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_get_err(owner_conv); +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_Bolt12RefundContextDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -11484,53 +13346,99 @@ int32_t CS_LDK_CResult_StrSecp256k1ErrorZ_get_err(int64_t owner) { return ret_conv; } -static inline struct LDKOnionMessagePath CResult_OnionMessagePathNoneZ_get_ok(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ - LDKOnionMessagePath ret = *owner->contents.result; +static inline struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); +} +int8_tArray CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(owner_conv).data, 32); + return ret_arr; +} + +static inline struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + LDKRecipientOnionFields ret = owner->b; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_OnionMessagePathNoneZ_get_ok(int64_t owner) { - LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); - LDKOnionMessagePath ret_var = CResult_OnionMessagePathNoneZ_get_ok(owner_conv); +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + LDKRecipientOnionFields ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline void CResult_OnionMessagePathNoneZ_get_err(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR owner){ +static inline struct LDKRouteParameters C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ + LDKRouteParameters ret = owner->c; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(int64_t owner) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* owner_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(owner); + LDKRouteParameters ret_var = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_c(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(int64_t owner) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(owner_conv); + return tag_ptr(ret_conv, true); +} + +static inline void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -void CS_LDK_CResult_OnionMessagePathNoneZ_get_err(int64_t owner) { - LDKCResult_OnionMessagePathNoneZ* owner_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(owner); - CResult_OnionMessagePathNoneZ_get_err(owner_conv); +void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(int64_t owner) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* owner_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(owner); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(owner_conv); } -static inline struct LDKPublicKey C2Tuple_PublicKeyOnionMessageZ_get_a(LDKC2Tuple_PublicKeyOnionMessageZ *NONNULL_PTR owner){ +static inline struct LDKPublicKey C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner){ return owner->a; } -int8_tArray CS_LDK_C2Tuple_PublicKeyOnionMessageZ_get_a(int64_t owner) { - LDKC2Tuple_PublicKeyOnionMessageZ* owner_conv = (LDKC2Tuple_PublicKeyOnionMessageZ*)untag_ptr(owner); +int8_tArray CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(int64_t owner) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* owner_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(owner); int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, C2Tuple_PublicKeyOnionMessageZ_get_a(owner_conv).compressed_form, 33); + memcpy(ret_arr->elems, C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(owner_conv).compressed_form, 33); return ret_arr; } -static inline struct LDKOnionMessage C2Tuple_PublicKeyOnionMessageZ_get_b(LDKC2Tuple_PublicKeyOnionMessageZ *NONNULL_PTR owner){ +static inline struct LDKOnionMessage C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_b(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner){ LDKOnionMessage ret = owner->b; ret.is_owned = false; return ret; } -int64_t CS_LDK_C2Tuple_PublicKeyOnionMessageZ_get_b(int64_t owner) { - LDKC2Tuple_PublicKeyOnionMessageZ* owner_conv = (LDKC2Tuple_PublicKeyOnionMessageZ*)untag_ptr(owner); - LDKOnionMessage ret_var = C2Tuple_PublicKeyOnionMessageZ_get_b(owner_conv); +int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_b(int64_t owner) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* owner_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(owner); + LDKOnionMessage ret_var = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_b(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +static inline struct LDKCOption_CVec_SocketAddressZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_c(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner){ + return COption_CVec_SocketAddressZZ_clone(&owner->c); +} +int64_t CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_c(int64_t owner) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* owner_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(owner); + LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); + *ret_copy = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_c(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint32_t CS_LDK_LDKSendError_ty_from_ptr(int64_t ptr) { LDKSendError *obj = (LDKSendError*)untag_ptr(ptr); switch(obj->tag) { @@ -11538,10 +13446,12 @@ uint32_t CS_LDK_LDKSendError_ty_from_ptr(int64_t ptr) { case LDKSendError_TooBigPacket: return 1; case LDKSendError_TooFewBlindedHops: return 2; case LDKSendError_InvalidFirstHop: return 3; - case LDKSendError_InvalidMessage: return 4; - case LDKSendError_BufferFull: return 5; - case LDKSendError_GetNodeIdFailed: return 6; - case LDKSendError_BlindedPathAdvanceFailed: return 7; + case LDKSendError_PathNotFound: return 4; + case LDKSendError_InvalidMessage: return 5; + case LDKSendError_BufferFull: return 6; + case LDKSendError_GetNodeIdFailed: return 7; + case LDKSendError_UnresolvedIntroductionNode: return 8; + case LDKSendError_BlindedPathAdvanceFailed: return 9; default: abort(); } } @@ -11551,29 +13461,57 @@ int32_t CS_LDK_LDKSendError_Secp256k1_get_secp256k1(int64_t ptr) { int32_t secp256k1_conv = LDKSecp256k1Error_to_cs(obj->secp256k1); return secp256k1_conv; } -static inline struct LDKC2Tuple_PublicKeyOnionMessageZ CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_get_ok(LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ *NONNULL_PTR owner){ +int8_tArray CS_LDK_LDKSendError_InvalidFirstHop_get_invalid_first_hop(int64_t ptr) { + LDKSendError *obj = (LDKSendError*)untag_ptr(ptr); + CHECK(obj->tag == LDKSendError_InvalidFirstHop); + int8_tArray invalid_first_hop_arr = init_int8_tArray(33, __LINE__); + memcpy(invalid_first_hop_arr->elems, obj->invalid_first_hop.compressed_form, 33); + return invalid_first_hop_arr; +} +static inline struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_ok(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return C2Tuple_PublicKeyOnionMessageZ_clone(&*owner->contents.result); + return C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(&*owner->contents.result); } -int64_t CS_LDK_CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_get_ok(int64_t owner) { - LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ* owner_conv = (LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ*)untag_ptr(owner); - LDKC2Tuple_PublicKeyOnionMessageZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyOnionMessageZ), "LDKC2Tuple_PublicKeyOnionMessageZ"); - *ret_conv = CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_ok(int64_t owner) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* owner_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(owner); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_ok(owner_conv); return tag_ptr(ret_conv, true); } -static inline struct LDKSendError CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_get_err(LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ *NONNULL_PTR owner){ +static inline struct LDKSendError CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_err(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return SendError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_get_err(int64_t owner) { - LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ* owner_conv = (LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_err(int64_t owner) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* owner_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(owner); LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_get_err(owner_conv); + *ret_copy = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +uint32_t CS_LDK_LDKNextMessageHop_ty_from_ptr(int64_t ptr) { + LDKNextMessageHop *obj = (LDKNextMessageHop*)untag_ptr(ptr); + switch(obj->tag) { + case LDKNextMessageHop_NodeId: return 0; + case LDKNextMessageHop_ShortChannelId: return 1; + default: abort(); + } +} +int8_tArray CS_LDK_LDKNextMessageHop_NodeId_get_node_id(int64_t ptr) { + LDKNextMessageHop *obj = (LDKNextMessageHop*)untag_ptr(ptr); + CHECK(obj->tag == LDKNextMessageHop_NodeId); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(node_id_arr->elems, obj->node_id.compressed_form, 33); + return node_id_arr; +} +int64_t CS_LDK_LDKNextMessageHop_ShortChannelId_get_short_channel_id(int64_t ptr) { + LDKNextMessageHop *obj = (LDKNextMessageHop*)untag_ptr(ptr); + CHECK(obj->tag == LDKNextMessageHop_ShortChannelId); + int64_t short_channel_id_conv = obj->short_channel_id; + return short_channel_id_conv; +} uint32_t CS_LDK_LDKParsedOnionMessageContents_ty_from_ptr(int64_t ptr) { LDKParsedOnionMessageContents *obj = (LDKParsedOnionMessageContents*)untag_ptr(ptr); switch(obj->tag) { @@ -11603,12 +13541,11 @@ uint32_t CS_LDK_LDKPeeledOnion_ty_from_ptr(int64_t ptr) { default: abort(); } } -int8_tArray CS_LDK_LDKPeeledOnion_Forward_get__0(int64_t ptr) { +int64_t CS_LDK_LDKPeeledOnion_Forward_get__0(int64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); CHECK(obj->tag == LDKPeeledOnion_Forward); - int8_tArray _0_arr = init_int8_tArray(33, __LINE__); - memcpy(_0_arr->elems, obj->forward._0.compressed_form, 33); - return _0_arr; + int64_t _0_ref = tag_ptr(&obj->forward._0, false); + return _0_ref; } int64_t CS_LDK_LDKPeeledOnion_Forward_get__1(int64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); @@ -11662,23 +13599,41 @@ void CS_LDK_CResult_PeeledOnionNoneZ_get_err(int64_t owner) { CResult_PeeledOnionNoneZ_get_err(owner_conv); } -static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){ +uint32_t CS_LDK_LDKSendSuccess_ty_from_ptr(int64_t ptr) { + LDKSendSuccess *obj = (LDKSendSuccess*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSendSuccess_Buffered: return 0; + case LDKSendSuccess_BufferedAwaitingConnection: return 1; + default: abort(); + } +} +int8_tArray CS_LDK_LDKSendSuccess_BufferedAwaitingConnection_get_buffered_awaiting_connection(int64_t ptr) { + LDKSendSuccess *obj = (LDKSendSuccess*)untag_ptr(ptr); + CHECK(obj->tag == LDKSendSuccess_BufferedAwaitingConnection); + int8_tArray buffered_awaiting_connection_arr = init_int8_tArray(33, __LINE__); + memcpy(buffered_awaiting_connection_arr->elems, obj->buffered_awaiting_connection.compressed_form, 33); + return buffered_awaiting_connection_arr; +} +static inline struct LDKSendSuccess CResult_SendSuccessSendErrorZ_get_ok(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return *owner->contents.result; + return SendSuccess_clone(&*owner->contents.result); } -void CS_LDK_CResult_NoneSendErrorZ_get_ok(int64_t owner) { - LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner); - CResult_NoneSendErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_get_ok(int64_t owner) { + LDKCResult_SendSuccessSendErrorZ* owner_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(owner); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = CResult_SendSuccessSendErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){ +static inline struct LDKSendError CResult_SendSuccessSendErrorZ_get_err(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return SendError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_NoneSendErrorZ_get_err(int64_t owner) { - LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_get_err(int64_t owner) { + LDKCResult_SendSuccessSendErrorZ* owner_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(owner); LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv); + *ret_copy = CResult_SendSuccessSendErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -11726,6 +13681,13 @@ void CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(int64_t own CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_get_err(owner_conv); } +static inline LDKCVec_ForwardNodeZ CVec_ForwardNodeZ_clone(const LDKCVec_ForwardNodeZ *orig) { + LDKCVec_ForwardNodeZ ret = { .data = MALLOC(sizeof(LDKForwardNode) * orig->datalen, "LDKCVec_ForwardNodeZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = ForwardNode_clone(&orig->data[i]); + } + return ret; +} static inline struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ LDKBlindedPath ret = *owner->contents.result; ret.is_owned = false; @@ -11804,6 +13766,126 @@ int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_get_err(int64_t owner) { return ret_ref; } +static inline struct LDKTrackedSpendableOutput CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR owner){ + LDKTrackedSpendableOutput ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* owner_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(owner); + LDKTrackedSpendableOutput ret_var = CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_TrackedSpendableOutputDecodeErrorZ_get_err(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* owner_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_TrackedSpendableOutputDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint32_t CS_LDK_LDKOutputSpendStatus_ty_from_ptr(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + switch(obj->tag) { + case LDKOutputSpendStatus_PendingInitialBroadcast: return 0; + case LDKOutputSpendStatus_PendingFirstConfirmation: return 1; + case LDKOutputSpendStatus_PendingThresholdConfirmations: return 2; + default: abort(); + } +} +int64_t CS_LDK_LDKOutputSpendStatus_PendingInitialBroadcast_get_delayed_until_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingInitialBroadcast); + int64_t delayed_until_height_ref = tag_ptr(&obj->pending_initial_broadcast.delayed_until_height, false); + return delayed_until_height_ref; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_first_broadcast_hash(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingFirstConfirmation); + int8_tArray first_broadcast_hash_arr = init_int8_tArray(32, __LINE__); + memcpy(first_broadcast_hash_arr->elems, obj->pending_first_confirmation.first_broadcast_hash.data, 32); + return first_broadcast_hash_arr; +} +int32_t CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_broadcast_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingFirstConfirmation); + int32_t latest_broadcast_height_conv = obj->pending_first_confirmation.latest_broadcast_height; + return latest_broadcast_height_conv; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_spending_tx(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingFirstConfirmation); + LDKTransaction latest_spending_tx_var = obj->pending_first_confirmation.latest_spending_tx; + int8_tArray latest_spending_tx_arr = init_int8_tArray(latest_spending_tx_var.datalen, __LINE__); + memcpy(latest_spending_tx_arr->elems, latest_spending_tx_var.data, latest_spending_tx_var.datalen); + return latest_spending_tx_arr; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_first_broadcast_hash(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int8_tArray first_broadcast_hash_arr = init_int8_tArray(32, __LINE__); + memcpy(first_broadcast_hash_arr->elems, obj->pending_threshold_confirmations.first_broadcast_hash.data, 32); + return first_broadcast_hash_arr; +} +int32_t CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_broadcast_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int32_t latest_broadcast_height_conv = obj->pending_threshold_confirmations.latest_broadcast_height; + return latest_broadcast_height_conv; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_spending_tx(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + LDKTransaction latest_spending_tx_var = obj->pending_threshold_confirmations.latest_spending_tx; + int8_tArray latest_spending_tx_arr = init_int8_tArray(latest_spending_tx_var.datalen, __LINE__); + memcpy(latest_spending_tx_arr->elems, latest_spending_tx_var.data, latest_spending_tx_var.datalen); + return latest_spending_tx_arr; +} +int32_t CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int32_t confirmation_height_conv = obj->pending_threshold_confirmations.confirmation_height; + return confirmation_height_conv; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_hash(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int8_tArray confirmation_hash_arr = init_int8_tArray(32, __LINE__); + memcpy(confirmation_hash_arr->elems, obj->pending_threshold_confirmations.confirmation_hash.data, 32); + return confirmation_hash_arr; +} +static inline struct LDKOutputSpendStatus CResult_OutputSpendStatusDecodeErrorZ_get_ok(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return OutputSpendStatus_clone(&*owner->contents.result); +} +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OutputSpendStatusDecodeErrorZ* owner_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(owner); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = CResult_OutputSpendStatusDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OutputSpendStatusDecodeErrorZ_get_err(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_OutputSpendStatusDecodeErrorZ* owner_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OutputSpendStatusDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + typedef struct LDKFilter_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -11821,7 +13903,7 @@ void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32 LDKu8slice script_pubkey_var = script_pubkey; int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__); memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen); - js_invoke_function_void_ll(j_calls->instance_ptr, 51, (int64_t)txid_arr, (int64_t)script_pubkey_arr); + js_invoke_function_void_ll(j_calls->instance_ptr, 56, (int64_t)txid_arr, (int64_t)script_pubkey_arr); } void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; @@ -11829,7 +13911,7 @@ void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput outp int64_t output_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); output_ref = tag_ptr(output_var.inner, output_var.is_owned); - js_invoke_function_void_l(j_calls->instance_ptr, 52, output_ref); + js_invoke_function_void_l(j_calls->instance_ptr, 57, output_ref); } static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg; @@ -11900,85 +13982,62 @@ int64_t CS_LDK_LDKCOption_FilterZ_Some_get_some(int64_t ptr) { } return tag_ptr(some_ret, true); } -static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){ - LDKLockedChannelMonitor ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_get_ok(int64_t owner) { - LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); - LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -void CS_LDK_CResult_LockedChannelMonitorNoneZ_get_err(int64_t owner) { - LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); - CResult_LockedChannelMonitorNoneZ_get_err(owner_conv); -} - -static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) { - LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_TrackedSpendableOutputZ CVec_TrackedSpendableOutputZ_clone(const LDKCVec_TrackedSpendableOutputZ *orig) { + LDKCVec_TrackedSpendableOutputZ ret = { .data = MALLOC(sizeof(LDKTrackedSpendableOutput) * orig->datalen, "LDKCVec_TrackedSpendableOutputZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = OutPoint_clone(&orig->data[i]); + ret.data[i] = TrackedSpendableOutput_clone(&orig->data[i]); } return ret; } -static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) { - LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = MonitorUpdateId_clone(&orig->data[i]); +typedef struct LDKChangeDestinationSource_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKChangeDestinationSource_JCalls; +static void LDKChangeDestinationSource_JCalls_free(void* this_arg) { + LDKChangeDestinationSource_JCalls *j_calls = (LDKChangeDestinationSource_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); } - return ret; } -static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ - LDKOutPoint ret = owner->a; - ret.is_owned = false; - return ret; +LDKCResult_CVec_u8ZNoneZ get_change_destination_script_LDKChangeDestinationSource_jcall(const void* this_arg) { + LDKChangeDestinationSource_JCalls *j_calls = (LDKChangeDestinationSource_JCalls*) this_arg; + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 58); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(int64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static void LDKChangeDestinationSource_JCalls_cloned(LDKChangeDestinationSource* new_obj) { + LDKChangeDestinationSource_JCalls *j_calls = (LDKChangeDestinationSource_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); } +static inline LDKChangeDestinationSource LDKChangeDestinationSource_init (int64_t o) { + LDKChangeDestinationSource_JCalls *calls = MALLOC(sizeof(LDKChangeDestinationSource_JCalls), "LDKChangeDestinationSource_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; -static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ - return CVec_MonitorUpdateIdZ_clone(&owner->b); + LDKChangeDestinationSource ret = { + .this_arg = (void*) calls, + .get_change_destination_script = get_change_destination_script_LDKChangeDestinationSource_jcall, + .free = LDKChangeDestinationSource_JCalls_free, + }; + return ret; } -int64_tArray CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(int64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t r = 0; r < ret_var.datalen; r++) { - LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; - int64_t ret_conv_17_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var); - ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned); - ret_arr_ptr[r] = ret_conv_17_ref; - } - - FREE(ret_var.data); - return ret_arr; +uint64_t CS_LDK_LDKChangeDestinationSource_new(int32_t o) { + LDKChangeDestinationSource *res_ptr = MALLOC(sizeof(LDKChangeDestinationSource), "LDKChangeDestinationSource"); + *res_ptr = LDKChangeDestinationSource_init(o); + return tag_ptr(res_ptr, true); } - -static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); - } - return ret; +int64_t CS_LDK_ChangeDestinationSource_get_change_destination_script(int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKChangeDestinationSource* this_arg_conv = (LDKChangeDestinationSource*)this_arg_ptr; + LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); + *ret_conv = (this_arg_conv->get_change_destination_script)(this_arg_conv->this_arg); + return tag_ptr(ret_conv, true); } + typedef struct LDKKVStore_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -12000,7 +14059,7 @@ LDKCResult_CVec_u8ZIOErrorZ read_LDKKVStore_jcall(const void* this_arg, LDKStr p LDKStr key_str = key; jstring key_conv = str_ref_to_cs(key_str.chars, key_str.len); Str_free(key_str); - uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 53, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 59, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZIOErrorZ ret_conv = *(LDKCResult_CVec_u8ZIOErrorZ*)(ret_ptr); @@ -12021,7 +14080,7 @@ LDKCResult_NoneIOErrorZ write_LDKKVStore_jcall(const void* this_arg, LDKStr prim LDKu8slice buf_var = buf; int8_tArray buf_arr = init_int8_tArray(buf_var.datalen, __LINE__); memcpy(buf_arr->elems, buf_var.data, buf_var.datalen); - uint64_t ret = js_invoke_function_l_llll(j_calls->instance_ptr, 54, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, (int64_t)buf_arr); + uint64_t ret = js_invoke_function_l_llll(j_calls->instance_ptr, 60, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, (int64_t)buf_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -12040,7 +14099,7 @@ LDKCResult_NoneIOErrorZ remove_LDKKVStore_jcall(const void* this_arg, LDKStr pri jstring key_conv = str_ref_to_cs(key_str.chars, key_str.len); Str_free(key_str); jboolean lazy_conv = lazy; - uint64_t ret = js_invoke_function_l_lllb(j_calls->instance_ptr, 55, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, lazy_conv); + uint64_t ret = js_invoke_function_l_lllb(j_calls->instance_ptr, 61, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, lazy_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -12055,7 +14114,7 @@ LDKCResult_CVec_StrZIOErrorZ list_LDKKVStore_jcall(const void* this_arg, LDKStr LDKStr secondary_namespace_str = secondary_namespace; jstring secondary_namespace_conv = str_ref_to_cs(secondary_namespace_str.chars, secondary_namespace_str.len); Str_free(secondary_namespace_str); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 56, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 62, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_StrZIOErrorZ ret_conv = *(LDKCResult_CVec_StrZIOErrorZ*)(ret_ptr); @@ -12137,6 +14196,465 @@ int64_t CS_LDK_KVStore_list(int64_t this_arg, jstring primary_namespace, jstrin return tag_ptr(ret_conv, true); } +typedef struct LDKOutputSpender_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKOutputSpender_JCalls; +static void LDKOutputSpender_JCalls_free(void* this_arg) { + LDKOutputSpender_JCalls *j_calls = (LDKOutputSpender_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCResult_TransactionNoneZ spend_spendable_outputs_LDKOutputSpender_jcall(const void* this_arg, LDKCVec_SpendableOutputDescriptorZ descriptors, LDKCVec_TxOutZ outputs, LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, LDKCOption_u32Z locktime) { + LDKOutputSpender_JCalls *j_calls = (LDKOutputSpender_JCalls*) this_arg; + LDKCVec_SpendableOutputDescriptorZ descriptors_var = descriptors; + int64_tArray descriptors_arr = NULL; + descriptors_arr = init_int64_tArray(descriptors_var.datalen, __LINE__); + int64_t *descriptors_arr_ptr = (int64_t*)(((uint8_t*)descriptors_arr) + 8); + for (size_t b = 0; b < descriptors_var.datalen; b++) { + LDKSpendableOutputDescriptor *descriptors_conv_27_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *descriptors_conv_27_copy = descriptors_var.data[b]; + int64_t descriptors_conv_27_ref = tag_ptr(descriptors_conv_27_copy, true); + descriptors_arr_ptr[b] = descriptors_conv_27_ref; + } + + FREE(descriptors_var.data); + LDKCVec_TxOutZ outputs_var = outputs; + int64_tArray outputs_arr = NULL; + outputs_arr = init_int64_tArray(outputs_var.datalen, __LINE__); + int64_t *outputs_arr_ptr = (int64_t*)(((uint8_t*)outputs_arr) + 8); + for (size_t h = 0; h < outputs_var.datalen; h++) { + LDKTxOut* outputs_conv_7_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *outputs_conv_7_ref = outputs_var.data[h]; + outputs_arr_ptr[h] = tag_ptr(outputs_conv_7_ref, true); + } + + FREE(outputs_var.data); + LDKCVec_u8Z change_destination_script_var = change_destination_script; + int8_tArray change_destination_script_arr = init_int8_tArray(change_destination_script_var.datalen, __LINE__); + memcpy(change_destination_script_arr->elems, change_destination_script_var.data, change_destination_script_var.datalen); + CVec_u8Z_free(change_destination_script_var); + int32_t feerate_sat_per_1000_weight_conv = feerate_sat_per_1000_weight; + LDKCOption_u32Z *locktime_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *locktime_copy = locktime; + int64_t locktime_ref = tag_ptr(locktime_copy, true); + uint64_t ret = js_invoke_function_l_lllil(j_calls->instance_ptr, 63, (int64_t)descriptors_arr, (int64_t)outputs_arr, (int64_t)change_destination_script_arr, feerate_sat_per_1000_weight_conv, locktime_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +static void LDKOutputSpender_JCalls_cloned(LDKOutputSpender* new_obj) { + LDKOutputSpender_JCalls *j_calls = (LDKOutputSpender_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKOutputSpender LDKOutputSpender_init (int64_t o) { + LDKOutputSpender_JCalls *calls = MALLOC(sizeof(LDKOutputSpender_JCalls), "LDKOutputSpender_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKOutputSpender ret = { + .this_arg = (void*) calls, + .spend_spendable_outputs = spend_spendable_outputs_LDKOutputSpender_jcall, + .free = LDKOutputSpender_JCalls_free, + }; + return ret; +} +uint64_t CS_LDK_LDKOutputSpender_new(int32_t o) { + LDKOutputSpender *res_ptr = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *res_ptr = LDKOutputSpender_init(o); + return tag_ptr(res_ptr, true); +} +int64_t CS_LDK_OutputSpender_spend_spendable_outputs(int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKOutputSpender* this_arg_conv = (LDKOutputSpender*)this_arg_ptr; + LDKCVec_SpendableOutputDescriptorZ descriptors_constr; + descriptors_constr.datalen = descriptors->arr_len; + if (descriptors_constr.datalen > 0) + descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + descriptors_constr.data = NULL; + int64_t* descriptors_vals = descriptors->elems; + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_t descriptors_conv_27 = descriptors_vals[b]; + void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); + CHECK_ACCESS(descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); + descriptors_constr.data[b] = descriptors_conv_27_conv; + } + FREE(descriptors); + LDKCVec_TxOutZ outputs_constr; + outputs_constr.datalen = outputs->arr_len; + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); + else + outputs_constr.data = NULL; + int64_t* outputs_vals = outputs->elems; + for (size_t h = 0; h < outputs_constr.datalen; h++) { + int64_t outputs_conv_7 = outputs_vals[h]; + void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7); + CHECK_ACCESS(outputs_conv_7_ptr); + LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); + outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7)); + outputs_constr.data[h] = outputs_conv_7_conv; + } + FREE(outputs); + LDKCVec_u8Z change_destination_script_ref; + change_destination_script_ref.datalen = change_destination_script->arr_len; + change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script); + void* locktime_ptr = untag_ptr(locktime); + CHECK_ACCESS(locktime_ptr); + LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); + locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = (this_arg_conv->spend_spendable_outputs)(this_arg_conv->this_arg, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); + return tag_ptr(ret_conv, true); +} + +static inline struct LDKOutputSweeper CResult_OutputSweeperDecodeErrorZ_get_ok(LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR owner){ + LDKOutputSweeper ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OutputSweeperDecodeErrorZ* owner_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(owner); + LDKOutputSweeper ret_var = CResult_OutputSweeperDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OutputSweeperDecodeErrorZ_get_err(LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_OutputSweeperDecodeErrorZ* owner_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OutputSweeperDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBestBlock C2Tuple_BestBlockOutputSweeperZ_get_a(LDKC2Tuple_BestBlockOutputSweeperZ *NONNULL_PTR owner){ + LDKBestBlock ret = owner->a; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_get_a(int64_t owner) { + LDKC2Tuple_BestBlockOutputSweeperZ* owner_conv = (LDKC2Tuple_BestBlockOutputSweeperZ*)untag_ptr(owner); + LDKBestBlock ret_var = C2Tuple_BestBlockOutputSweeperZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKOutputSweeper C2Tuple_BestBlockOutputSweeperZ_get_b(LDKC2Tuple_BestBlockOutputSweeperZ *NONNULL_PTR owner){ + LDKOutputSweeper ret = owner->b; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_get_b(int64_t owner) { + LDKC2Tuple_BestBlockOutputSweeperZ* owner_conv = (LDKC2Tuple_BestBlockOutputSweeperZ*)untag_ptr(owner); + LDKOutputSweeper ret_var = C2Tuple_BestBlockOutputSweeperZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKC2Tuple_BestBlockOutputSweeperZ *CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return &*owner->contents.result; +} +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(owner); + int64_t ret_ret = tag_ptr(CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(owner_conv), false); + return ret_ret; +} + +static inline struct LDKDecodeError CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDelayedPaymentBasepoint CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner){ + LDKDelayedPaymentBasepoint ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(owner); + LDKDelayedPaymentBasepoint ret_var = CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDelayedPaymentKey CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR owner){ + LDKDelayedPaymentKey ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(owner); + LDKDelayedPaymentKey ret_var = CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_DelayedPaymentKeyDecodeErrorZ_get_err(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_DelayedPaymentKeyDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKHtlcBasepoint CResult_HtlcBasepointDecodeErrorZ_get_ok(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR owner){ + LDKHtlcBasepoint ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); + LDKHtlcBasepoint ret_var = CResult_HtlcBasepointDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_HtlcBasepointDecodeErrorZ_get_err(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HtlcBasepointDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKHtlcKey CResult_HtlcKeyDecodeErrorZ_get_ok(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR owner){ + LDKHtlcKey ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_HtlcKeyDecodeErrorZ* owner_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(owner); + LDKHtlcKey ret_var = CResult_HtlcKeyDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_HtlcKeyDecodeErrorZ_get_err(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_HtlcKeyDecodeErrorZ* owner_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HtlcKeyDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRevocationBasepoint CResult_RevocationBasepointDecodeErrorZ_get_ok(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR owner){ + LDKRevocationBasepoint ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_RevocationBasepointDecodeErrorZ* owner_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(owner); + LDKRevocationBasepoint ret_var = CResult_RevocationBasepointDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RevocationBasepointDecodeErrorZ_get_err(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_RevocationBasepointDecodeErrorZ* owner_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RevocationBasepointDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRevocationKey CResult_RevocationKeyDecodeErrorZ_get_ok(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR owner){ + LDKRevocationKey ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); + LDKRevocationKey ret_var = CResult_RevocationKeyDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RevocationKeyDecodeErrorZ_get_err(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RevocationKeyDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){ + LDKLockedChannelMonitor ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_get_ok(int64_t owner) { + LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); + LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void CS_LDK_CResult_LockedChannelMonitorNoneZ_get_err(int64_t owner) { + LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); + CResult_LockedChannelMonitorNoneZ_get_err(owner_conv); +} + +static inline struct LDKOutPoint C2Tuple_OutPointChannelIdZ_get_a(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR owner){ + LDKOutPoint ret = owner->a; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_get_a(int64_t owner) { + LDKC2Tuple_OutPointChannelIdZ* owner_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointChannelIdZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKChannelId C2Tuple_OutPointChannelIdZ_get_b(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR owner){ + LDKChannelId ret = owner->b; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_get_b(int64_t owner) { + LDKC2Tuple_OutPointChannelIdZ* owner_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(owner); + LDKChannelId ret_var = C2Tuple_OutPointChannelIdZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline LDKCVec_C2Tuple_OutPointChannelIdZZ CVec_C2Tuple_OutPointChannelIdZZ_clone(const LDKCVec_C2Tuple_OutPointChannelIdZZ *orig) { + LDKCVec_C2Tuple_OutPointChannelIdZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointChannelIdZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OutPointChannelIdZ_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) { + LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MonitorUpdateId_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ + LDKOutPoint ret = owner->a; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ + return CVec_MonitorUpdateIdZ_clone(&owner->b); +} +int64_tArray CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t r = 0; r < ret_var.datalen; r++) { + LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; + int64_t ret_conv_17_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var); + ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned); + ret_arr_ptr[r] = ret_conv_17_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); + } + return ret; +} typedef struct LDKPersister_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -12154,7 +14672,7 @@ LDKCResult_NoneIOErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, // WARNING: we may need a move here but no clone is available for LDKChannelManager CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 57, channel_manager_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 64, channel_manager_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -12168,7 +14686,7 @@ LDKCResult_NoneIOErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, c // WARNING: we may need a move here but no clone is available for LDKNetworkGraph CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var); network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 58, network_graph_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 65, network_graph_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -12179,7 +14697,7 @@ LDKCResult_NoneIOErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; // WARNING: This object doesn't live past this scope, needs clone! int64_t ret_scorer = tag_ptr(scorer, false); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 59, ret_scorer); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 66, ret_scorer); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -12259,12 +14777,12 @@ static void LDKPersist_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; - LDKOutPoint channel_id_var = channel_id; - int64_t channel_id_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned); + LDKOutPoint channel_funding_outpoint_var = channel_funding_outpoint; + int64_t channel_funding_outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_var); + channel_funding_outpoint_ref = tag_ptr(channel_funding_outpoint_var.inner, channel_funding_outpoint_var.is_owned); LDKChannelMonitor data_var = *data; int64_t data_ref = 0; data_var = ChannelMonitor_clone(&data_var); @@ -12274,16 +14792,16 @@ LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* t int64_t update_id_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned); - uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_lll(j_calls->instance_ptr, 60, channel_id_ref, data_ref, update_id_ref); + uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_lll(j_calls->instance_ptr, 67, channel_funding_outpoint_ref, data_ref, update_id_ref); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); return ret_conv; } -LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; - LDKOutPoint channel_id_var = channel_id; - int64_t channel_id_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned); + LDKOutPoint channel_funding_outpoint_var = channel_funding_outpoint; + int64_t channel_funding_outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_var); + channel_funding_outpoint_ref = tag_ptr(channel_funding_outpoint_var.inner, channel_funding_outpoint_var.is_owned); LDKChannelMonitorUpdate update_var = update; int64_t update_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); @@ -12297,10 +14815,18 @@ LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const vo int64_t update_id_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned); - uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_llll(j_calls->instance_ptr, 61, channel_id_ref, update_ref, data_ref, update_id_ref); + uint64_t ret = js_invoke_function_ChannelMonitorUpdateStatus_llll(j_calls->instance_ptr, 68, channel_funding_outpoint_ref, update_ref, data_ref, update_id_ref); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); return ret_conv; } +void archive_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + LDKOutPoint channel_funding_outpoint_var = channel_funding_outpoint; + int64_t channel_funding_outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_var); + channel_funding_outpoint_ref = tag_ptr(channel_funding_outpoint_var.inner, channel_funding_outpoint_var.is_owned); + js_invoke_function_void_l(j_calls->instance_ptr, 69, channel_funding_outpoint_ref); +} static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); @@ -12314,6 +14840,7 @@ static inline LDKPersist LDKPersist_init (int64_t o) { .this_arg = (void*) calls, .persist_new_channel = persist_new_channel_LDKPersist_jcall, .update_persisted_channel = update_persisted_channel_LDKPersist_jcall, + .archive_persisted_channel = archive_persisted_channel_LDKPersist_jcall, .free = LDKPersist_JCalls_free, }; return ret; @@ -12323,15 +14850,15 @@ uint64_t CS_LDK_LDKPersist_new(int32_t o) { *res_ptr = LDKPersist_init(o); return tag_ptr(res_ptr, true); } -int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_id, int64_t data, int64_t update_id) { +int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_funding_outpoint, int64_t data, int64_t update_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; - LDKOutPoint channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = OutPoint_clone(&channel_id_conv); + LDKOutPoint channel_funding_outpoint_conv; + channel_funding_outpoint_conv.inner = untag_ptr(channel_funding_outpoint); + channel_funding_outpoint_conv.is_owned = ptr_is_owned(channel_funding_outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_conv); + channel_funding_outpoint_conv = OutPoint_clone(&channel_funding_outpoint_conv); LDKChannelMonitor data_conv; data_conv.inner = untag_ptr(data); data_conv.is_owned = ptr_is_owned(data); @@ -12342,19 +14869,19 @@ int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_id update_id_conv.is_owned = ptr_is_owned(update_id); CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv)); + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, &data_conv, update_id_conv)); return ret_conv; } -int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_t update_id) { +int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t channel_funding_outpoint, int64_t update, int64_t data, int64_t update_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; - LDKOutPoint channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = OutPoint_clone(&channel_id_conv); + LDKOutPoint channel_funding_outpoint_conv; + channel_funding_outpoint_conv.inner = untag_ptr(channel_funding_outpoint); + channel_funding_outpoint_conv.is_owned = ptr_is_owned(channel_funding_outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_conv); + channel_funding_outpoint_conv = OutPoint_clone(&channel_funding_outpoint_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = untag_ptr(update); update_conv.is_owned = ptr_is_owned(update); @@ -12370,50 +14897,20 @@ int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t chann update_id_conv.is_owned = ptr_is_owned(update_id); CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, update_conv, &data_conv, update_id_conv)); + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, update_conv, &data_conv, update_id_conv)); return ret_conv; } -typedef struct LDKFutureCallback_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; -} LDKFutureCallback_JCalls; -static void LDKFutureCallback_JCalls_free(void* this_arg) { - LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); - } -} -void call_LDKFutureCallback_jcall(const void* this_arg) { - LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; - js_invoke_function_void_(j_calls->instance_ptr, 62); -} -static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) { - LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKFutureCallback LDKFutureCallback_init (int64_t o) { - LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - - LDKFutureCallback ret = { - .this_arg = (void*) calls, - .call = call_LDKFutureCallback_jcall, - .free = LDKFutureCallback_JCalls_free, - }; - return ret; -} -uint64_t CS_LDK_LDKFutureCallback_new(int32_t o) { - LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback"); - *res_ptr = LDKFutureCallback_init(o); - return tag_ptr(res_ptr, true); -} -void CS_LDK_FutureCallback_call(int64_t this_arg) { +void CS_LDK_Persist_archive_persisted_channel(int64_t this_arg, int64_t channel_funding_outpoint) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKFutureCallback* this_arg_conv = (LDKFutureCallback*)this_arg_ptr; - (this_arg_conv->call)(this_arg_conv->this_arg); + LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; + LDKOutPoint channel_funding_outpoint_conv; + channel_funding_outpoint_conv.inner = untag_ptr(channel_funding_outpoint); + channel_funding_outpoint_conv.is_owned = ptr_is_owned(channel_funding_outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_conv); + channel_funding_outpoint_conv = OutPoint_clone(&channel_funding_outpoint_conv); + (this_arg_conv->archive_persisted_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv); } typedef struct LDKListen_JCalls { @@ -12442,7 +14939,7 @@ void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_ FREE(txdata_var.data); int32_t height_conv = height; - js_invoke_function_void_lli(j_calls->instance_ptr, 63, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); + js_invoke_function_void_lli(j_calls->instance_ptr, 70, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); } void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; @@ -12450,14 +14947,14 @@ void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uin int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__); memcpy(block_arr->elems, block_var.data, block_var.datalen); int32_t height_conv = height; - js_invoke_function_void_li(j_calls->instance_ptr, 64, (int64_t)block_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 71, (int64_t)block_arr, height_conv); } void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; int8_tArray header_arr = init_int8_tArray(80, __LINE__); memcpy(header_arr->elems, *header, 80); int32_t height_conv = height; - js_invoke_function_void_li(j_calls->instance_ptr, 65, (int64_t)header_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 72, (int64_t)header_arr, height_conv); } static void LDKListen_JCalls_cloned(LDKListen* new_obj) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg; @@ -12557,38 +15054,38 @@ void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t FREE(txdata_var.data); int32_t height_conv = height; - js_invoke_function_void_lli(j_calls->instance_ptr, 66, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); + js_invoke_function_void_lli(j_calls->instance_ptr, 73, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); } void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; int8_tArray txid_arr = init_int8_tArray(32, __LINE__); memcpy(txid_arr->elems, *txid, 32); - js_invoke_function_void_l(j_calls->instance_ptr, 67, (int64_t)txid_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 74, (int64_t)txid_arr); } void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; int8_tArray header_arr = init_int8_tArray(80, __LINE__); memcpy(header_arr->elems, *header, 80); int32_t height_conv = height; - js_invoke_function_void_li(j_calls->instance_ptr, 68, (int64_t)header_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 75, (int64_t)header_arr, height_conv); } -LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { +LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 69); - LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ ret_constr; + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 76); + LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ), "LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ Elements"); else ret_constr.data = NULL; int64_t* ret_vals = ret->elems; - for (size_t x = 0; x < ret_constr.datalen; x++) { - int64_t ret_conv_49 = ret_vals[x]; - void* ret_conv_49_ptr = untag_ptr(ret_conv_49); - CHECK_ACCESS(ret_conv_49_ptr); - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ ret_conv_49_conv = *(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ*)(ret_conv_49_ptr); - FREE(untag_ptr(ret_conv_49)); - ret_constr.data[x] = ret_conv_49_conv; + for (size_t c = 0; c < ret_constr.datalen; c++) { + int64_t ret_conv_54 = ret_vals[c]; + void* ret_conv_54_ptr = untag_ptr(ret_conv_54); + CHECK_ACCESS(ret_conv_54_ptr); + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ ret_conv_54_conv = *(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ*)(ret_conv_54_ptr); + FREE(untag_ptr(ret_conv_54)); + ret_constr.data[c] = ret_conv_54_conv; } FREE(ret); return ret_constr; @@ -12670,20 +15167,82 @@ int64_tArray CS_LDK_Confirm_get_relevant_txids(int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; - LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg); + LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ), "LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + 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; } +uint32_t CS_LDK_LDKSpendingDelay_ty_from_ptr(int64_t ptr) { + LDKSpendingDelay *obj = (LDKSpendingDelay*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSpendingDelay_Relative: return 0; + case LDKSpendingDelay_Absolute: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKSpendingDelay_Relative_get_num_blocks(int64_t ptr) { + LDKSpendingDelay *obj = (LDKSpendingDelay*)untag_ptr(ptr); + CHECK(obj->tag == LDKSpendingDelay_Relative); + int32_t num_blocks_conv = obj->relative.num_blocks; + return num_blocks_conv; +} +int32_t CS_LDK_LDKSpendingDelay_Absolute_get_height(int64_t ptr) { + LDKSpendingDelay *obj = (LDKSpendingDelay*)untag_ptr(ptr); + CHECK(obj->tag == LDKSpendingDelay_Absolute); + int32_t height_conv = obj->absolute.height; + return height_conv; +} +typedef struct LDKFutureCallback_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKFutureCallback_JCalls; +static void LDKFutureCallback_JCalls_free(void* this_arg) { + LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +void call_LDKFutureCallback_jcall(const void* this_arg) { + LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; + js_invoke_function_void_(j_calls->instance_ptr, 77); +} +static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) { + LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKFutureCallback LDKFutureCallback_init (int64_t o) { + LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKFutureCallback ret = { + .this_arg = (void*) calls, + .call = call_LDKFutureCallback_jcall, + .free = LDKFutureCallback_JCalls_free, + }; + return ret; +} +uint64_t CS_LDK_LDKFutureCallback_new(int32_t o) { + LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback"); + *res_ptr = LDKFutureCallback_init(o); + return tag_ptr(res_ptr, true); +} +void CS_LDK_FutureCallback_call(int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKFutureCallback* this_arg_conv = (LDKFutureCallback*)this_arg_ptr; + (this_arg_conv->call)(this_arg_conv->this_arg); +} + typedef struct LDKEventHandler_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -12699,7 +15258,7 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { LDKEvent *event_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *event_copy = event; int64_t event_ref = tag_ptr(event_copy, true); - js_invoke_function_void_l(j_calls->instance_ptr, 70, event_ref); + js_invoke_function_void_l(j_calls->instance_ptr, 78, event_ref); } static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; @@ -12747,7 +15306,7 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *handler_ret = handler; - js_invoke_function_void_l(j_calls->instance_ptr, 71, tag_ptr(handler_ret, true)); + js_invoke_function_void_l(j_calls->instance_ptr, 79, tag_ptr(handler_ret, true)); } static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) { LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg; @@ -12812,7 +15371,7 @@ static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) { } LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) { LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 72); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 80); LDKCVec_MessageSendEventZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -12891,7 +15450,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD msg_var = OpenChannel_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 73, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 81, (int64_t)their_node_id_arr, msg_ref); } void handle_open_channel_v2_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKOpenChannelV2 * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -12902,7 +15461,7 @@ void handle_open_channel_v2_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = OpenChannelV2_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 74, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 82, (int64_t)their_node_id_arr, msg_ref); } void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAcceptChannel * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -12913,7 +15472,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = AcceptChannel_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 75, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 83, (int64_t)their_node_id_arr, msg_ref); } void handle_accept_channel_v2_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAcceptChannelV2 * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -12924,7 +15483,7 @@ void handle_accept_channel_v2_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = AcceptChannelV2_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 76, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 84, (int64_t)their_node_id_arr, msg_ref); } void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -12935,7 +15494,7 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingCreated_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 77, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 85, (int64_t)their_node_id_arr, msg_ref); } void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -12946,7 +15505,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingSigned_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 78, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 86, (int64_t)their_node_id_arr, msg_ref); } void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -12957,7 +15516,7 @@ void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, L msg_var = ChannelReady_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 79, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 87, (int64_t)their_node_id_arr, msg_ref); } void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -12968,7 +15527,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub msg_var = Shutdown_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 80, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 88, (int64_t)their_node_id_arr, msg_ref); } void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -12979,7 +15538,18 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ClosingSigned_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 81, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 89, (int64_t)their_node_id_arr, msg_ref); +} +void handle_stfu_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKStfu * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); + LDKStfu msg_var = *msg; + int64_t msg_ref = 0; + msg_var = Stfu_clone(&msg_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); + msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); + js_invoke_function_void_ll(j_calls->instance_ptr, 90, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_add_input_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAddInput * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -12990,7 +15560,7 @@ void handle_tx_add_input_LDKChannelMessageHandler_jcall(const void* this_arg, LD msg_var = TxAddInput_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 82, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 91, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_add_output_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAddOutput * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13001,7 +15571,7 @@ void handle_tx_add_output_LDKChannelMessageHandler_jcall(const void* this_arg, L msg_var = TxAddOutput_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 83, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 92, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_remove_input_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxRemoveInput * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13012,7 +15582,7 @@ void handle_tx_remove_input_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = TxRemoveInput_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 84, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 93, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_remove_output_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxRemoveOutput * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13023,7 +15593,7 @@ void handle_tx_remove_output_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = TxRemoveOutput_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 85, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 94, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_complete_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxComplete * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13034,7 +15604,7 @@ void handle_tx_complete_LDKChannelMessageHandler_jcall(const void* this_arg, LDK msg_var = TxComplete_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 86, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 95, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxSignatures * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13045,7 +15615,7 @@ void handle_tx_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, L msg_var = TxSignatures_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 87, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 96, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_init_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxInitRbf * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13056,7 +15626,7 @@ void handle_tx_init_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDK msg_var = TxInitRbf_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 88, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 97, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_ack_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAckRbf * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13067,7 +15637,7 @@ void handle_tx_ack_rbf_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = TxAckRbf_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 89, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 98, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_abort_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAbort * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13078,7 +15648,7 @@ void handle_tx_abort_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub msg_var = TxAbort_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 90, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 99, (int64_t)their_node_id_arr, msg_ref); } void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13089,7 +15659,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = UpdateAddHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 91, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 100, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13100,7 +15670,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ msg_var = UpdateFulfillHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 92, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 101, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13111,7 +15681,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = UpdateFailHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 93, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 102, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13122,7 +15692,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void msg_var = UpdateFailMalformedHTLC_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 94, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 103, (int64_t)their_node_id_arr, msg_ref); } void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13133,7 +15703,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = CommitmentSigned_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 95, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 104, (int64_t)their_node_id_arr, msg_ref); } void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13144,7 +15714,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = RevokeAndACK_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 96, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 105, (int64_t)their_node_id_arr, msg_ref); } void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13155,7 +15725,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = UpdateFee_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 97, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 106, (int64_t)their_node_id_arr, msg_ref); } void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13166,13 +15736,13 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t msg_var = AnnouncementSignatures_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 98, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 107, (int64_t)their_node_id_arr, msg_ref); } void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - js_invoke_function_void_l(j_calls->instance_ptr, 99, (int64_t)their_node_id_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 108, (int64_t)their_node_id_arr); } LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg, bool inbound) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13184,7 +15754,7 @@ LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* t CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); jboolean inbound_conv = inbound; - uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 100, (int64_t)their_node_id_arr, msg_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 109, (int64_t)their_node_id_arr, msg_ref, inbound_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); @@ -13200,7 +15770,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ msg_var = ChannelReestablish_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 101, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 110, (int64_t)their_node_id_arr, msg_ref); } void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13211,7 +15781,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ChannelUpdate_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 102, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 111, (int64_t)their_node_id_arr, msg_ref); } void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13222,11 +15792,11 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic msg_var = ErrorMessage_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 103, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 112, (int64_t)their_node_id_arr, msg_ref); } LDKNodeFeatures provided_node_features_LDKChannelMessageHandler_jcall(const void* this_arg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 104); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 113); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -13237,7 +15807,7 @@ LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 105, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 114, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -13246,7 +15816,7 @@ LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void } LDKCOption_CVec_ThirtyTwoBytesZZ get_chain_hashes_LDKChannelMessageHandler_jcall(const void* this_arg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 106); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 115); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_CVec_ThirtyTwoBytesZZ ret_conv = *(LDKCOption_CVec_ThirtyTwoBytesZZ*)(ret_ptr); @@ -13274,6 +15844,7 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (int64_t o, .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall, .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall, .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall, + .handle_stfu = handle_stfu_LDKChannelMessageHandler_jcall, .handle_tx_add_input = handle_tx_add_input_LDKChannelMessageHandler_jcall, .handle_tx_add_output = handle_tx_add_output_LDKChannelMessageHandler_jcall, .handle_tx_remove_input = handle_tx_remove_input_LDKChannelMessageHandler_jcall, @@ -13445,6 +16016,21 @@ void CS_LDK_ChannelMessageHandler_handle_closing_signed(int64_t this_arg, int8_ (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } +void CS_LDK_ChannelMessageHandler_handle_stfu(int64_t this_arg, int8_tArray their_node_id, int64_t msg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; + LDKPublicKey their_node_id_ref; + CHECK(their_node_id->arr_len == 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); + LDKStfu msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv.is_owned = false; + (this_arg_conv->handle_stfu)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +} + void CS_LDK_ChannelMessageHandler_handle_tx_add_input(int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -13822,7 +16408,7 @@ LDKCOption_OffersMessageZ handle_message_LDKOffersMessageHandler_jcall(const voi LDKOffersMessage *message_copy = MALLOC(sizeof(LDKOffersMessage), "LDKOffersMessage"); *message_copy = message; int64_t message_ref = tag_ptr(message_copy, true); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 107, message_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 116, message_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_OffersMessageZ ret_conv = *(LDKCOption_OffersMessageZ*)(ret_ptr); @@ -13831,7 +16417,7 @@ LDKCOption_OffersMessageZ handle_message_LDKOffersMessageHandler_jcall(const voi } LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ release_pending_messages_LDKOffersMessageHandler_jcall(const void* this_arg) { LDKOffersMessageHandler_JCalls *j_calls = (LDKOffersMessageHandler_JCalls*) this_arg; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 108); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 117); LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -13904,6 +16490,55 @@ int64_tArray CS_LDK_OffersMessageHandler_release_pending_messages(int64_t this_ return ret_arr; } +typedef struct LDKNodeIdLookUp_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKNodeIdLookUp_JCalls; +static void LDKNodeIdLookUp_JCalls_free(void* this_arg) { + LDKNodeIdLookUp_JCalls *j_calls = (LDKNodeIdLookUp_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKPublicKey next_node_id_LDKNodeIdLookUp_jcall(const void* this_arg, uint64_t short_channel_id) { + LDKNodeIdLookUp_JCalls *j_calls = (LDKNodeIdLookUp_JCalls*) this_arg; + int64_t short_channel_id_conv = short_channel_id; + int8_tArray ret = (int8_tArray)js_invoke_function_l_l(j_calls->instance_ptr, 118, short_channel_id_conv); + LDKPublicKey ret_ref; + CHECK(ret->arr_len == 33); + memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret); + return ret_ref; +} +static void LDKNodeIdLookUp_JCalls_cloned(LDKNodeIdLookUp* new_obj) { + LDKNodeIdLookUp_JCalls *j_calls = (LDKNodeIdLookUp_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKNodeIdLookUp LDKNodeIdLookUp_init (int64_t o) { + LDKNodeIdLookUp_JCalls *calls = MALLOC(sizeof(LDKNodeIdLookUp_JCalls), "LDKNodeIdLookUp_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKNodeIdLookUp ret = { + .this_arg = (void*) calls, + .next_node_id = next_node_id_LDKNodeIdLookUp_jcall, + .free = LDKNodeIdLookUp_JCalls_free, + }; + return ret; +} +uint64_t CS_LDK_LDKNodeIdLookUp_new(int32_t o) { + LDKNodeIdLookUp *res_ptr = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *res_ptr = LDKNodeIdLookUp_init(o); + return tag_ptr(res_ptr, true); +} +int8_tArray CS_LDK_NodeIdLookUp_next_node_id(int64_t this_arg, int64_t short_channel_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKNodeIdLookUp* this_arg_conv = (LDKNodeIdLookUp*)this_arg_ptr; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, (this_arg_conv->next_node_id)(this_arg_conv->this_arg, short_channel_id).compressed_form, 33); + return ret_arr; +} + typedef struct LDKRoutingMessageHandler_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -13922,7 +16557,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler msg_var = NodeAnnouncement_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 109, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 119, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -13936,7 +16571,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand msg_var = ChannelAnnouncement_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 110, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 120, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -13950,7 +16585,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc msg_var = ChannelUpdate_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 111, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 121, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -13960,7 +16595,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; int64_t starting_point_conv = starting_point; - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 112, starting_point_conv); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 122, starting_point_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr); @@ -13973,7 +16608,7 @@ LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(co int64_t starting_point_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(starting_point_var); starting_point_ref = tag_ptr(starting_point_var.inner, starting_point_var.is_owned); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 113, starting_point_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 123, starting_point_ref); LDKNodeAnnouncement ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -13990,7 +16625,7 @@ LDKCResult_NoneNoneZ peer_connected_LDKRoutingMessageHandler_jcall(const void* t CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); init_ref = tag_ptr(init_var.inner, init_var.is_owned); jboolean inbound_conv = inbound; - uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 114, (int64_t)their_node_id_arr, init_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 124, (int64_t)their_node_id_arr, init_ref, inbound_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); @@ -14005,7 +16640,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl int64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 115, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 125, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -14020,7 +16655,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess int64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 116, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 126, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -14035,7 +16670,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl int64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 117, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 127, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -14050,7 +16685,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH int64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 118, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 128, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -14059,11 +16694,11 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH } bool processing_queue_high_LDKRoutingMessageHandler_jcall(const void* this_arg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - return js_invoke_function_b_(j_calls->instance_ptr, 119); + return js_invoke_function_b_(j_calls->instance_ptr, 129); } LDKNodeFeatures provided_node_features_LDKRoutingMessageHandler_jcall(const void* this_arg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 120); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 130); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -14074,7 +16709,7 @@ LDKInitFeatures provided_init_features_LDKRoutingMessageHandler_jcall(const void LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 121, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 131, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -14313,6 +16948,27 @@ static void LDKOnionMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } +LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ get_and_clear_connections_needed_LDKOnionMessageHandler_jcall(const void* this_arg) { + LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 132); + LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_constr; + ret_constr.datalen = ret->arr_len; + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ Elements"); + else + ret_constr.data = NULL; + int64_t* ret_vals = ret->elems; + for (size_t o = 0; o < ret_constr.datalen; o++) { + int64_t ret_conv_40 = ret_vals[o]; + void* ret_conv_40_ptr = untag_ptr(ret_conv_40); + CHECK_ACCESS(ret_conv_40_ptr); + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ ret_conv_40_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(ret_conv_40_ptr); + FREE(untag_ptr(ret_conv_40)); + ret_constr.data[o] = ret_conv_40_conv; + } + FREE(ret); + return ret_constr; +} void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__); @@ -14322,13 +16978,13 @@ void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDK msg_var = OnionMessage_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_void_ll(j_calls->instance_ptr, 122, (int64_t)peer_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 133, (int64_t)peer_node_id_arr, msg_ref); } LDKOnionMessage next_onion_message_for_peer_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(peer_node_id_arr->elems, peer_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 123, (int64_t)peer_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 134, (int64_t)peer_node_id_arr); LDKOnionMessage ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -14345,7 +17001,7 @@ LDKCResult_NoneNoneZ peer_connected_LDKOnionMessageHandler_jcall(const void* thi CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); init_ref = tag_ptr(init_var.inner, init_var.is_owned); jboolean inbound_conv = inbound; - uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 124, (int64_t)their_node_id_arr, init_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 135, (int64_t)their_node_id_arr, init_ref, inbound_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); @@ -14356,11 +17012,15 @@ void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPub LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - js_invoke_function_void_l(j_calls->instance_ptr, 125, (int64_t)their_node_id_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 136, (int64_t)their_node_id_arr); +} +void timer_tick_occurred_LDKOnionMessageHandler_jcall(const void* this_arg) { + LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; + js_invoke_function_void_(j_calls->instance_ptr, 137); } LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 126); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 138); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -14371,7 +17031,7 @@ LDKInitFeatures provided_init_features_LDKOnionMessageHandler_jcall(const void* LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 127, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 139, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -14389,10 +17049,12 @@ static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (int64_t o) { LDKOnionMessageHandler ret = { .this_arg = (void*) calls, + .get_and_clear_connections_needed = get_and_clear_connections_needed_LDKOnionMessageHandler_jcall, .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall, .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageHandler_jcall, .peer_connected = peer_connected_LDKOnionMessageHandler_jcall, .peer_disconnected = peer_disconnected_LDKOnionMessageHandler_jcall, + .timer_tick_occurred = timer_tick_occurred_LDKOnionMessageHandler_jcall, .provided_node_features = provided_node_features_LDKOnionMessageHandler_jcall, .provided_init_features = provided_init_features_LDKOnionMessageHandler_jcall, .free = LDKOnionMessageHandler_JCalls_free, @@ -14404,6 +17066,24 @@ uint64_t CS_LDK_LDKOnionMessageHandler_new(int32_t o) { *res_ptr = LDKOnionMessageHandler_init(o); return tag_ptr(res_ptr, true); } +int64_tArray CS_LDK_OnionMessageHandler_get_and_clear_connections_needed(int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr; + LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_var = (this_arg_conv->get_and_clear_connections_needed)(this_arg_conv->this_arg); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t o = 0; o < ret_var.datalen; o++) { + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); + *ret_conv_40_conv = ret_var.data[o]; + ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true); + } + + FREE(ret_var.data); + return ret_arr; +} + void CS_LDK_OnionMessageHandler_handle_onion_message(int64_t this_arg, int8_tArray peer_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -14460,6 +17140,13 @@ void CS_LDK_OnionMessageHandler_peer_disconnected(int64_t this_arg, int8_tArray (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref); } +void CS_LDK_OnionMessageHandler_timer_tick_occurred(int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr; + (this_arg_conv->timer_tick_occurred)(this_arg_conv->this_arg); +} + int64_t CS_LDK_OnionMessageHandler_provided_node_features(int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -14501,7 +17188,7 @@ LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const voi LDKu8slice buffer_var = buffer; int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__); memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen); - uint64_t ret = js_invoke_function_l_sl(j_calls->instance_ptr, 128, message_type_conv, (int64_t)buffer_arr); + uint64_t ret = js_invoke_function_l_sl(j_calls->instance_ptr, 140, message_type_conv, (int64_t)buffer_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); @@ -14559,7 +17246,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca *msg_ret = msg; int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 129, tag_ptr(msg_ret, true), (int64_t)sender_node_id_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 141, tag_ptr(msg_ret, true), (int64_t)sender_node_id_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -14568,7 +17255,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca } LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) { LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 130); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 142); LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -14589,7 +17276,7 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle } LDKNodeFeatures provided_node_features_LDKCustomMessageHandler_jcall(const void* this_arg) { LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 131); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 143); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -14600,7 +17287,7 @@ LDKInitFeatures provided_init_features_LDKCustomMessageHandler_jcall(const void* LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 132, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 144, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -14710,7 +17397,7 @@ LDKCOption_OnionMessageContentsZ handle_custom_message_LDKCustomOnionMessageHand LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; LDKOnionMessageContents* msg_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); *msg_ret = msg; - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 133, tag_ptr(msg_ret, true)); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 145, tag_ptr(msg_ret, true)); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_OnionMessageContentsZ ret_conv = *(LDKCOption_OnionMessageContentsZ*)(ret_ptr); @@ -14723,7 +17410,7 @@ LDKCResult_COption_OnionMessageContentsZDecodeErrorZ read_custom_message_LDKCust LDKu8slice buffer_var = buffer; int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__); memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 134, message_type_conv, (int64_t)buffer_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 146, message_type_conv, (int64_t)buffer_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_COption_OnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_OnionMessageContentsZDecodeErrorZ*)(ret_ptr); @@ -14732,7 +17419,7 @@ LDKCResult_COption_OnionMessageContentsZDecodeErrorZ read_custom_message_LDKCust } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ release_pending_custom_messages_LDKCustomOnionMessageHandler_jcall(const void* this_arg) { LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 135); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 147); LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -14838,21 +17525,21 @@ uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, b int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__); memcpy(data_arr->elems, data_var.data, data_var.datalen); jboolean resume_read_conv = resume_read; - return js_invoke_function_l_lb(j_calls->instance_ptr, 136, (int64_t)data_arr, resume_read_conv); + return js_invoke_function_l_lb(j_calls->instance_ptr, 148, (int64_t)data_arr, resume_read_conv); } void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - js_invoke_function_void_(j_calls->instance_ptr, 137); + js_invoke_function_void_(j_calls->instance_ptr, 149); } bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *other_arg_clone = SocketDescriptor_clone(other_arg); - return js_invoke_function_b_l(j_calls->instance_ptr, 138, tag_ptr(other_arg_clone, true)); + return js_invoke_function_b_l(j_calls->instance_ptr, 150, tag_ptr(other_arg_clone, true)); } uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - return js_invoke_function_l_(j_calls->instance_ptr, 139); + return js_invoke_function_l_(j_calls->instance_ptr, 151); } static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg; @@ -14906,6 +17593,138 @@ int64_t CS_LDK_SocketDescriptor_hash(int64_t this_arg) { return ret_conv; } +typedef struct LDKSignBolt12InvoiceFn_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKSignBolt12InvoiceFn_JCalls; +static void LDKSignBolt12InvoiceFn_JCalls_free(void* this_arg) { + LDKSignBolt12InvoiceFn_JCalls *j_calls = (LDKSignBolt12InvoiceFn_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCResult_SchnorrSignatureNoneZ sign_invoice_LDKSignBolt12InvoiceFn_jcall(const void* this_arg, const LDKUnsignedBolt12Invoice * message) { + LDKSignBolt12InvoiceFn_JCalls *j_calls = (LDKSignBolt12InvoiceFn_JCalls*) this_arg; + LDKUnsignedBolt12Invoice message_var = *message; + int64_t message_ref = 0; + message_var = UnsignedBolt12Invoice_clone(&message_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 152, message_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +static void LDKSignBolt12InvoiceFn_JCalls_cloned(LDKSignBolt12InvoiceFn* new_obj) { + LDKSignBolt12InvoiceFn_JCalls *j_calls = (LDKSignBolt12InvoiceFn_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKSignBolt12InvoiceFn LDKSignBolt12InvoiceFn_init (int64_t o) { + LDKSignBolt12InvoiceFn_JCalls *calls = MALLOC(sizeof(LDKSignBolt12InvoiceFn_JCalls), "LDKSignBolt12InvoiceFn_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKSignBolt12InvoiceFn ret = { + .this_arg = (void*) calls, + .sign_invoice = sign_invoice_LDKSignBolt12InvoiceFn_jcall, + .free = LDKSignBolt12InvoiceFn_JCalls_free, + }; + return ret; +} +uint64_t CS_LDK_LDKSignBolt12InvoiceFn_new(int32_t o) { + LDKSignBolt12InvoiceFn *res_ptr = MALLOC(sizeof(LDKSignBolt12InvoiceFn), "LDKSignBolt12InvoiceFn"); + *res_ptr = LDKSignBolt12InvoiceFn_init(o); + return tag_ptr(res_ptr, true); +} +int64_t CS_LDK_SignBolt12InvoiceFn_sign_invoice(int64_t this_arg, int64_t message) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKSignBolt12InvoiceFn* this_arg_conv = (LDKSignBolt12InvoiceFn*)this_arg_ptr; + LDKUnsignedBolt12Invoice message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv.is_owned = false; + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, &message_conv); + return tag_ptr(ret_conv, true); +} + +typedef struct LDKSignInvoiceRequestFn_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKSignInvoiceRequestFn_JCalls; +static void LDKSignInvoiceRequestFn_JCalls_free(void* this_arg) { + LDKSignInvoiceRequestFn_JCalls *j_calls = (LDKSignInvoiceRequestFn_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCResult_SchnorrSignatureNoneZ sign_invoice_request_LDKSignInvoiceRequestFn_jcall(const void* this_arg, const LDKUnsignedInvoiceRequest * message) { + LDKSignInvoiceRequestFn_JCalls *j_calls = (LDKSignInvoiceRequestFn_JCalls*) this_arg; + LDKUnsignedInvoiceRequest message_var = *message; + int64_t message_ref = 0; + message_var = UnsignedInvoiceRequest_clone(&message_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 153, message_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +static void LDKSignInvoiceRequestFn_JCalls_cloned(LDKSignInvoiceRequestFn* new_obj) { + LDKSignInvoiceRequestFn_JCalls *j_calls = (LDKSignInvoiceRequestFn_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKSignInvoiceRequestFn LDKSignInvoiceRequestFn_init (int64_t o) { + LDKSignInvoiceRequestFn_JCalls *calls = MALLOC(sizeof(LDKSignInvoiceRequestFn_JCalls), "LDKSignInvoiceRequestFn_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKSignInvoiceRequestFn ret = { + .this_arg = (void*) calls, + .sign_invoice_request = sign_invoice_request_LDKSignInvoiceRequestFn_jcall, + .free = LDKSignInvoiceRequestFn_JCalls_free, + }; + return ret; +} +uint64_t CS_LDK_LDKSignInvoiceRequestFn_new(int32_t o) { + LDKSignInvoiceRequestFn *res_ptr = MALLOC(sizeof(LDKSignInvoiceRequestFn), "LDKSignInvoiceRequestFn"); + *res_ptr = LDKSignInvoiceRequestFn_init(o); + return tag_ptr(res_ptr, true); +} +int64_t CS_LDK_SignInvoiceRequestFn_sign_invoice_request(int64_t this_arg, int64_t message) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKSignInvoiceRequestFn* this_arg_conv = (LDKSignInvoiceRequestFn*)this_arg_ptr; + LDKUnsignedInvoiceRequest message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv.is_owned = false; + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_invoice_request)(this_arg_conv->this_arg, &message_conv); + return tag_ptr(ret_conv, true); +} + +uint32_t CS_LDK_LDKSignError_ty_from_ptr(int64_t ptr) { + LDKSignError *obj = (LDKSignError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSignError_Signing: return 0; + case LDKSignError_Verification: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKSignError_Verification_get_verification(int64_t ptr) { + LDKSignError *obj = (LDKSignError*)untag_ptr(ptr); + CHECK(obj->tag == LDKSignError_Verification); + int32_t verification_conv = LDKSecp256k1Error_to_cs(obj->verification); + return verification_conv; +} uint32_t CS_LDK_LDKEffectiveCapacity_ty_from_ptr(int64_t ptr) { LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr); switch(obj->tag) { @@ -15034,7 +17853,7 @@ static void LDKScore_JCalls_free(void* this_arg) { } LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) { LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; - int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 140); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 154); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -15079,93 +17898,33 @@ int8_tArray CS_LDK_Score_write(int64_t this_arg) { return ret_arr; } -typedef struct LDKMessageRouter_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; -} LDKMessageRouter_JCalls; -static void LDKMessageRouter_JCalls_free(void* this_arg) { - LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); - } -} -LDKCResult_OnionMessagePathNoneZ find_path_LDKMessageRouter_jcall(const void* this_arg, LDKPublicKey sender, LDKCVec_PublicKeyZ peers, LDKDestination destination) { - LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) this_arg; - int8_tArray sender_arr = init_int8_tArray(33, __LINE__); - memcpy(sender_arr->elems, sender.compressed_form, 33); - LDKCVec_PublicKeyZ peers_var = peers; - ptrArray peers_arr = NULL; - peers_arr = init_ptrArray(peers_var.datalen, __LINE__); - int8_tArray *peers_arr_ptr = (int8_tArray*)(((uint8_t*)peers_arr) + 8); - for (size_t i = 0; i < peers_var.datalen; i++) { - int8_tArray peers_conv_8_arr = init_int8_tArray(33, __LINE__); - memcpy(peers_conv_8_arr->elems, peers_var.data[i].compressed_form, 33); - peers_arr_ptr[i] = peers_conv_8_arr; +uint32_t CS_LDK_LDKIntroductionNode_ty_from_ptr(int64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + switch(obj->tag) { + case LDKIntroductionNode_NodeId: return 0; + case LDKIntroductionNode_DirectedShortChannelId: return 1; + default: abort(); } - - FREE(peers_var.data); - LDKDestination *destination_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *destination_copy = destination; - int64_t destination_ref = tag_ptr(destination_copy, true); - uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 141, (int64_t)sender_arr, (int64_t)peers_arr, destination_ref); - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_OnionMessagePathNoneZ ret_conv = *(LDKCResult_OnionMessagePathNoneZ*)(ret_ptr); - FREE(untag_ptr(ret)); - return ret_conv; } -static void LDKMessageRouter_JCalls_cloned(LDKMessageRouter* new_obj) { - LDKMessageRouter_JCalls *j_calls = (LDKMessageRouter_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +int8_tArray CS_LDK_LDKIntroductionNode_NodeId_get_node_id(int64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + CHECK(obj->tag == LDKIntroductionNode_NodeId); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(node_id_arr->elems, obj->node_id.compressed_form, 33); + return node_id_arr; } -static inline LDKMessageRouter LDKMessageRouter_init (int64_t o) { - LDKMessageRouter_JCalls *calls = MALLOC(sizeof(LDKMessageRouter_JCalls), "LDKMessageRouter_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - - LDKMessageRouter ret = { - .this_arg = (void*) calls, - .find_path = find_path_LDKMessageRouter_jcall, - .free = LDKMessageRouter_JCalls_free, - }; - return ret; +int32_t CS_LDK_LDKIntroductionNode_DirectedShortChannelId_get__0(int64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + CHECK(obj->tag == LDKIntroductionNode_DirectedShortChannelId); + int32_t _0_conv = LDKDirection_to_cs(obj->directed_short_channel_id._0); + return _0_conv; } -uint64_t CS_LDK_LDKMessageRouter_new(int32_t o) { - LDKMessageRouter *res_ptr = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); - *res_ptr = LDKMessageRouter_init(o); - return tag_ptr(res_ptr, true); +int64_t CS_LDK_LDKIntroductionNode_DirectedShortChannelId_get__1(int64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + CHECK(obj->tag == LDKIntroductionNode_DirectedShortChannelId); + int64_t _1_conv = obj->directed_short_channel_id._1; + return _1_conv; } -int64_t CS_LDK_MessageRouter_find_path(int64_t this_arg, int8_tArray sender, ptrArray peers, int64_t destination) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKMessageRouter* this_arg_conv = (LDKMessageRouter*)this_arg_ptr; - LDKPublicKey sender_ref; - CHECK(sender->arr_len == 33); - memcpy(sender_ref.compressed_form, sender->elems, 33); FREE(sender); - LDKCVec_PublicKeyZ peers_constr; - peers_constr.datalen = peers->arr_len; - if (peers_constr.datalen > 0) - peers_constr.data = MALLOC(peers_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - peers_constr.data = NULL; - int8_tArray* peers_vals = (void*) peers->elems; - for (size_t i = 0; i < peers_constr.datalen; i++) { - int8_tArray peers_conv_8 = peers_vals[i]; - LDKPublicKey peers_conv_8_ref; - CHECK(peers_conv_8->arr_len == 33); - memcpy(peers_conv_8_ref.compressed_form, peers_conv_8->elems, 33); FREE(peers_conv_8); - peers_constr.data[i] = peers_conv_8_ref; - } - FREE(peers); - void* destination_ptr = untag_ptr(destination); - CHECK_ACCESS(destination_ptr); - LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); - destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = (this_arg_conv->find_path)(this_arg_conv->this_arg, sender_ref, peers_constr, destination_conv); - return tag_ptr(ret_conv, true); -} - typedef struct LDKCoinSelectionSource_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -15205,20 +17964,20 @@ LDKCResult_CoinSelectionNoneZ select_confirmed_utxos_LDKCoinSelectionSource_jcal FREE(must_pay_to_var.data); int32_t target_feerate_sat_per_1000_weight_conv = target_feerate_sat_per_1000_weight; - uint64_t ret = js_invoke_function_l_llli(j_calls->instance_ptr, 142, (int64_t)claim_id_arr, (int64_t)must_spend_arr, (int64_t)must_pay_to_arr, target_feerate_sat_per_1000_weight_conv); + uint64_t ret = js_invoke_function_l_llli(j_calls->instance_ptr, 155, (int64_t)claim_id_arr, (int64_t)must_spend_arr, (int64_t)must_pay_to_arr, target_feerate_sat_per_1000_weight_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CoinSelectionNoneZ ret_conv = *(LDKCResult_CoinSelectionNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_TransactionNoneZ sign_tx_LDKCoinSelectionSource_jcall(const void* this_arg, LDKTransaction tx) { +LDKCResult_TransactionNoneZ sign_psbt_LDKCoinSelectionSource_jcall(const void* this_arg, LDKCVec_u8Z psbt) { LDKCoinSelectionSource_JCalls *j_calls = (LDKCoinSelectionSource_JCalls*) this_arg; - LDKTransaction tx_var = tx; - int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__); - memcpy(tx_arr->elems, tx_var.data, tx_var.datalen); - Transaction_free(tx_var); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 143, (int64_t)tx_arr); + LDKCVec_u8Z psbt_var = psbt; + int8_tArray psbt_arr = init_int8_tArray(psbt_var.datalen, __LINE__); + memcpy(psbt_arr->elems, psbt_var.data, psbt_var.datalen); + CVec_u8Z_free(psbt_var); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 156, (int64_t)psbt_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -15237,7 +17996,7 @@ static inline LDKCoinSelectionSource LDKCoinSelectionSource_init (int64_t o) { LDKCoinSelectionSource ret = { .this_arg = (void*) calls, .select_confirmed_utxos = select_confirmed_utxos_LDKCoinSelectionSource_jcall, - .sign_tx = sign_tx_LDKCoinSelectionSource_jcall, + .sign_psbt = sign_psbt_LDKCoinSelectionSource_jcall, .free = LDKCoinSelectionSource_JCalls_free, }; return ret; @@ -15292,17 +18051,16 @@ int64_t CS_LDK_CoinSelectionSource_select_confirmed_utxos(int64_t this_arg, int return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CoinSelectionSource_sign_tx(int64_t this_arg, int8_tArray tx) { +int64_t CS_LDK_CoinSelectionSource_sign_psbt(int64_t this_arg, int8_tArray psbt) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKCoinSelectionSource* this_arg_conv = (LDKCoinSelectionSource*)this_arg_ptr; - 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_u8Z psbt_ref; + psbt_ref.datalen = psbt->arr_len; + psbt_ref.data = MALLOC(psbt_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(psbt_ref.data, psbt->elems, psbt_ref.datalen); FREE(psbt); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = (this_arg_conv->sign_tx)(this_arg_conv->this_arg, tx_ref); + *ret_conv = (this_arg_conv->sign_psbt)(this_arg_conv->this_arg, psbt_ref); return tag_ptr(ret_conv, true); } @@ -15318,7 +18076,7 @@ static void LDKWalletSource_JCalls_free(void* this_arg) { } LDKCResult_CVec_UtxoZNoneZ list_confirmed_utxos_LDKWalletSource_jcall(const void* this_arg) { LDKWalletSource_JCalls *j_calls = (LDKWalletSource_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 144); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 157); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_UtxoZNoneZ ret_conv = *(LDKCResult_CVec_UtxoZNoneZ*)(ret_ptr); @@ -15327,20 +18085,20 @@ LDKCResult_CVec_UtxoZNoneZ list_confirmed_utxos_LDKWalletSource_jcall(const void } LDKCResult_CVec_u8ZNoneZ get_change_script_LDKWalletSource_jcall(const void* this_arg) { LDKWalletSource_JCalls *j_calls = (LDKWalletSource_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 145); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 158); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -LDKCResult_TransactionNoneZ sign_tx_LDKWalletSource_jcall(const void* this_arg, LDKTransaction tx) { +LDKCResult_TransactionNoneZ sign_psbt_LDKWalletSource_jcall(const void* this_arg, LDKCVec_u8Z psbt) { LDKWalletSource_JCalls *j_calls = (LDKWalletSource_JCalls*) this_arg; - LDKTransaction tx_var = tx; - int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__); - memcpy(tx_arr->elems, tx_var.data, tx_var.datalen); - Transaction_free(tx_var); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 146, (int64_t)tx_arr); + LDKCVec_u8Z psbt_var = psbt; + int8_tArray psbt_arr = init_int8_tArray(psbt_var.datalen, __LINE__); + memcpy(psbt_arr->elems, psbt_var.data, psbt_var.datalen); + CVec_u8Z_free(psbt_var); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 159, (int64_t)psbt_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -15360,7 +18118,7 @@ static inline LDKWalletSource LDKWalletSource_init (int64_t o) { .this_arg = (void*) calls, .list_confirmed_utxos = list_confirmed_utxos_LDKWalletSource_jcall, .get_change_script = get_change_script_LDKWalletSource_jcall, - .sign_tx = sign_tx_LDKWalletSource_jcall, + .sign_psbt = sign_psbt_LDKWalletSource_jcall, .free = LDKWalletSource_JCalls_free, }; return ret; @@ -15388,17 +18146,16 @@ int64_t CS_LDK_WalletSource_get_change_script(int64_t this_arg) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_WalletSource_sign_tx(int64_t this_arg, int8_tArray tx) { +int64_t CS_LDK_WalletSource_sign_psbt(int64_t this_arg, int8_tArray psbt) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKWalletSource* this_arg_conv = (LDKWalletSource*)this_arg_ptr; - 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_u8Z psbt_ref; + psbt_ref.datalen = psbt->arr_len; + psbt_ref.data = MALLOC(psbt_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(psbt_ref.data, psbt->elems, psbt_ref.datalen); FREE(psbt); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = (this_arg_conv->sign_tx)(this_arg_conv->this_arg, tx_ref); + *ret_conv = (this_arg_conv->sign_psbt)(this_arg_conv->this_arg, psbt_ref); return tag_ptr(ret_conv, true); } @@ -15498,6 +18255,58 @@ int8_tArray CS_LDK_U128_new(int8_tArray le_bytes) { return ret_arr; } +int64_t CS_LDK_WitnessProgram_new(int8_t version, int8_tArray program) { + + LDKCVec_u8Z program_ref; + program_ref.datalen = program->arr_len; + program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(program_ref.data, program->elems, program_ref.datalen); FREE(program); + LDKWitnessProgram* ret_ref = MALLOC(sizeof(LDKWitnessProgram), "LDKWitnessProgram"); + *ret_ref = WitnessProgram_new((LDKWitnessVersion){ ._0 = version }, program_ref); + return tag_ptr(ret_ref, true); +} + +int8_t CS_LDK_WitnessProgram_get_version(int64_t prog) { + LDKWitnessProgram* prog_conv = (LDKWitnessProgram*)untag_ptr(prog); + uint8_t ret_val = WitnessProgram_get_version(prog_conv)._0; + return ret_val; +} + +int8_tArray CS_LDK_WitnessProgram_get_program(int64_t prog) { + LDKWitnessProgram* prog_conv = (LDKWitnessProgram*)untag_ptr(prog); + LDKu8slice ret_var = WitnessProgram_get_program(prog_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; +} + +static inline uint64_t WitnessProgram_clone_ptr(LDKWitnessProgram *NONNULL_PTR arg) { + LDKWitnessProgram* ret_ref = MALLOC(sizeof(LDKWitnessProgram), "LDKWitnessProgram"); + *ret_ref = WitnessProgram_clone(arg); + return tag_ptr(ret_ref, true); +} +int64_t CS_LDK_WitnessProgram_clone_ptr(int64_t arg) { + LDKWitnessProgram* arg_conv = (LDKWitnessProgram*)untag_ptr(arg); + int64_t ret_conv = WitnessProgram_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_WitnessProgram_clone(int64_t orig) { + LDKWitnessProgram* orig_conv = (LDKWitnessProgram*)untag_ptr(orig); + LDKWitnessProgram* ret_ref = MALLOC(sizeof(LDKWitnessProgram), "LDKWitnessProgram"); + *ret_ref = WitnessProgram_clone(orig_conv); + return tag_ptr(ret_ref, true); +} + +void CS_LDK_WitnessProgram_free(int64_t o) { + if (!ptr_is_owned(o)) return; + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKWitnessProgram o_conv = *(LDKWitnessProgram*)(o_ptr); + FREE(untag_ptr(o)); + WitnessProgram_free(o_conv); +} + int64_t CS_LDK_BigEndianScalar_new(int8_tArray big_endian_bytes) { LDKThirtyTwoBytes big_endian_bytes_ref; CHECK(big_endian_bytes->arr_len == 32); @@ -15507,6 +18316,24 @@ int64_t CS_LDK_BigEndianScalar_new(int8_tArray big_endian_bytes) { return tag_ptr(ret_ref, true); } +static inline uint64_t BigEndianScalar_clone_ptr(LDKBigEndianScalar *NONNULL_PTR arg) { + LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar"); + *ret_ref = BigEndianScalar_clone(arg); + return tag_ptr(ret_ref, true); +} +int64_t CS_LDK_BigEndianScalar_clone_ptr(int64_t arg) { + LDKBigEndianScalar* arg_conv = (LDKBigEndianScalar*)untag_ptr(arg); + int64_t ret_conv = BigEndianScalar_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_BigEndianScalar_clone(int64_t orig) { + LDKBigEndianScalar* orig_conv = (LDKBigEndianScalar*)untag_ptr(orig); + LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar"); + *ret_ref = BigEndianScalar_clone(orig_conv); + return tag_ptr(ret_ref, true); +} + static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) { LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error"); *ret_copy = Bech32Error_clone(arg); @@ -15554,15 +18381,6 @@ void CS_LDK_Witness_free(int8_tArray _res) { Witness_free(_res_ref); } -void CS_LDK_TxIn_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKTxIn _res_conv = *(LDKTxIn*)(_res_ptr); - FREE(untag_ptr(_res)); - TxIn_free(_res_conv); -} - int64_t CS_LDK_TxIn_new(int8_tArray witness, int8_tArray script_sig, int32_t sequence, int8_tArray previous_txid, int32_t previous_vout) { LDKWitness witness_ref; witness_ref.datalen = witness->arr_len; @@ -15581,6 +18399,51 @@ int64_t CS_LDK_TxIn_new(int8_tArray witness, int8_tArray script_sig, int32_t se return tag_ptr(ret_ref, true); } +int8_tArray CS_LDK_TxIn_get_witness(int64_t txin) { + LDKTxIn* txin_conv = (LDKTxIn*)untag_ptr(txin); + LDKWitness ret_var = TxIn_get_witness(txin_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Witness_free(ret_var); + return ret_arr; +} + +int8_tArray CS_LDK_TxIn_get_script_sig(int64_t txin) { + LDKTxIn* txin_conv = (LDKTxIn*)untag_ptr(txin); + LDKu8slice ret_var = TxIn_get_script_sig(txin_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; +} + +int32_t CS_LDK_TxIn_get_sequence(int64_t txin) { + LDKTxIn* txin_conv = (LDKTxIn*)untag_ptr(txin); + int32_t ret_conv = TxIn_get_sequence(txin_conv); + return ret_conv; +} + +int8_tArray CS_LDK_TxIn_get_previous_txid(int64_t txin) { + LDKTxIn* txin_conv = (LDKTxIn*)untag_ptr(txin); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, TxIn_get_previous_txid(txin_conv).data, 32); + return ret_arr; +} + +int32_t CS_LDK_TxIn_get_previous_vout(int64_t txin) { + LDKTxIn* txin_conv = (LDKTxIn*)untag_ptr(txin); + int32_t ret_conv = TxIn_get_previous_vout(txin_conv); + return ret_conv; +} + +void CS_LDK_TxIn_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKTxIn _res_conv = *(LDKTxIn*)(_res_ptr); + FREE(untag_ptr(_res)); + TxIn_free(_res_conv); +} + int64_t CS_LDK_TxOut_new(int8_tArray script_pubkey, int64_t value) { LDKCVec_u8Z script_pubkey_ref; script_pubkey_ref.datalen = script_pubkey->arr_len; @@ -15591,6 +18454,20 @@ int64_t CS_LDK_TxOut_new(int8_tArray script_pubkey, int64_t value) { return tag_ptr(ret_ref, true); } +int8_tArray CS_LDK_TxOut_get_script_pubkey(int64_t txout) { + LDKTxOut* txout_conv = (LDKTxOut*)untag_ptr(txout); + LDKu8slice ret_var = TxOut_get_script_pubkey(txout_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; +} + +int64_t CS_LDK_TxOut_get_value(int64_t txout) { + LDKTxOut* txout_conv = (LDKTxOut*)untag_ptr(txout); + int64_t ret_conv = TxOut_get_value(txout_conv); + return ret_conv; +} + void CS_LDK_TxOut_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); @@ -15623,6 +18500,116 @@ void CS_LDK_Str_free(jstring _res) { Str_free(dummy); } +void CS_LDK_CVec_u8Z_free(int8_tArray _res) { + LDKCVec_u8Z _res_ref; + _res_ref.datalen = _res->arr_len; + _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res); + CVec_u8Z_free(_res_ref); +} + +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(int64_t o) { + LDKRefundMaybeWithDerivedMetadataBuilder o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&o_conv); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* arg_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(int64_t orig) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* orig_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_ok(int64_t o) { + LDKRefund o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Refund_clone(&o_conv); + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_RefundBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_RefundBolt12SemanticErrorZ* o_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_RefundBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RefundBolt12SemanticErrorZ _res_conv = *(LDKCResult_RefundBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RefundBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RefundBolt12SemanticErrorZ_clone_ptr(LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RefundBolt12SemanticErrorZ* arg_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_clone(int64_t orig) { + LDKCResult_RefundBolt12SemanticErrorZ* orig_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_COption_u64Z_some(int64_t o) { LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_some(o); @@ -15929,14 +18916,6 @@ int64_t CS_LDK_COption_ThirtyTwoBytesZ_clone(int64_t orig) { return ret_ref; } -void CS_LDK_CVec_u8Z_free(int8_tArray _res) { - LDKCVec_u8Z _res_ref; - _res_ref.datalen = _res->arr_len; - _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res); - CVec_u8Z_free(_res_ref); -} - int64_t CS_LDK_COption_CVec_u8ZZ_some(int8_tArray o) { LDKCVec_u8Z o_ref; o_ref.datalen = o->arr_len; @@ -16145,6 +19124,156 @@ int64_t CS_LDK_CResult_RecipientOnionFieldsNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(int64_t o) { + LDKUnsignedBolt12Invoice o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = UnsignedBolt12Invoice_clone(&o_conv); + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* o_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ _res_conv = *(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* arg_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(int64_t orig) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* orig_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(int64_t o) { + LDKBolt12Invoice o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Bolt12Invoice_clone(&o_conv); + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* o_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ _res_conv = *(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(int64_t orig) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* orig_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_ok(int8_tArray o) { + LDKSchnorrSignature o_ref; + CHECK(o->arr_len == 64); + memcpy(o_ref.compact_form, o->elems, 64); FREE(o); + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = CResult_SchnorrSignatureNoneZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_err() { + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = CResult_SchnorrSignatureNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_SchnorrSignatureNoneZ_is_ok(int64_t o) { + LDKCResult_SchnorrSignatureNoneZ* o_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_SchnorrSignatureNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_SchnorrSignatureNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_SchnorrSignatureNoneZ _res_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_SchnorrSignatureNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_SchnorrSignatureNoneZ_clone_ptr(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = CResult_SchnorrSignatureNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_clone_ptr(int64_t arg) { + LDKCResult_SchnorrSignatureNoneZ* arg_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SchnorrSignatureNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_clone(int64_t orig) { + LDKCResult_SchnorrSignatureNoneZ* orig_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(orig); + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = CResult_SchnorrSignatureNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + void CS_LDK_CVec_ThirtyTwoBytesZ_free(ptrArray _res) { LDKCVec_ThirtyTwoBytesZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -16222,6 +19351,100 @@ int64_t CS_LDK_COption_CVec_ThirtyTwoBytesZZ_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_COption_AmountZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKAmount o_conv = *(LDKAmount*)(o_ptr); + o_conv = Amount_clone((LDKAmount*)untag_ptr(o)); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = COption_AmountZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_AmountZ_none() { + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = COption_AmountZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_AmountZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_AmountZ _res_conv = *(LDKCOption_AmountZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_AmountZ_free(_res_conv); +} + +static inline uint64_t COption_AmountZ_clone_ptr(LDKCOption_AmountZ *NONNULL_PTR arg) { + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = COption_AmountZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_AmountZ_clone_ptr(int64_t arg) { + LDKCOption_AmountZ* arg_conv = (LDKCOption_AmountZ*)untag_ptr(arg); + int64_t ret_conv = COption_AmountZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_AmountZ_clone(int64_t orig) { + LDKCOption_AmountZ* orig_conv = (LDKCOption_AmountZ*)untag_ptr(orig); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = COption_AmountZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_QuantityZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKQuantity o_conv = *(LDKQuantity*)(o_ptr); + o_conv = Quantity_clone((LDKQuantity*)untag_ptr(o)); + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = COption_QuantityZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_QuantityZ_none() { + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = COption_QuantityZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_QuantityZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_QuantityZ _res_conv = *(LDKCOption_QuantityZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_QuantityZ_free(_res_conv); +} + +static inline uint64_t COption_QuantityZ_clone_ptr(LDKCOption_QuantityZ *NONNULL_PTR arg) { + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = COption_QuantityZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_QuantityZ_clone_ptr(int64_t arg) { + LDKCOption_QuantityZ* arg_conv = (LDKCOption_QuantityZ*)untag_ptr(arg); + int64_t ret_conv = COption_QuantityZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_QuantityZ_clone(int64_t orig) { + LDKCOption_QuantityZ* orig_conv = (LDKCOption_QuantityZ*)untag_ptr(orig); + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = COption_QuantityZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_CResult_ThirtyTwoBytesNoneZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); @@ -16568,89 +19791,89 @@ int64_t CS_LDK_COption_u32Z_clone(int64_t orig) { return ret_ref; } -static inline uint64_t C2Tuple_CVec_u8ZusizeZ_clone_ptr(LDKC2Tuple_CVec_u8ZusizeZ *NONNULL_PTR arg) { - LDKC2Tuple_CVec_u8ZusizeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_u8ZusizeZ), "LDKC2Tuple_CVec_u8ZusizeZ"); - *ret_conv = C2Tuple_CVec_u8ZusizeZ_clone(arg); +static inline uint64_t C2Tuple_CVec_u8Zu64Z_clone_ptr(LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR arg) { + LDKC2Tuple_CVec_u8Zu64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_u8Zu64Z), "LDKC2Tuple_CVec_u8Zu64Z"); + *ret_conv = C2Tuple_CVec_u8Zu64Z_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_CVec_u8ZusizeZ_clone_ptr(int64_t arg) { - LDKC2Tuple_CVec_u8ZusizeZ* arg_conv = (LDKC2Tuple_CVec_u8ZusizeZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_CVec_u8ZusizeZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_CVec_u8Zu64Z_clone_ptr(int64_t arg) { + LDKC2Tuple_CVec_u8Zu64Z* arg_conv = (LDKC2Tuple_CVec_u8Zu64Z*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_CVec_u8Zu64Z_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple_CVec_u8ZusizeZ_clone(int64_t orig) { - LDKC2Tuple_CVec_u8ZusizeZ* orig_conv = (LDKC2Tuple_CVec_u8ZusizeZ*)untag_ptr(orig); - LDKC2Tuple_CVec_u8ZusizeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_u8ZusizeZ), "LDKC2Tuple_CVec_u8ZusizeZ"); - *ret_conv = C2Tuple_CVec_u8ZusizeZ_clone(orig_conv); +int64_t CS_LDK_C2Tuple_CVec_u8Zu64Z_clone(int64_t orig) { + LDKC2Tuple_CVec_u8Zu64Z* orig_conv = (LDKC2Tuple_CVec_u8Zu64Z*)untag_ptr(orig); + LDKC2Tuple_CVec_u8Zu64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_u8Zu64Z), "LDKC2Tuple_CVec_u8Zu64Z"); + *ret_conv = C2Tuple_CVec_u8Zu64Z_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_CVec_u8ZusizeZ_new(int8_tArray a, int64_t b) { +int64_t CS_LDK_C2Tuple_CVec_u8Zu64Z_new(int8_tArray a, int64_t b) { LDKCVec_u8Z a_ref; a_ref.datalen = a->arr_len; a_ref.data = MALLOC(a_ref.datalen, "LDKCVec_u8Z Bytes"); memcpy(a_ref.data, a->elems, a_ref.datalen); FREE(a); - LDKC2Tuple_CVec_u8ZusizeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_u8ZusizeZ), "LDKC2Tuple_CVec_u8ZusizeZ"); - *ret_conv = C2Tuple_CVec_u8ZusizeZ_new(a_ref, b); + LDKC2Tuple_CVec_u8Zu64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_CVec_u8Zu64Z), "LDKC2Tuple_CVec_u8Zu64Z"); + *ret_conv = C2Tuple_CVec_u8Zu64Z_new(a_ref, b); return tag_ptr(ret_conv, true); } -void CS_LDK_C2Tuple_CVec_u8ZusizeZ_free(int64_t _res) { +void CS_LDK_C2Tuple_CVec_u8Zu64Z_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_CVec_u8ZusizeZ _res_conv = *(LDKC2Tuple_CVec_u8ZusizeZ*)(_res_ptr); + LDKC2Tuple_CVec_u8Zu64Z _res_conv = *(LDKC2Tuple_CVec_u8Zu64Z*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_CVec_u8ZusizeZ_free(_res_conv); + C2Tuple_CVec_u8Zu64Z_free(_res_conv); } -int64_t CS_LDK_CResult_C2Tuple_CVec_u8ZusizeZNoneZ_ok(int64_t o) { +int64_t CS_LDK_CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKC2Tuple_CVec_u8ZusizeZ o_conv = *(LDKC2Tuple_CVec_u8ZusizeZ*)(o_ptr); - o_conv = C2Tuple_CVec_u8ZusizeZ_clone((LDKC2Tuple_CVec_u8ZusizeZ*)untag_ptr(o)); - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ), "LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ"); - *ret_conv = CResult_C2Tuple_CVec_u8ZusizeZNoneZ_ok(o_conv); + LDKC2Tuple_CVec_u8Zu64Z o_conv = *(LDKC2Tuple_CVec_u8Zu64Z*)(o_ptr); + o_conv = C2Tuple_CVec_u8Zu64Z_clone((LDKC2Tuple_CVec_u8Zu64Z*)untag_ptr(o)); + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); + *ret_conv = CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_C2Tuple_CVec_u8ZusizeZNoneZ_err() { - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ), "LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ"); - *ret_conv = CResult_C2Tuple_CVec_u8ZusizeZNoneZ_err(); +int64_t CS_LDK_CResult_C2Tuple_CVec_u8Zu64ZNoneZ_err() { + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); + *ret_conv = CResult_C2Tuple_CVec_u8Zu64ZNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_C2Tuple_CVec_u8ZusizeZNoneZ_is_ok(int64_t o) { - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ* o_conv = (LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_CVec_u8ZusizeZNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_C2Tuple_CVec_u8Zu64ZNoneZ_is_ok(int64_t o) { + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* o_conv = (LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_CVec_u8Zu64ZNoneZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C2Tuple_CVec_u8ZusizeZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_C2Tuple_CVec_u8Zu64ZNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ _res_conv = *(LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ*)(_res_ptr); + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ _res_conv = *(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_CVec_u8ZusizeZNoneZ_free(_res_conv); + CResult_C2Tuple_CVec_u8Zu64ZNoneZ_free(_res_conv); } -static inline uint64_t CResult_C2Tuple_CVec_u8ZusizeZNoneZ_clone_ptr(LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ), "LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ"); - *ret_conv = CResult_C2Tuple_CVec_u8ZusizeZNoneZ_clone(arg); +static inline uint64_t CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone_ptr(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); + *ret_conv = CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_C2Tuple_CVec_u8ZusizeZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ* arg_conv = (LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C2Tuple_CVec_u8ZusizeZNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* arg_conv = (LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_C2Tuple_CVec_u8ZusizeZNoneZ_clone(int64_t orig) { - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ* orig_conv = (LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ*)untag_ptr(orig); - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ), "LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ"); - *ret_conv = CResult_C2Tuple_CVec_u8ZusizeZNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(int64_t orig) { + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* orig_conv = (LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ*)untag_ptr(orig); + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); + *ret_conv = CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -16807,173 +20030,6 @@ int64_t CS_LDK_CResult_NoneNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -void CS_LDK_CVec_ECDSASignatureZ_free(ptrArray _res) { - LDKCVec_ECDSASignatureZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKECDSASignature), "LDKCVec_ECDSASignatureZ 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]; - LDKECDSASignature _res_conv_8_ref; - CHECK(_res_conv_8->arr_len == 64); - memcpy(_res_conv_8_ref.compact_form, _res_conv_8->elems, 64); FREE(_res_conv_8); - _res_constr.data[i] = _res_conv_8_ref; - } - FREE(_res); - CVec_ECDSASignatureZ_free(_res_constr); -} - -static inline uint64_t C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone_ptr(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR arg) { - LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ), "LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ"); - *ret_conv = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone_ptr(int64_t arg) { - LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* arg_conv = (LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(int64_t orig) { - LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* orig_conv = (LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)untag_ptr(orig); - LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ), "LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ"); - *ret_conv = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(int8_tArray a, ptrArray b) { - LDKECDSASignature a_ref; - CHECK(a->arr_len == 64); - memcpy(a_ref.compact_form, a->elems, 64); FREE(a); - LDKCVec_ECDSASignatureZ b_constr; - b_constr.datalen = b->arr_len; - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKECDSASignature), "LDKCVec_ECDSASignatureZ Elements"); - else - b_constr.data = NULL; - int8_tArray* b_vals = (void*) b->elems; - for (size_t i = 0; i < b_constr.datalen; i++) { - int8_tArray b_conv_8 = b_vals[i]; - LDKECDSASignature b_conv_8_ref; - CHECK(b_conv_8->arr_len == 64); - memcpy(b_conv_8_ref.compact_form, b_conv_8->elems, 64); FREE(b_conv_8); - b_constr.data[i] = b_conv_8_ref; - } - FREE(b); - LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ), "LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ"); - *ret_conv = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(a_ref, b_constr); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res_conv = *(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(_res_conv); -} - -int64_t CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o_conv = *(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)(o_ptr); - o_conv = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone((LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)untag_ptr(o)); - LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ), "LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err() { - LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ), "LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(int64_t o) { - LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ), "LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(int64_t orig) { - LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)untag_ptr(orig); - LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ), "LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ECDSASignatureNoneZ_ok(int8_tArray o) { - LDKECDSASignature o_ref; - CHECK(o->arr_len == 64); - memcpy(o_ref.compact_form, o->elems, 64); FREE(o); - LDKCResult_ECDSASignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ECDSASignatureNoneZ), "LDKCResult_ECDSASignatureNoneZ"); - *ret_conv = CResult_ECDSASignatureNoneZ_ok(o_ref); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_ECDSASignatureNoneZ_err() { - LDKCResult_ECDSASignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ECDSASignatureNoneZ), "LDKCResult_ECDSASignatureNoneZ"); - *ret_conv = CResult_ECDSASignatureNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_ECDSASignatureNoneZ_is_ok(int64_t o) { - LDKCResult_ECDSASignatureNoneZ* o_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_ECDSASignatureNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_ECDSASignatureNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ECDSASignatureNoneZ _res_conv = *(LDKCResult_ECDSASignatureNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ECDSASignatureNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_ECDSASignatureNoneZ_clone_ptr(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR arg) { - LDKCResult_ECDSASignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ECDSASignatureNoneZ), "LDKCResult_ECDSASignatureNoneZ"); - *ret_conv = CResult_ECDSASignatureNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_ECDSASignatureNoneZ_clone_ptr(int64_t arg) { - LDKCResult_ECDSASignatureNoneZ* arg_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ECDSASignatureNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_ECDSASignatureNoneZ_clone(int64_t orig) { - LDKCResult_ECDSASignatureNoneZ* orig_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(orig); - LDKCResult_ECDSASignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ECDSASignatureNoneZ), "LDKCResult_ECDSASignatureNoneZ"); - *ret_conv = CResult_ECDSASignatureNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_CResult_PublicKeyNoneZ_ok(int8_tArray o) { LDKPublicKey o_ref; CHECK(o->arr_len == 33); @@ -17026,7 +20082,7 @@ int64_t CS_LDK_COption_BigEndianScalarZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); LDKBigEndianScalar o_conv = *(LDKBigEndianScalar*)(o_ptr); - // WARNING: we may need a move here but no clone is available for LDKBigEndianScalar + o_conv = BigEndianScalar_clone((LDKBigEndianScalar*)untag_ptr(o)); LDKCOption_BigEndianScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_BigEndianScalarZ), "LDKCOption_BigEndianScalarZ"); *ret_copy = COption_BigEndianScalarZ_some(o_conv); int64_t ret_ref = tag_ptr(ret_copy, true); @@ -17134,51 +20190,101 @@ int64_t CS_LDK_CResult_RecoverableSignatureNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_ok(int8_tArray o) { - LDKSchnorrSignature o_ref; +int64_t CS_LDK_CResult_ECDSASignatureNoneZ_ok(int8_tArray o) { + LDKECDSASignature o_ref; CHECK(o->arr_len == 64); memcpy(o_ref.compact_form, o->elems, 64); FREE(o); - LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); - *ret_conv = CResult_SchnorrSignatureNoneZ_ok(o_ref); + LDKCResult_ECDSASignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ECDSASignatureNoneZ), "LDKCResult_ECDSASignatureNoneZ"); + *ret_conv = CResult_ECDSASignatureNoneZ_ok(o_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_err() { - LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); - *ret_conv = CResult_SchnorrSignatureNoneZ_err(); +int64_t CS_LDK_CResult_ECDSASignatureNoneZ_err() { + LDKCResult_ECDSASignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ECDSASignatureNoneZ), "LDKCResult_ECDSASignatureNoneZ"); + *ret_conv = CResult_ECDSASignatureNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_SchnorrSignatureNoneZ_is_ok(int64_t o) { - LDKCResult_SchnorrSignatureNoneZ* o_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_SchnorrSignatureNoneZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ECDSASignatureNoneZ_is_ok(int64_t o) { + LDKCResult_ECDSASignatureNoneZ* o_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_ECDSASignatureNoneZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_SchnorrSignatureNoneZ_free(int64_t _res) { +void CS_LDK_CResult_ECDSASignatureNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SchnorrSignatureNoneZ _res_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(_res_ptr); + LDKCResult_ECDSASignatureNoneZ _res_conv = *(LDKCResult_ECDSASignatureNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SchnorrSignatureNoneZ_free(_res_conv); + CResult_ECDSASignatureNoneZ_free(_res_conv); } -static inline uint64_t CResult_SchnorrSignatureNoneZ_clone_ptr(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR arg) { - LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); - *ret_conv = CResult_SchnorrSignatureNoneZ_clone(arg); +static inline uint64_t CResult_ECDSASignatureNoneZ_clone_ptr(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_ECDSASignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ECDSASignatureNoneZ), "LDKCResult_ECDSASignatureNoneZ"); + *ret_conv = CResult_ECDSASignatureNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_clone_ptr(int64_t arg) { - LDKCResult_SchnorrSignatureNoneZ* arg_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SchnorrSignatureNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ECDSASignatureNoneZ_clone_ptr(int64_t arg) { + LDKCResult_ECDSASignatureNoneZ* arg_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ECDSASignatureNoneZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_clone(int64_t orig) { - LDKCResult_SchnorrSignatureNoneZ* orig_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(orig); - LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); - *ret_conv = CResult_SchnorrSignatureNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_ECDSASignatureNoneZ_clone(int64_t orig) { + LDKCResult_ECDSASignatureNoneZ* orig_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(orig); + LDKCResult_ECDSASignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ECDSASignatureNoneZ), "LDKCResult_ECDSASignatureNoneZ"); + *ret_conv = CResult_ECDSASignatureNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_TransactionNoneZ_ok(int8_tArray o) { + LDKTransaction o_ref; + o_ref.datalen = o->arr_len; + o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes"); + memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o); + o_ref.data_is_owned = true; + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_TransactionNoneZ_err() { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_TransactionNoneZ_is_ok(int64_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_TransactionNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TransactionNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_TransactionNoneZ_clone_ptr(int64_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_TransactionNoneZ_clone(int64_t orig) { + LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig); + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -17423,84 +20529,172 @@ int64_t CS_LDK_COption_boolZ_clone(int64_t orig) { return ret_ref; } -void CS_LDK_CVec_CVec_u8ZZ_free(ptrArray _res) { - LDKCVec_CVec_u8ZZ _res_constr; +int64_t CS_LDK_CResult_WitnessNoneZ_ok(int8_tArray o) { + LDKWitness o_ref; + o_ref.datalen = o->arr_len; + o_ref.data = MALLOC(o_ref.datalen, "LDKWitness Bytes"); + memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o); + o_ref.data_is_owned = true; + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = CResult_WitnessNoneZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_WitnessNoneZ_err() { + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = CResult_WitnessNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_WitnessNoneZ_is_ok(int64_t o) { + LDKCResult_WitnessNoneZ* o_conv = (LDKCResult_WitnessNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_WitnessNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_WitnessNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_WitnessNoneZ _res_conv = *(LDKCResult_WitnessNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_WitnessNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_WitnessNoneZ_clone_ptr(LDKCResult_WitnessNoneZ *NONNULL_PTR arg) { + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = CResult_WitnessNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_WitnessNoneZ_clone_ptr(int64_t arg) { + LDKCResult_WitnessNoneZ* arg_conv = (LDKCResult_WitnessNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_WitnessNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_WitnessNoneZ_clone(int64_t orig) { + LDKCResult_WitnessNoneZ* orig_conv = (LDKCResult_WitnessNoneZ*)untag_ptr(orig); + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); + *ret_conv = CResult_WitnessNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_CVec_ECDSASignatureZ_free(ptrArray _res) { + LDKCVec_ECDSASignatureZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKECDSASignature), "LDKCVec_ECDSASignatureZ 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]; - LDKCVec_u8Z _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, "LDKCVec_u8Z Bytes"); - memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); + LDKECDSASignature _res_conv_8_ref; + CHECK(_res_conv_8->arr_len == 64); + memcpy(_res_conv_8_ref.compact_form, _res_conv_8->elems, 64); FREE(_res_conv_8); _res_constr.data[i] = _res_conv_8_ref; } FREE(_res); - CVec_CVec_u8ZZ_free(_res_constr); + CVec_ECDSASignatureZ_free(_res_constr); } -int64_t CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_ok(ptrArray o) { - LDKCVec_CVec_u8ZZ o_constr; - o_constr.datalen = o->arr_len; - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); +static inline uint64_t C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone_ptr(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR arg) { + LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ), "LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ"); + *ret_conv = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone_ptr(int64_t arg) { + LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* arg_conv = (LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(int64_t orig) { + LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* orig_conv = (LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)untag_ptr(orig); + LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ), "LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ"); + *ret_conv = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(int8_tArray a, ptrArray b) { + LDKECDSASignature a_ref; + CHECK(a->arr_len == 64); + memcpy(a_ref.compact_form, a->elems, 64); FREE(a); + LDKCVec_ECDSASignatureZ b_constr; + b_constr.datalen = b->arr_len; + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKECDSASignature), "LDKCVec_ECDSASignatureZ 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]; - LDKCVec_u8Z o_conv_8_ref; - o_conv_8_ref.datalen = o_conv_8->arr_len; - o_conv_8_ref.data = MALLOC(o_conv_8_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(o_conv_8_ref.data, o_conv_8->elems, o_conv_8_ref.datalen); FREE(o_conv_8); - o_constr.data[i] = o_conv_8_ref; + b_constr.data = NULL; + int8_tArray* b_vals = (void*) b->elems; + for (size_t i = 0; i < b_constr.datalen; i++) { + int8_tArray b_conv_8 = b_vals[i]; + LDKECDSASignature b_conv_8_ref; + CHECK(b_conv_8->arr_len == 64); + memcpy(b_conv_8_ref.compact_form, b_conv_8->elems, 64); FREE(b_conv_8); + b_constr.data[i] = b_conv_8_ref; } - FREE(o); - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr); + FREE(b); + LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ), "LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ"); + *ret_conv = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(a_ref, b_constr); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_err() { - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err(); +void CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res_conv = *(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(_res_conv); +} + +int64_t CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o_conv = *(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)(o_ptr); + o_conv = C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone((LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ*)untag_ptr(o)); + LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ), "LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_is_ok(int64_t o) { - LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv); +int64_t CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err() { + LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ), "LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(int64_t o) { + LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr); + LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv); + CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(_res_conv); } -static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); +static inline uint64_t CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ), "LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(int64_t arg) { - LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_CVec_CVec_u8ZZNoneZ_clone(int64_t orig) { - LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv); +int64_t CS_LDK_CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(int64_t orig) { + LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ*)untag_ptr(orig); + LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ), "LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -17558,56 +20752,6 @@ int64_t CS_LDK_CResult_InMemorySignerDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_TransactionNoneZ_ok(int8_tArray o) { - LDKTransaction o_ref; - o_ref.datalen = o->arr_len; - o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes"); - memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o); - o_ref.data_is_owned = true; - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_ok(o_ref); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_TransactionNoneZ_err() { - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_TransactionNoneZ_is_ok(int64_t o) { - LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_TransactionNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TransactionNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_TransactionNoneZ_clone_ptr(int64_t arg) { - LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_TransactionNoneZ_clone(int64_t orig) { - LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_COption_WriteableScoreZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -17759,6 +20903,261 @@ int64_t CS_LDK_CResult_RouteLightningErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +static inline uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); + *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(int64_t arg) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* arg_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone(int64_t orig) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* orig_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(orig); + LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); + *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_new(int64_t a, int64_t b) { + LDKBlindedPayInfo a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = BlindedPayInfo_clone(&a_conv); + LDKBlindedPath b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = BlindedPath_clone(&b_conv); + LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); + *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_BlindedPayInfoBlindedPathZ_free(_res_conv); +} + +void CS_LDK_CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t l = 0; l < _res_constr.datalen; l++) { + int64_t _res_conv_37 = _res_vals[l]; + void* _res_conv_37_ptr = untag_ptr(_res_conv_37); + CHECK_ACCESS(_res_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_conv_37_ptr); + FREE(untag_ptr(_res_conv_37)); + _res_constr.data[l] = _res_conv_37_conv; + } + FREE(_res); + CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(int64_tArray o) { + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o_constr; + o_constr.datalen = o->arr_len; + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + o_constr.data = NULL; + int64_t* o_vals = o->elems; + for (size_t l = 0; l < o_constr.datalen; l++) { + int64_t o_conv_37 = o_vals[l]; + void* o_conv_37_ptr = untag_ptr(o_conv_37); + CHECK_ACCESS(o_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_conv_37_ptr); + o_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o_conv_37)); + o_constr.data[l] = o_conv_37_conv; + } + FREE(o); + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); + *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(o_constr); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err() { + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); + *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(int64_t o) { + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* o_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); + *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(int64_t orig) { + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ), "LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ"); + *ret_conv = CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_CVec_PublicKeyZ_free(ptrArray _res) { + LDKCVec_PublicKeyZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + _res_constr.data = NULL; + int8_tArray* _res_vals = (void*) _res->elems; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int8_tArray _res_conv_8 = _res_vals[i]; + LDKPublicKey _res_conv_8_ref; + CHECK(_res_conv_8->arr_len == 33); + memcpy(_res_conv_8_ref.compressed_form, _res_conv_8->elems, 33); FREE(_res_conv_8); + _res_constr.data[i] = _res_conv_8_ref; + } + FREE(_res); + CVec_PublicKeyZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_OnionMessagePathNoneZ_ok(int64_t o) { + LDKOnionMessagePath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = OnionMessagePath_clone(&o_conv); + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OnionMessagePathNoneZ_err() { + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OnionMessagePathNoneZ_is_ok(int64_t o) { + LDKCResult_OnionMessagePathNoneZ* o_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_OnionMessagePathNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OnionMessagePathNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OnionMessagePathNoneZ _res_conv = *(LDKCResult_OnionMessagePathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OnionMessagePathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_OnionMessagePathNoneZ_clone_ptr(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR arg) { + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_OnionMessagePathNoneZ_clone_ptr(int64_t arg) { + LDKCResult_OnionMessagePathNoneZ* arg_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OnionMessagePathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OnionMessagePathNoneZ_clone(int64_t orig) { + LDKCResult_OnionMessagePathNoneZ* orig_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(orig); + LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); + *ret_conv = CResult_OnionMessagePathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_ok(int64_tArray o) { + LDKCVec_BlindedPathZ o_constr; + o_constr.datalen = o->arr_len; + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements"); + else + o_constr.data = NULL; + int64_t* o_vals = o->elems; + for (size_t n = 0; n < o_constr.datalen; n++) { + int64_t o_conv_13 = o_vals[n]; + LDKBlindedPath o_conv_13_conv; + o_conv_13_conv.inner = untag_ptr(o_conv_13); + o_conv_13_conv.is_owned = ptr_is_owned(o_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv_13_conv); + o_conv_13_conv = BlindedPath_clone(&o_conv_13_conv); + o_constr.data[n] = o_conv_13_conv; + } + FREE(o); + LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPathZNoneZ_ok(o_constr); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_err() { + LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPathZNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_CVec_BlindedPathZNoneZ_is_ok(int64_t o) { + LDKCResult_CVec_BlindedPathZNoneZ* o_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_BlindedPathZNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_CVec_BlindedPathZNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_CVec_BlindedPathZNoneZ _res_conv = *(LDKCResult_CVec_BlindedPathZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CVec_BlindedPathZNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_CVec_BlindedPathZNoneZ_clone_ptr(LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPathZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_CVec_BlindedPathZNoneZ* arg_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_BlindedPathZNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_CVec_BlindedPathZNoneZ_clone(int64_t orig) { + LDKCResult_CVec_BlindedPathZNoneZ* orig_conv = (LDKCResult_CVec_BlindedPathZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_BlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_BlindedPathZNoneZ), "LDKCResult_CVec_BlindedPathZNoneZ"); + *ret_conv = CResult_CVec_BlindedPathZNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_InFlightHtlcsDecodeErrorZ_ok(int64_t o) { LDKInFlightHtlcs o_conv; o_conv.inner = untag_ptr(o); @@ -18159,69 +21558,6 @@ int64_t CS_LDK_CResult_PaymentParametersDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(int64_t arg) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* arg_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_clone(int64_t orig) { - LDKC2Tuple_BlindedPayInfoBlindedPathZ* orig_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(orig); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_new(int64_t a, int64_t b) { - LDKBlindedPayInfo a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = BlindedPayInfo_clone(&a_conv); - LDKBlindedPath b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = BlindedPath_clone(&b_conv); - LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); - *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_new(a_conv, b_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_C2Tuple_BlindedPayInfoBlindedPathZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C2Tuple_BlindedPayInfoBlindedPathZ_free(_res_conv); -} - -void CS_LDK_CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; - for (size_t l = 0; l < _res_constr.datalen; l++) { - int64_t _res_conv_37 = _res_vals[l]; - void* _res_conv_37_ptr = untag_ptr(_res_conv_37); - CHECK_ACCESS(_res_conv_37_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_conv_37_ptr); - FREE(untag_ptr(_res_conv_37)); - _res_constr.data[l] = _res_conv_37_conv; - } - FREE(_res); - CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(_res_constr); -} - void CS_LDK_CVec_RouteHintZ_free(int64_tArray _res) { LDKCVec_RouteHintZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -18370,25 +21706,6 @@ int64_t CS_LDK_CResult_RouteHintHopDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -void CS_LDK_CVec_PublicKeyZ_free(ptrArray _res) { - LDKCVec_PublicKeyZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int8_tArray _res_conv_8 = _res_vals[i]; - LDKPublicKey _res_conv_8_ref; - CHECK(_res_conv_8->arr_len == 33); - memcpy(_res_conv_8_ref.compressed_form, _res_conv_8->elems, 33); FREE(_res_conv_8); - _res_constr.data[i] = _res_conv_8_ref; - } - FREE(_res); - CVec_PublicKeyZ_free(_res_constr); -} - int64_t CS_LDK_CResult_FixedPenaltyScorerDecodeErrorZ_ok(int64_t o) { LDKFixedPenaltyScorer o_conv; o_conv.inner = untag_ptr(o); @@ -18692,6 +22009,60 @@ void CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_free(int64_t _res) { CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv); } +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_ok(int64_t o) { + LDKBestBlock o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BestBlock_clone(&o_conv); + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = CResult_BestBlockDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = CResult_BestBlockDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_BestBlockDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BestBlockDecodeErrorZ* o_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BestBlockDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BestBlockDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BestBlockDecodeErrorZ _res_conv = *(LDKCResult_BestBlockDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BestBlockDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BestBlockDecodeErrorZ_clone_ptr(LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = CResult_BestBlockDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BestBlockDecodeErrorZ* arg_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BestBlockDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BestBlockDecodeErrorZ* orig_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = CResult_BestBlockDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); @@ -18750,64 +22121,64 @@ void CS_LDK_CVec_C2Tuple_usizeTransactionZZ_free(int64_tArray _res) { CVec_C2Tuple_usizeTransactionZZ_free(_res_constr); } -static inline uint64_t C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone_ptr(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *NONNULL_PTR arg) { - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ), "LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone(arg); +static inline uint64_t C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR arg) { + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone_ptr(int64_t arg) { - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ* arg_conv = (LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone_ptr(arg_conv); +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone_ptr(int64_t arg) { + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone(int64_t orig) { - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ* orig_conv = (LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ*)untag_ptr(orig); - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ), "LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone(orig_conv); +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(int64_t orig) { + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* orig_conv = (LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ*)untag_ptr(orig); + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_new(int8_tArray a, int64_t b) { +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_new(int8_tArray a, int32_t b, int64_t c) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); memcpy(a_ref.data, a->elems, 32); FREE(a); - void* b_ptr = untag_ptr(b); - CHECK_ACCESS(b_ptr); - LDKCOption_ThirtyTwoBytesZ b_conv = *(LDKCOption_ThirtyTwoBytesZ*)(b_ptr); - b_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(b)); - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ), "LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_new(a_ref, b_conv); + void* c_ptr = untag_ptr(c); + CHECK_ACCESS(c_ptr); + LDKCOption_ThirtyTwoBytesZ c_conv = *(LDKCOption_ThirtyTwoBytesZ*)(c_ptr); + c_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(c)); + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_new(a_ref, b, c_conv); return tag_ptr(ret_conv, true); } -void CS_LDK_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_free(int64_t _res) { +void CS_LDK_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ _res_conv = *(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ*)(_res_ptr); + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ _res_conv = *(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_free(_res_conv); + C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_free(_res_conv); } -void CS_LDK_CVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ _res_constr; +void CS_LDK_CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(int64_tArray _res) { + LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ), "LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t x = 0; x < _res_constr.datalen; x++) { - int64_t _res_conv_49 = _res_vals[x]; - void* _res_conv_49_ptr = untag_ptr(_res_conv_49); - CHECK_ACCESS(_res_conv_49_ptr); - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ _res_conv_49_conv = *(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ*)(_res_conv_49_ptr); - FREE(untag_ptr(_res_conv_49)); - _res_constr.data[x] = _res_conv_49_conv; + for (size_t c = 0; c < _res_constr.datalen; c++) { + int64_t _res_conv_54 = _res_vals[c]; + void* _res_conv_54_ptr = untag_ptr(_res_conv_54); + CHECK_ACCESS(_res_conv_54_ptr); + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ _res_conv_54_conv = *(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ*)(_res_conv_54_ptr); + FREE(untag_ptr(_res_conv_54)); + _res_constr.data[c] = _res_conv_54_conv; } FREE(_res); - CVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ_free(_res_constr); + CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(_res_constr); } int64_t CS_LDK_CResult_ChannelMonitorUpdateStatusNoneZ_ok(int32_t o) { @@ -18876,81 +22247,86 @@ void CS_LDK_CVec_MonitorEventZ_free(int64_tArray _res) { CVec_MonitorEventZ_free(_res_constr); } -static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); - *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg); +static inline uint64_t C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ"); + *ret_conv = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(int64_t arg) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv); +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(int64_t arg) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg); + int64_t ret_conv = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(int64_t orig) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig); - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); - *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv); +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(int64_t orig) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig); + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ"); + *ret_conv = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(int64_t a, int64_tArray b, int8_tArray c) { +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(int64_t a, int64_t b, int64_tArray c, int8_tArray d) { LDKOutPoint a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); - LDKCVec_MonitorEventZ b_constr; - b_constr.datalen = b->arr_len; - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + LDKChannelId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ChannelId_clone(&b_conv); + LDKCVec_MonitorEventZ c_constr; + c_constr.datalen = c->arr_len; + if (c_constr.datalen > 0) + c_constr.data = MALLOC(c_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); else - b_constr.data = NULL; - int64_t* b_vals = b->elems; - for (size_t o = 0; o < b_constr.datalen; o++) { - int64_t b_conv_14 = b_vals[o]; - void* b_conv_14_ptr = untag_ptr(b_conv_14); - CHECK_ACCESS(b_conv_14_ptr); - LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr); - b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14)); - b_constr.data[o] = b_conv_14_conv; - } - FREE(b); - LDKPublicKey c_ref; - CHECK(c->arr_len == 33); - memcpy(c_ref.compressed_form, c->elems, 33); FREE(c); - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); - *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(int64_t _res) { + c_constr.data = NULL; + int64_t* c_vals = c->elems; + for (size_t o = 0; o < c_constr.datalen; o++) { + int64_t c_conv_14 = c_vals[o]; + void* c_conv_14_ptr = untag_ptr(c_conv_14); + CHECK_ACCESS(c_conv_14_ptr); + LDKMonitorEvent c_conv_14_conv = *(LDKMonitorEvent*)(c_conv_14_ptr); + c_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(c_conv_14)); + c_constr.data[o] = c_conv_14_conv; + } + FREE(c); + LDKPublicKey d_ref; + CHECK(d->arr_len == 33); + memcpy(d_ref.compressed_form, d->elems, 33); FREE(d); + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ"); + *ret_conv = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(a_conv, b_conv, c_constr, d_ref); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr); + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv); + C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(_res_conv); } -void CS_LDK_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(int64_tArray _res) { - LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr; +void CS_LDK_CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(int64_tArray _res) { + LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t x = 0; x < _res_constr.datalen; x++) { - int64_t _res_conv_49 = _res_vals[x]; - void* _res_conv_49_ptr = untag_ptr(_res_conv_49); - CHECK_ACCESS(_res_conv_49_ptr); - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr); - FREE(untag_ptr(_res_conv_49)); - _res_constr.data[x] = _res_conv_49_conv; + for (size_t f = 0; f < _res_constr.datalen; f++) { + int64_t _res_conv_57 = _res_vals[f]; + void* _res_conv_57_ptr = untag_ptr(_res_conv_57); + CHECK_ACCESS(_res_conv_57_ptr); + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res_conv_57_conv = *(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)(_res_conv_57_ptr); + FREE(untag_ptr(_res_conv_57)); + _res_constr.data[f] = _res_conv_57_conv; } FREE(_res); - CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr); + CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(_res_constr); } int64_t CS_LDK_CResult_InitFeaturesDecodeErrorZ_ok(int64_t o) { @@ -19331,6 +22707,225 @@ int64_t CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_ok(int64_t o) { + LDKOfferId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = OfferId_clone(&o_conv); + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = CResult_OfferIdDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = CResult_OfferIdDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OfferIdDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OfferIdDecodeErrorZ* o_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferIdDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferIdDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferIdDecodeErrorZ _res_conv = *(LDKCResult_OfferIdDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferIdDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferIdDecodeErrorZ_clone_ptr(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = CResult_OfferIdDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferIdDecodeErrorZ* arg_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OfferIdDecodeErrorZ* orig_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = CResult_OfferIdDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_ok() { + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = CResult_NoneBolt12SemanticErrorZ_ok(); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = CResult_NoneBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_NoneBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_NoneBolt12SemanticErrorZ* o_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_NoneBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneBolt12SemanticErrorZ _res_conv = *(LDKCResult_NoneBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NoneBolt12SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = CResult_NoneBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_NoneBolt12SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone(int64_t orig) { + LDKCResult_NoneBolt12SemanticErrorZ* orig_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = CResult_NoneBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_ok(int64_t o) { + LDKOffer o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Offer_clone(&o_conv); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OfferBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_OfferBolt12SemanticErrorZ* o_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferBolt12SemanticErrorZ _res_conv = *(LDKCResult_OfferBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferBolt12SemanticErrorZ_clone_ptr(LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferBolt12SemanticErrorZ* arg_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_clone(int64_t orig) { + LDKCResult_OfferBolt12SemanticErrorZ* orig_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(int64_t o) { + LDKInvoiceRequestWithDerivedPayerIdBuilder o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(int64_t o) { + LDKInvoiceRequestWithExplicitPayerIdBuilder o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); +} + int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_ok(int64_t o) { LDKOffer o_conv; o_conv.inner = untag_ptr(o); @@ -19386,55 +22981,6 @@ int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_ok(int8_tArray o) { - LDKPublicKey o_ref; - CHECK(o->arr_len == 33); - memcpy(o_ref.compressed_form, o->elems, 33); FREE(o); - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = CResult_PublicKeySecp256k1ErrorZ_ok(o_ref); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_err(int32_t e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(e); - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = CResult_PublicKeySecp256k1ErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_PublicKeySecp256k1ErrorZ_is_ok(int64_t o) { - LDKCResult_PublicKeySecp256k1ErrorZ* o_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PublicKeySecp256k1ErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_PublicKeySecp256k1ErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_PublicKeySecp256k1ErrorZ _res_conv = *(LDKCResult_PublicKeySecp256k1ErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_PublicKeySecp256k1ErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_PublicKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR arg) { - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PublicKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone(int64_t orig) { - LDKCResult_PublicKeySecp256k1ErrorZ* orig_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(orig); - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_CResult_NodeIdDecodeErrorZ_ok(int64_t o) { LDKNodeId o_conv; o_conv.inner = untag_ptr(o); @@ -19489,6 +23035,55 @@ int64_t CS_LDK_CResult_NodeIdDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_ok(int8_tArray o) { + LDKPublicKey o_ref; + CHECK(o->arr_len == 33); + memcpy(o_ref.compressed_form, o->elems, 33); FREE(o); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = CResult_PublicKeySecp256k1ErrorZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_err(int32_t e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(e); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = CResult_PublicKeySecp256k1ErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_PublicKeySecp256k1ErrorZ_is_ok(int64_t o) { + LDKCResult_PublicKeySecp256k1ErrorZ* o_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PublicKeySecp256k1ErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_PublicKeySecp256k1ErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_PublicKeySecp256k1ErrorZ _res_conv = *(LDKCResult_PublicKeySecp256k1ErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_PublicKeySecp256k1ErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_PublicKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR arg) { + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PublicKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone(int64_t orig) { + LDKCResult_PublicKeySecp256k1ErrorZ* orig_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(orig); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_COption_NetworkUpdateZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -20274,6 +23869,89 @@ int64_t CS_LDK_COption_CVec_SocketAddressZZ_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_CResult_u64ShortChannelIdErrorZ_ok(int64_t o) { + LDKCResult_u64ShortChannelIdErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u64ShortChannelIdErrorZ), "LDKCResult_u64ShortChannelIdErrorZ"); + *ret_conv = CResult_u64ShortChannelIdErrorZ_ok(o); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_u64ShortChannelIdErrorZ_err(int32_t e) { + LDKShortChannelIdError e_conv = LDKShortChannelIdError_from_cs(e); + LDKCResult_u64ShortChannelIdErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u64ShortChannelIdErrorZ), "LDKCResult_u64ShortChannelIdErrorZ"); + *ret_conv = CResult_u64ShortChannelIdErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_u64ShortChannelIdErrorZ_is_ok(int64_t o) { + LDKCResult_u64ShortChannelIdErrorZ* o_conv = (LDKCResult_u64ShortChannelIdErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_u64ShortChannelIdErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_u64ShortChannelIdErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_u64ShortChannelIdErrorZ _res_conv = *(LDKCResult_u64ShortChannelIdErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_u64ShortChannelIdErrorZ_free(_res_conv); +} + +int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_ok(int64_t o) { + LDKPendingHTLCInfo o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PendingHTLCInfo_clone(&o_conv); + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); + *ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_err(int64_t e) { + LDKInboundHTLCErr 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 = InboundHTLCErr_clone(&e_conv); + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); + *ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(int64_t o) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* o_conv = (LDKCResult_PendingHTLCInfoInboundHTLCErrZ*)untag_ptr(o); + jboolean ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_PendingHTLCInfoInboundHTLCErrZ _res_conv = *(LDKCResult_PendingHTLCInfoInboundHTLCErrZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_PendingHTLCInfoInboundHTLCErrZ_free(_res_conv); +} + +static inline uint64_t CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR arg) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); + *ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(int64_t arg) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* arg_conv = (LDKCResult_PendingHTLCInfoInboundHTLCErrZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_clone(int64_t orig) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* orig_conv = (LDKCResult_PendingHTLCInfoInboundHTLCErrZ*)untag_ptr(orig); + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); + *ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + void CS_LDK_CVec_HTLCOutputInCommitmentZ_free(int64_tArray _res) { LDKCVec_HTLCOutputInCommitmentZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -20513,6 +24191,53 @@ int64_t CS_LDK_CResult_CVec_UtxoZNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_COption_PaymentContextZ_some(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPaymentContext o_conv = *(LDKPaymentContext*)(o_ptr); + o_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(o)); + LDKCOption_PaymentContextZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentContextZ), "LDKCOption_PaymentContextZ"); + *ret_copy = COption_PaymentContextZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_PaymentContextZ_none() { + LDKCOption_PaymentContextZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentContextZ), "LDKCOption_PaymentContextZ"); + *ret_copy = COption_PaymentContextZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_PaymentContextZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_PaymentContextZ _res_conv = *(LDKCOption_PaymentContextZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_PaymentContextZ_free(_res_conv); +} + +static inline uint64_t COption_PaymentContextZ_clone_ptr(LDKCOption_PaymentContextZ *NONNULL_PTR arg) { + LDKCOption_PaymentContextZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentContextZ), "LDKCOption_PaymentContextZ"); + *ret_copy = COption_PaymentContextZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_PaymentContextZ_clone_ptr(int64_t arg) { + LDKCOption_PaymentContextZ* arg_conv = (LDKCOption_PaymentContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_PaymentContextZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_PaymentContextZ_clone(int64_t orig) { + LDKCOption_PaymentContextZ* orig_conv = (LDKCOption_PaymentContextZ*)untag_ptr(orig); + LDKCOption_PaymentContextZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentContextZ), "LDKCOption_PaymentContextZ"); + *ret_copy = COption_PaymentContextZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline uint64_t C2Tuple_u64u16Z_clone_ptr(LDKC2Tuple_u64u16Z *NONNULL_PTR arg) { LDKC2Tuple_u64u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u16Z), "LDKC2Tuple_u64u16Z"); *ret_conv = C2Tuple_u64u16Z_clone(arg); @@ -20593,99 +24318,57 @@ 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_ThirtyTwoBytesAPIErrorZ_ok(int8_tArray o) { - LDKThirtyTwoBytes o_ref; - CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); FREE(o); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_ok(o_ref); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_ok(int64_t o) { + LDKChannelId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelId_clone(&o_conv); + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = CResult_ChannelIdAPIErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); e_conv = APIError_clone((LDKAPIError*)untag_ptr(e)); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_err(e_conv); + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = CResult_ChannelIdAPIErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_is_ok(int64_t o) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* o_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelIdAPIErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelIdAPIErrorZ* o_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelIdAPIErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelIdAPIErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ThirtyTwoBytesAPIErrorZ _res_conv = *(LDKCResult_ThirtyTwoBytesAPIErrorZ*)(_res_ptr); + LDKCResult_ChannelIdAPIErrorZ _res_conv = *(LDKCResult_ChannelIdAPIErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ThirtyTwoBytesAPIErrorZ_free(_res_conv); + CResult_ChannelIdAPIErrorZ_free(_res_conv); } -static inline uint64_t CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR arg) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone(arg); +static inline uint64_t CResult_ChannelIdAPIErrorZ_clone_ptr(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = CResult_ChannelIdAPIErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* arg_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelIdAPIErrorZ* arg_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelIdAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone(int64_t orig) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* orig_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(orig); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_clone(int64_t orig) { + LDKCResult_ChannelIdAPIErrorZ* orig_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(orig); + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = CResult_ChannelIdAPIErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -21082,63 +24765,136 @@ int64_t CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFail return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR arg) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ), "LDKC2Tuple_ThirtyTwoBytesPublicKeyZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(arg); +static inline uint64_t C2Tuple_ChannelIdPublicKeyZ_clone_ptr(LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR arg) { + LDKC2Tuple_ChannelIdPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKC2Tuple_ChannelIdPublicKeyZ"); + *ret_conv = C2Tuple_ChannelIdPublicKeyZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(int64_t arg) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* arg_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_clone_ptr(int64_t arg) { + LDKC2Tuple_ChannelIdPublicKeyZ* arg_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_ChannelIdPublicKeyZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(int64_t orig) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* orig_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(orig); - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ), "LDKC2Tuple_ThirtyTwoBytesPublicKeyZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(orig_conv); +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_clone(int64_t orig) { + LDKC2Tuple_ChannelIdPublicKeyZ* orig_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(orig); + LDKC2Tuple_ChannelIdPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKC2Tuple_ChannelIdPublicKeyZ"); + *ret_conv = C2Tuple_ChannelIdPublicKeyZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_new(int8_tArray a, int8_tArray b) { - LDKThirtyTwoBytes a_ref; - CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); FREE(a); +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_new(int64_t a, int8_tArray b) { + LDKChannelId a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ChannelId_clone(&a_conv); LDKPublicKey b_ref; CHECK(b->arr_len == 33); memcpy(b_ref.compressed_form, b->elems, 33); FREE(b); - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ), "LDKC2Tuple_ThirtyTwoBytesPublicKeyZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_new(a_ref, b_ref); + LDKC2Tuple_ChannelIdPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKC2Tuple_ChannelIdPublicKeyZ"); + *ret_conv = C2Tuple_ChannelIdPublicKeyZ_new(a_conv, b_ref); return tag_ptr(ret_conv, true); } -void CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_free(int64_t _res) { +void CS_LDK_C2Tuple_ChannelIdPublicKeyZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res_conv = *(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)(_res_ptr); + LDKC2Tuple_ChannelIdPublicKeyZ _res_conv = *(LDKC2Tuple_ChannelIdPublicKeyZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_ThirtyTwoBytesPublicKeyZ_free(_res_conv); + C2Tuple_ChannelIdPublicKeyZ_free(_res_conv); } -void CS_LDK_CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res_constr; +void CS_LDK_CVec_C2Tuple_ChannelIdPublicKeyZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_ChannelIdPublicKeyZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ), "LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t j = 0; j < _res_constr.datalen; j++) { - int64_t _res_conv_35 = _res_vals[j]; - void* _res_conv_35_ptr = untag_ptr(_res_conv_35); - CHECK_ACCESS(_res_conv_35_ptr); - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res_conv_35_conv = *(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)(_res_conv_35_ptr); - FREE(untag_ptr(_res_conv_35)); - _res_constr.data[j] = _res_conv_35_conv; + for (size_t e = 0; e < _res_constr.datalen; e++) { + int64_t _res_conv_30 = _res_vals[e]; + void* _res_conv_30_ptr = untag_ptr(_res_conv_30); + CHECK_ACCESS(_res_conv_30_ptr); + LDKC2Tuple_ChannelIdPublicKeyZ _res_conv_30_conv = *(LDKC2Tuple_ChannelIdPublicKeyZ*)(_res_conv_30_ptr); + FREE(untag_ptr(_res_conv_30)); + _res_constr.data[e] = _res_conv_30_conv; + } + FREE(_res); + CVec_C2Tuple_ChannelIdPublicKeyZZ_free(_res_constr); +} + +void CS_LDK_CVec_ChannelIdZ_free(int64_tArray _res) { + LDKCVec_ChannelIdZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t l = 0; l < _res_constr.datalen; l++) { + int64_t _res_conv_11 = _res_vals[l]; + LDKChannelId _res_conv_11_conv; + _res_conv_11_conv.inner = untag_ptr(_res_conv_11); + _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv); + _res_constr.data[l] = _res_conv_11_conv; } FREE(_res); - CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(_res_constr); + CVec_ChannelIdZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(int64_t o) { + LDKOfferWithDerivedMetadataBuilder o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = OfferWithDerivedMetadataBuilder_clone(&o_conv); + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* arg_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(int64_t orig) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* orig_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } int64_t CS_LDK_COption_StrZ_some(jstring o) { @@ -21185,52 +24941,6 @@ int64_t CS_LDK_COption_StrZ_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_ok() { - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = CResult_NoneBolt12SemanticErrorZ_ok(); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_err(int32_t e) { - LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = CResult_NoneBolt12SemanticErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean CS_LDK_CResult_NoneBolt12SemanticErrorZ_is_ok(int64_t o) { - LDKCResult_NoneBolt12SemanticErrorZ* o_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneBolt12SemanticErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_NoneBolt12SemanticErrorZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_NoneBolt12SemanticErrorZ _res_conv = *(LDKCResult_NoneBolt12SemanticErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NoneBolt12SemanticErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_NoneBolt12SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = CResult_NoneBolt12SemanticErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone_ptr(int64_t arg) { - LDKCResult_NoneBolt12SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneBolt12SemanticErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone(int64_t orig) { - LDKCResult_NoneBolt12SemanticErrorZ* orig_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(orig); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = CResult_NoneBolt12SemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -21280,6 +24990,58 @@ int64_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(int64_t return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_ok(int8_tArray o) { + LDKThirtyTwoBytes o_ref; + CHECK(o->arr_len == 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)untag_ptr(e)); + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_is_ok(int64_t o) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* o_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_ThirtyTwoBytesAPIErrorZ _res_conv = *(LDKCResult_ThirtyTwoBytesAPIErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ThirtyTwoBytesAPIErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* arg_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone(int64_t orig) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* orig_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(orig); + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_COption_OffersMessageZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -21393,269 +25155,268 @@ 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; +int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_ok(int64_t o) { + LDKPhantomRouteHints o_conv; 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); + o_conv = PhantomRouteHints_clone(&o_conv); + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_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); + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_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); +jboolean CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_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); + LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); + CResult_PhantomRouteHintsDecodeErrorZ_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); +static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_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); +int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_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); +int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_ok(int64_t o) { - LDKChannelCounterparty o_conv; +int64_t CS_LDK_CResult_BlindedForwardDecodeErrorZ_ok(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 = ChannelCounterparty_clone(&o_conv); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); + o_conv = BlindedForward_clone(&o_conv); + LDKCResult_BlindedForwardDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedForwardDecodeErrorZ), "LDKCResult_BlindedForwardDecodeErrorZ"); + *ret_conv = CResult_BlindedForwardDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_BlindedForwardDecodeErrorZ_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); + LDKCResult_BlindedForwardDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedForwardDecodeErrorZ), "LDKCResult_BlindedForwardDecodeErrorZ"); + *ret_conv = CResult_BlindedForwardDecodeErrorZ_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); +jboolean CS_LDK_CResult_BlindedForwardDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BlindedForwardDecodeErrorZ* o_conv = (LDKCResult_BlindedForwardDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedForwardDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ChannelCounterpartyDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_BlindedForwardDecodeErrorZ_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); + LDKCResult_BlindedForwardDecodeErrorZ _res_conv = *(LDKCResult_BlindedForwardDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); + CResult_BlindedForwardDecodeErrorZ_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); +static inline uint64_t CResult_BlindedForwardDecodeErrorZ_clone_ptr(LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedForwardDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedForwardDecodeErrorZ), "LDKCResult_BlindedForwardDecodeErrorZ"); + *ret_conv = CResult_BlindedForwardDecodeErrorZ_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); +int64_t CS_LDK_CResult_BlindedForwardDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedForwardDecodeErrorZ* arg_conv = (LDKCResult_BlindedForwardDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedForwardDecodeErrorZ_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); +int64_t CS_LDK_CResult_BlindedForwardDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BlindedForwardDecodeErrorZ* orig_conv = (LDKCResult_BlindedForwardDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedForwardDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedForwardDecodeErrorZ), "LDKCResult_BlindedForwardDecodeErrorZ"); + *ret_conv = CResult_BlindedForwardDecodeErrorZ_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); +int64_t CS_LDK_CResult_PendingHTLCRoutingDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPendingHTLCRouting o_conv = *(LDKPendingHTLCRouting*)(o_ptr); + o_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(o)); + LDKCResult_PendingHTLCRoutingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCRoutingDecodeErrorZ), "LDKCResult_PendingHTLCRoutingDecodeErrorZ"); + *ret_conv = CResult_PendingHTLCRoutingDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelDetailsDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_PendingHTLCRoutingDecodeErrorZ_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); + LDKCResult_PendingHTLCRoutingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCRoutingDecodeErrorZ), "LDKCResult_PendingHTLCRoutingDecodeErrorZ"); + *ret_conv = CResult_PendingHTLCRoutingDecodeErrorZ_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); +jboolean CS_LDK_CResult_PendingHTLCRoutingDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PendingHTLCRoutingDecodeErrorZ* o_conv = (LDKCResult_PendingHTLCRoutingDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PendingHTLCRoutingDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ChannelDetailsDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PendingHTLCRoutingDecodeErrorZ_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); + LDKCResult_PendingHTLCRoutingDecodeErrorZ _res_conv = *(LDKCResult_PendingHTLCRoutingDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); + CResult_PendingHTLCRoutingDecodeErrorZ_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); +static inline uint64_t CResult_PendingHTLCRoutingDecodeErrorZ_clone_ptr(LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PendingHTLCRoutingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCRoutingDecodeErrorZ), "LDKCResult_PendingHTLCRoutingDecodeErrorZ"); + *ret_conv = CResult_PendingHTLCRoutingDecodeErrorZ_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); +int64_t CS_LDK_CResult_PendingHTLCRoutingDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PendingHTLCRoutingDecodeErrorZ* arg_conv = (LDKCResult_PendingHTLCRoutingDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PendingHTLCRoutingDecodeErrorZ_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); +int64_t CS_LDK_CResult_PendingHTLCRoutingDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PendingHTLCRoutingDecodeErrorZ* orig_conv = (LDKCResult_PendingHTLCRoutingDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PendingHTLCRoutingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCRoutingDecodeErrorZ), "LDKCResult_PendingHTLCRoutingDecodeErrorZ"); + *ret_conv = CResult_PendingHTLCRoutingDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_ok(int64_t o) { - LDKPhantomRouteHints o_conv; +int64_t CS_LDK_CResult_PendingHTLCInfoDecodeErrorZ_ok(int64_t o) { + LDKPendingHTLCInfo o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PhantomRouteHints_clone(&o_conv); - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv); + o_conv = PendingHTLCInfo_clone(&o_conv); + LDKCResult_PendingHTLCInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoDecodeErrorZ), "LDKCResult_PendingHTLCInfoDecodeErrorZ"); + *ret_conv = CResult_PendingHTLCInfoDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_PendingHTLCInfoDecodeErrorZ_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_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv); + LDKCResult_PendingHTLCInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoDecodeErrorZ), "LDKCResult_PendingHTLCInfoDecodeErrorZ"); + *ret_conv = CResult_PendingHTLCInfoDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_PendingHTLCInfoDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PendingHTLCInfoDecodeErrorZ* o_conv = (LDKCResult_PendingHTLCInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PendingHTLCInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_PendingHTLCInfoDecodeErrorZ_free(int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr); + LDKCResult_PendingHTLCInfoDecodeErrorZ _res_conv = *(LDKCResult_PendingHTLCInfoDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv); + CResult_PendingHTLCInfoDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PendingHTLCInfoDecodeErrorZ_clone_ptr(LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PendingHTLCInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoDecodeErrorZ), "LDKCResult_PendingHTLCInfoDecodeErrorZ"); + *ret_conv = CResult_PendingHTLCInfoDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_PendingHTLCInfoDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PendingHTLCInfoDecodeErrorZ* arg_conv = (LDKCResult_PendingHTLCInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PendingHTLCInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_PhantomRouteHintsDecodeErrorZ_clone(int64_t orig) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv); +int64_t CS_LDK_CResult_PendingHTLCInfoDecodeErrorZ_clone(int64_t orig) { + LDKCResult_PendingHTLCInfoDecodeErrorZ* orig_conv = (LDKCResult_PendingHTLCInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PendingHTLCInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoDecodeErrorZ), "LDKCResult_PendingHTLCInfoDecodeErrorZ"); + *ret_conv = CResult_PendingHTLCInfoDecodeErrorZ_clone(orig_conv); 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); +int64_t CS_LDK_CResult_BlindedFailureDecodeErrorZ_ok(int32_t o) { + LDKBlindedFailure o_conv = LDKBlindedFailure_from_cs(o); + LDKCResult_BlindedFailureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedFailureDecodeErrorZ), "LDKCResult_BlindedFailureDecodeErrorZ"); + *ret_conv = CResult_BlindedFailureDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_BlindedFailureDecodeErrorZ_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); + LDKCResult_BlindedFailureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedFailureDecodeErrorZ), "LDKCResult_BlindedFailureDecodeErrorZ"); + *ret_conv = CResult_BlindedFailureDecodeErrorZ_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); +jboolean CS_LDK_CResult_BlindedFailureDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BlindedFailureDecodeErrorZ* o_conv = (LDKCResult_BlindedFailureDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedFailureDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ChannelShutdownStateDecodeErrorZ_free(int64_t _res) { +void CS_LDK_CResult_BlindedFailureDecodeErrorZ_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); + LDKCResult_BlindedFailureDecodeErrorZ _res_conv = *(LDKCResult_BlindedFailureDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelShutdownStateDecodeErrorZ_free(_res_conv); + CResult_BlindedFailureDecodeErrorZ_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); +static inline uint64_t CResult_BlindedFailureDecodeErrorZ_clone_ptr(LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedFailureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedFailureDecodeErrorZ), "LDKCResult_BlindedFailureDecodeErrorZ"); + *ret_conv = CResult_BlindedFailureDecodeErrorZ_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); +int64_t CS_LDK_CResult_BlindedFailureDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BlindedFailureDecodeErrorZ* arg_conv = (LDKCResult_BlindedFailureDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedFailureDecodeErrorZ_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); +int64_t CS_LDK_CResult_BlindedFailureDecodeErrorZ_clone(int64_t orig) { + LDKCResult_BlindedFailureDecodeErrorZ* orig_conv = (LDKCResult_BlindedFailureDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedFailureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedFailureDecodeErrorZ), "LDKCResult_BlindedFailureDecodeErrorZ"); + *ret_conv = CResult_BlindedFailureDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -22391,27 +26152,6 @@ void CS_LDK_CVec_CommitmentTransactionZ_free(int64_tArray _res) { CVec_CommitmentTransactionZ_free(_res_constr); } -void CS_LDK_CVec_TransactionZ_free(ptrArray _res) { - LDKCVec_TransactionZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements"); - else - _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int8_tArray _res_conv_8 = _res_vals[i]; - LDKTransaction _res_conv_8_ref; - _res_conv_8_ref.datalen = _res_conv_8->arr_len; - _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); - memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); - _res_conv_8_ref.data_is_owned = true; - _res_constr.data[i] = _res_conv_8_ref; - } - FREE(_res); - CVec_TransactionZ_free(_res_constr); -} - static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); *ret_conv = C2Tuple_u32TxOutZ_clone(arg); @@ -22718,6 +26458,78 @@ void CS_LDK_CVec_C2Tuple_PublicKeyTypeZZ_free(int64_tArray _res) { CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr); } +static inline uint64_t C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR arg) { + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); + *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(int64_t arg) { + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* arg_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(int64_t orig) { + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* orig_conv = (LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)untag_ptr(orig); + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); + *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_new(int8_tArray a, int64_tArray b) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKCVec_SocketAddressZ b_constr; + b_constr.datalen = b->arr_len; + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = b->elems; + for (size_t p = 0; p < b_constr.datalen; p++) { + int64_t b_conv_15 = b_vals[p]; + void* b_conv_15_ptr = untag_ptr(b_conv_15); + CHECK_ACCESS(b_conv_15_ptr); + LDKSocketAddress b_conv_15_conv = *(LDKSocketAddress*)(b_conv_15_ptr); + b_conv_15_conv = SocketAddress_clone((LDKSocketAddress*)untag_ptr(b_conv_15)); + b_constr.data[p] = b_conv_15_conv; + } + FREE(b); + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKC2Tuple_PublicKeyCVec_SocketAddressZZ"); + *ret_conv = C2Tuple_PublicKeyCVec_SocketAddressZZ_new(a_ref, b_constr); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_PublicKeyCVec_SocketAddressZZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_PublicKeyCVec_SocketAddressZZ_free(_res_conv); +} + +void CS_LDK_CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_40 = _res_vals[o]; + void* _res_conv_40_ptr = untag_ptr(_res_conv_40); + CHECK_ACCESS(_res_conv_40_ptr); + LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res_conv_40_conv = *(LDKC2Tuple_PublicKeyCVec_SocketAddressZZ*)(_res_conv_40_ptr); + FREE(untag_ptr(_res_conv_40)); + _res_constr.data[o] = _res_conv_40_conv; + } + FREE(_res); + CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(_res_constr); +} + int64_t CS_LDK_COption_OnionMessageContentsZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -23040,64 +26852,24 @@ int64_t CS_LDK_COption_SocketAddressZ_clone(int64_t orig) { return ret_ref; } -static inline uint64_t C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR arg) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ), "LDKC2Tuple_PublicKeyCOption_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(int64_t arg) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* arg_conv = (LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(int64_t orig) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* orig_conv = (LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)untag_ptr(orig); - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ), "LDKC2Tuple_PublicKeyCOption_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_new(int8_tArray a, int64_t b) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - void* b_ptr = untag_ptr(b); - CHECK_ACCESS(b_ptr); - LDKCOption_SocketAddressZ b_conv = *(LDKCOption_SocketAddressZ*)(b_ptr); - b_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(b)); - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ), "LDKC2Tuple_PublicKeyCOption_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCOption_SocketAddressZZ_new(a_ref, b_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res_conv = *(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C2Tuple_PublicKeyCOption_SocketAddressZZ_free(_res_conv); -} - -void CS_LDK_CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res_constr; +void CS_LDK_CVec_PeerDetailsZ_free(int64_tArray _res) { + LDKCVec_PeerDetailsZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPeerDetails), "LDKCVec_PeerDetailsZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t r = 0; r < _res_constr.datalen; r++) { - int64_t _res_conv_43 = _res_vals[r]; - void* _res_conv_43_ptr = untag_ptr(_res_conv_43); - CHECK_ACCESS(_res_conv_43_ptr); - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res_conv_43_conv = *(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)(_res_conv_43_ptr); - FREE(untag_ptr(_res_conv_43)); - _res_constr.data[r] = _res_conv_43_conv; + for (size_t n = 0; n < _res_constr.datalen; n++) { + int64_t _res_conv_13 = _res_vals[n]; + LDKPeerDetails _res_conv_13_conv; + _res_conv_13_conv.inner = untag_ptr(_res_conv_13); + _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); + _res_constr.data[n] = _res_conv_13_conv; } FREE(_res); - CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(_res_constr); + CVec_PeerDetailsZ_free(_res_constr); } int64_t CS_LDK_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) { @@ -23543,6 +27315,108 @@ int64_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(int6 return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(int64_t o) { + LDKUnsignedInvoiceRequest o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = UnsignedInvoiceRequest_clone(&o_conv); + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* o_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ _res_conv = *(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* arg_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(int64_t orig) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* orig_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_ok(int64_t o) { + LDKInvoiceRequest o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = InvoiceRequest_clone(&o_conv); + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceRequestBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* arg_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_clone(int64_t orig) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* orig_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_COption_SecretKeyZ_some(int8_tArray o) { LDKSecretKey o_ref; CHECK(o->arr_len == 32); @@ -23589,6 +27463,40 @@ int64_t CS_LDK_COption_SecretKeyZ_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(int64_t o) { + LDKInvoiceWithExplicitSigningPubkeyBuilder o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(_res_conv); +} + int64_t CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_ok(int64_t o) { LDKVerifiedInvoiceRequest o_conv; o_conv.inner = untag_ptr(o); @@ -23639,6 +27547,94 @@ int64_t CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(int64_t o) { + LDKInvoiceWithDerivedSigningPubkeyBuilder o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(e); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(_res_conv); +} + +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_ok(int64_t o) { + LDKInvoiceRequestFields o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = InvoiceRequestFields_clone(&o_conv); + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* o_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceRequestFieldsDecodeErrorZ _res_conv = *(LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestFieldsDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* arg_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_clone(int64_t orig) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* orig_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int32_t CS_LDK_COption_NoneZ_some() { int32_t ret_conv = LDKCOption_NoneZ_to_cs(COption_NoneZ_some()); return ret_conv; @@ -23675,6 +27671,52 @@ void CS_LDK_CVec_WitnessZ_free(ptrArray _res) { CVec_WitnessZ_free(_res_constr); } +int64_t CS_LDK_COption_ECDSASignatureZ_some(int8_tArray o) { + LDKECDSASignature o_ref; + CHECK(o->arr_len == 64); + memcpy(o_ref.compact_form, o->elems, 64); FREE(o); + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = COption_ECDSASignatureZ_some(o_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_ECDSASignatureZ_none() { + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = COption_ECDSASignatureZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_ECDSASignatureZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_ECDSASignatureZ _res_conv = *(LDKCOption_ECDSASignatureZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_ECDSASignatureZ_free(_res_conv); +} + +static inline uint64_t COption_ECDSASignatureZ_clone_ptr(LDKCOption_ECDSASignatureZ *NONNULL_PTR arg) { + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = COption_ECDSASignatureZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_ECDSASignatureZ_clone_ptr(int64_t arg) { + LDKCOption_ECDSASignatureZ* arg_conv = (LDKCOption_ECDSASignatureZ*)untag_ptr(arg); + int64_t ret_conv = COption_ECDSASignatureZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_ECDSASignatureZ_clone(int64_t orig) { + LDKCOption_ECDSASignatureZ* orig_conv = (LDKCOption_ECDSASignatureZ*)untag_ptr(orig); + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = COption_ECDSASignatureZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_COption_i64Z_some(int64_t o) { LDKCOption_i64Z *ret_copy = MALLOC(sizeof(LDKCOption_i64Z), "LDKCOption_i64Z"); *ret_copy = COption_i64Z_some(o); @@ -24009,6 +28051,222 @@ int64_t CS_LDK_CResult_AcceptChannelV2DecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_StfuDecodeErrorZ_ok(int64_t o) { + LDKStfu o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Stfu_clone(&o_conv); + LDKCResult_StfuDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StfuDecodeErrorZ), "LDKCResult_StfuDecodeErrorZ"); + *ret_conv = CResult_StfuDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_StfuDecodeErrorZ_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_StfuDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StfuDecodeErrorZ), "LDKCResult_StfuDecodeErrorZ"); + *ret_conv = CResult_StfuDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_StfuDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_StfuDecodeErrorZ* o_conv = (LDKCResult_StfuDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_StfuDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_StfuDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_StfuDecodeErrorZ _res_conv = *(LDKCResult_StfuDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_StfuDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_StfuDecodeErrorZ_clone_ptr(LDKCResult_StfuDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_StfuDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StfuDecodeErrorZ), "LDKCResult_StfuDecodeErrorZ"); + *ret_conv = CResult_StfuDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_StfuDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_StfuDecodeErrorZ* arg_conv = (LDKCResult_StfuDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_StfuDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_StfuDecodeErrorZ_clone(int64_t orig) { + LDKCResult_StfuDecodeErrorZ* orig_conv = (LDKCResult_StfuDecodeErrorZ*)untag_ptr(orig); + LDKCResult_StfuDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StfuDecodeErrorZ), "LDKCResult_StfuDecodeErrorZ"); + *ret_conv = CResult_StfuDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_SpliceDecodeErrorZ_ok(int64_t o) { + LDKSplice o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Splice_clone(&o_conv); + LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); + *ret_conv = CResult_SpliceDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_SpliceDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); + *ret_conv = CResult_SpliceDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_SpliceDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_SpliceDecodeErrorZ* o_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SpliceDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_SpliceDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_SpliceDecodeErrorZ _res_conv = *(LDKCResult_SpliceDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_SpliceDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_SpliceDecodeErrorZ_clone_ptr(LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); + *ret_conv = CResult_SpliceDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_SpliceDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SpliceDecodeErrorZ* arg_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SpliceDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_SpliceDecodeErrorZ_clone(int64_t orig) { + LDKCResult_SpliceDecodeErrorZ* orig_conv = (LDKCResult_SpliceDecodeErrorZ*)untag_ptr(orig); + LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); + *ret_conv = CResult_SpliceDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_SpliceAckDecodeErrorZ_ok(int64_t o) { + LDKSpliceAck o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = SpliceAck_clone(&o_conv); + LDKCResult_SpliceAckDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceAckDecodeErrorZ), "LDKCResult_SpliceAckDecodeErrorZ"); + *ret_conv = CResult_SpliceAckDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_SpliceAckDecodeErrorZ_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_SpliceAckDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceAckDecodeErrorZ), "LDKCResult_SpliceAckDecodeErrorZ"); + *ret_conv = CResult_SpliceAckDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_SpliceAckDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_SpliceAckDecodeErrorZ* o_conv = (LDKCResult_SpliceAckDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SpliceAckDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_SpliceAckDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_SpliceAckDecodeErrorZ _res_conv = *(LDKCResult_SpliceAckDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_SpliceAckDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_SpliceAckDecodeErrorZ_clone_ptr(LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpliceAckDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceAckDecodeErrorZ), "LDKCResult_SpliceAckDecodeErrorZ"); + *ret_conv = CResult_SpliceAckDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_SpliceAckDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SpliceAckDecodeErrorZ* arg_conv = (LDKCResult_SpliceAckDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SpliceAckDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_SpliceAckDecodeErrorZ_clone(int64_t orig) { + LDKCResult_SpliceAckDecodeErrorZ* orig_conv = (LDKCResult_SpliceAckDecodeErrorZ*)untag_ptr(orig); + LDKCResult_SpliceAckDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceAckDecodeErrorZ), "LDKCResult_SpliceAckDecodeErrorZ"); + *ret_conv = CResult_SpliceAckDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_SpliceLockedDecodeErrorZ_ok(int64_t o) { + LDKSpliceLocked o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = SpliceLocked_clone(&o_conv); + LDKCResult_SpliceLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceLockedDecodeErrorZ), "LDKCResult_SpliceLockedDecodeErrorZ"); + *ret_conv = CResult_SpliceLockedDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_SpliceLockedDecodeErrorZ_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_SpliceLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceLockedDecodeErrorZ), "LDKCResult_SpliceLockedDecodeErrorZ"); + *ret_conv = CResult_SpliceLockedDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_SpliceLockedDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_SpliceLockedDecodeErrorZ* o_conv = (LDKCResult_SpliceLockedDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SpliceLockedDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_SpliceLockedDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_SpliceLockedDecodeErrorZ _res_conv = *(LDKCResult_SpliceLockedDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_SpliceLockedDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_SpliceLockedDecodeErrorZ_clone_ptr(LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpliceLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceLockedDecodeErrorZ), "LDKCResult_SpliceLockedDecodeErrorZ"); + *ret_conv = CResult_SpliceLockedDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_SpliceLockedDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SpliceLockedDecodeErrorZ* arg_conv = (LDKCResult_SpliceLockedDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SpliceLockedDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_SpliceLockedDecodeErrorZ_clone(int64_t orig) { + LDKCResult_SpliceLockedDecodeErrorZ* orig_conv = (LDKCResult_SpliceLockedDecodeErrorZ*)untag_ptr(orig); + LDKCResult_SpliceLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceLockedDecodeErrorZ), "LDKCResult_SpliceLockedDecodeErrorZ"); + *ret_conv = CResult_SpliceLockedDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_TxAddInputDecodeErrorZ_ok(int64_t o) { LDKTxAddInput o_conv; o_conv.inner = untag_ptr(o); @@ -25413,6 +29671,60 @@ int64_t CS_LDK_CResult_UpdateFulfillHTLCDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_OnionPacketDecodeErrorZ_ok(int64_t o) { + LDKOnionPacket o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = OnionPacket_clone(&o_conv); + LDKCResult_OnionPacketDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionPacketDecodeErrorZ), "LDKCResult_OnionPacketDecodeErrorZ"); + *ret_conv = CResult_OnionPacketDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OnionPacketDecodeErrorZ_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_OnionPacketDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionPacketDecodeErrorZ), "LDKCResult_OnionPacketDecodeErrorZ"); + *ret_conv = CResult_OnionPacketDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OnionPacketDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OnionPacketDecodeErrorZ* o_conv = (LDKCResult_OnionPacketDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OnionPacketDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OnionPacketDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OnionPacketDecodeErrorZ _res_conv = *(LDKCResult_OnionPacketDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OnionPacketDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OnionPacketDecodeErrorZ_clone_ptr(LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OnionPacketDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionPacketDecodeErrorZ), "LDKCResult_OnionPacketDecodeErrorZ"); + *ret_conv = CResult_OnionPacketDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_OnionPacketDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OnionPacketDecodeErrorZ* arg_conv = (LDKCResult_OnionPacketDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OnionPacketDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OnionPacketDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OnionPacketDecodeErrorZ* orig_conv = (LDKCResult_OnionPacketDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OnionPacketDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionPacketDecodeErrorZ), "LDKCResult_OnionPacketDecodeErrorZ"); + *ret_conv = CResult_OnionPacketDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_UpdateAddHTLCDecodeErrorZ_ok(int64_t o) { LDKUpdateAddHTLC o_conv; o_conv.inner = untag_ptr(o); @@ -25521,6 +29833,60 @@ int64_t CS_LDK_CResult_OnionMessageDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_FinalOnionHopDataDecodeErrorZ_ok(int64_t o) { + LDKFinalOnionHopData o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = FinalOnionHopData_clone(&o_conv); + LDKCResult_FinalOnionHopDataDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FinalOnionHopDataDecodeErrorZ), "LDKCResult_FinalOnionHopDataDecodeErrorZ"); + *ret_conv = CResult_FinalOnionHopDataDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_FinalOnionHopDataDecodeErrorZ_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_FinalOnionHopDataDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FinalOnionHopDataDecodeErrorZ), "LDKCResult_FinalOnionHopDataDecodeErrorZ"); + *ret_conv = CResult_FinalOnionHopDataDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_FinalOnionHopDataDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_FinalOnionHopDataDecodeErrorZ* o_conv = (LDKCResult_FinalOnionHopDataDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_FinalOnionHopDataDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_FinalOnionHopDataDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_FinalOnionHopDataDecodeErrorZ _res_conv = *(LDKCResult_FinalOnionHopDataDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_FinalOnionHopDataDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_FinalOnionHopDataDecodeErrorZ_clone_ptr(LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FinalOnionHopDataDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FinalOnionHopDataDecodeErrorZ), "LDKCResult_FinalOnionHopDataDecodeErrorZ"); + *ret_conv = CResult_FinalOnionHopDataDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_FinalOnionHopDataDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_FinalOnionHopDataDecodeErrorZ* arg_conv = (LDKCResult_FinalOnionHopDataDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_FinalOnionHopDataDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_FinalOnionHopDataDecodeErrorZ_clone(int64_t orig) { + LDKCResult_FinalOnionHopDataDecodeErrorZ* orig_conv = (LDKCResult_FinalOnionHopDataDecodeErrorZ*)untag_ptr(orig); + LDKCResult_FinalOnionHopDataDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FinalOnionHopDataDecodeErrorZ), "LDKCResult_FinalOnionHopDataDecodeErrorZ"); + *ret_conv = CResult_FinalOnionHopDataDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_PingDecodeErrorZ_ok(int64_t o) { LDKPing o_conv; o_conv.inner = untag_ptr(o); @@ -26405,6 +30771,604 @@ int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(int64_t orig) { 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; +} + +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_COption_InboundHTLCStateDetailsZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_InboundHTLCStateDetailsZ _res_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_InboundHTLCStateDetailsZ_free(_res_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_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; +} + +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_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_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_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_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ _res_conv = *(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(_res_conv); +} + +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_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_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_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 = 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_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_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_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_InboundHTLCDetailsDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InboundHTLCDetailsDecodeErrorZ _res_conv = *(LDKCResult_InboundHTLCDetailsDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InboundHTLCDetailsDecodeErrorZ_free(_res_conv); +} + +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_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_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_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; +} + +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_COption_OutboundHTLCStateDetailsZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_OutboundHTLCStateDetailsZ _res_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_OutboundHTLCStateDetailsZ_free(_res_conv); +} + +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_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_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_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_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_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_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_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ _res_conv = *(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(_res_conv); +} + +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_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_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_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 = 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_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_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_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_OutboundHTLCDetailsDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ _res_conv = *(LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OutboundHTLCDetailsDecodeErrorZ_free(_res_conv); +} + +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_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_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_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_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; +} + +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_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_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_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_FutureZ_free(int64_tArray _res) { LDKCVec_FutureZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -27266,6 +32230,27 @@ int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(int64_t orig) return tag_ptr(ret_conv, true); } +void CS_LDK_CVec_TransactionZ_free(ptrArray _res) { + LDKCVec_TransactionZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements"); + else + _res_constr.data = NULL; + int8_tArray* _res_vals = (void*) _res->elems; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int8_tArray _res_conv_8 = _res_vals[i]; + LDKTransaction _res_conv_8_ref; + _res_conv_8_ref.datalen = _res_conv_8->arr_len; + _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); + memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); + _res_conv_8_ref.data_is_owned = true; + _res_constr.data[i] = _res_conv_8_ref; + } + FREE(_res); + CVec_TransactionZ_free(_res_constr); +} + int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -28778,60 +33763,96 @@ int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ReceiveTlvsDecodeErrorZ_ok(int64_t o) { - LDKReceiveTlvs 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 = ReceiveTlvs_clone(&o_conv); - LDKCResult_ReceiveTlvsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReceiveTlvsDecodeErrorZ), "LDKCResult_ReceiveTlvsDecodeErrorZ"); - *ret_conv = CResult_ReceiveTlvsDecodeErrorZ_ok(o_conv); + o_conv = ChannelId_clone(&o_conv); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ReceiveTlvsDecodeErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_ReceiveTlvsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReceiveTlvsDecodeErrorZ), "LDKCResult_ReceiveTlvsDecodeErrorZ"); - *ret_conv = CResult_ReceiveTlvsDecodeErrorZ_err(e_conv); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ReceiveTlvsDecodeErrorZ_is_ok(int64_t o) { - LDKCResult_ReceiveTlvsDecodeErrorZ* o_conv = (LDKCResult_ReceiveTlvsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ReceiveTlvsDecodeErrorZ_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_ReceiveTlvsDecodeErrorZ_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_ReceiveTlvsDecodeErrorZ _res_conv = *(LDKCResult_ReceiveTlvsDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelIdDecodeErrorZ _res_conv = *(LDKCResult_ChannelIdDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ReceiveTlvsDecodeErrorZ_free(_res_conv); + CResult_ChannelIdDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ChannelIdDecodeErrorZ_clone_ptr(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelIdDecodeErrorZ* arg_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; } -static inline uint64_t CResult_ReceiveTlvsDecodeErrorZ_clone_ptr(LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ReceiveTlvsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReceiveTlvsDecodeErrorZ), "LDKCResult_ReceiveTlvsDecodeErrorZ"); - *ret_conv = CResult_ReceiveTlvsDecodeErrorZ_clone(arg); +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_ReceiveTlvsDecodeErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ReceiveTlvsDecodeErrorZ* arg_conv = (LDKCResult_ReceiveTlvsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ReceiveTlvsDecodeErrorZ_clone_ptr(arg_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_ReceiveTlvsDecodeErrorZ_clone(int64_t orig) { - LDKCResult_ReceiveTlvsDecodeErrorZ* orig_conv = (LDKCResult_ReceiveTlvsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ReceiveTlvsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReceiveTlvsDecodeErrorZ), "LDKCResult_ReceiveTlvsDecodeErrorZ"); - *ret_conv = CResult_ReceiveTlvsDecodeErrorZ_clone(orig_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); 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); + return tag_ptr(ret_conv, true); +} + +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); + LDKC2Tuple__u832u16Z _res_conv = *(LDKC2Tuple__u832u16Z*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple__u832u16Z_free(_res_conv); +} + int64_t CS_LDK_CResult_PaymentRelayDecodeErrorZ_ok(int64_t o) { LDKPaymentRelay o_conv; o_conv.inner = untag_ptr(o); @@ -28940,169 +33961,218 @@ int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_ThirtyTwoBytesPaymentErrorZ_ok(int8_tArray o) { - LDKThirtyTwoBytes o_ref; - CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); FREE(o); - LDKCResult_ThirtyTwoBytesPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentErrorZ), "LDKCResult_ThirtyTwoBytesPaymentErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentErrorZ_ok(o_ref); +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_ThirtyTwoBytesPaymentErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr); - e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e)); - LDKCResult_ThirtyTwoBytesPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentErrorZ), "LDKCResult_ThirtyTwoBytesPaymentErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_ThirtyTwoBytesPaymentErrorZ_is_ok(int64_t o) { - LDKCResult_ThirtyTwoBytesPaymentErrorZ* o_conv = (LDKCResult_ThirtyTwoBytesPaymentErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ThirtyTwoBytesPaymentErrorZ_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_ThirtyTwoBytesPaymentErrorZ_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_ThirtyTwoBytesPaymentErrorZ _res_conv = *(LDKCResult_ThirtyTwoBytesPaymentErrorZ*)(_res_ptr); + LDKCResult_PaymentContextDecodeErrorZ _res_conv = *(LDKCResult_PaymentContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ThirtyTwoBytesPaymentErrorZ_free(_res_conv); + CResult_PaymentContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ThirtyTwoBytesPaymentErrorZ_clone_ptr(LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR arg) { - LDKCResult_ThirtyTwoBytesPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentErrorZ), "LDKCResult_ThirtyTwoBytesPaymentErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentErrorZ_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_ThirtyTwoBytesPaymentErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ThirtyTwoBytesPaymentErrorZ* arg_conv = (LDKCResult_ThirtyTwoBytesPaymentErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ThirtyTwoBytesPaymentErrorZ_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_ThirtyTwoBytesPaymentErrorZ_clone(int64_t orig) { - LDKCResult_ThirtyTwoBytesPaymentErrorZ* orig_conv = (LDKCResult_ThirtyTwoBytesPaymentErrorZ*)untag_ptr(orig); - LDKCResult_ThirtyTwoBytesPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentErrorZ), "LDKCResult_ThirtyTwoBytesPaymentErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesPaymentErrorZ_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_NonePaymentErrorZ_ok() { - LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); - *ret_conv = CResult_NonePaymentErrorZ_ok(); +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_ok(int64_t o) { + LDKUnknownPaymentContext o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = UnknownPaymentContext_clone(&o_conv); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_NonePaymentErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr); - e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e)); - LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); - *ret_conv = CResult_NonePaymentErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_NonePaymentErrorZ_is_ok(int64_t o) { - LDKCResult_NonePaymentErrorZ* o_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NonePaymentErrorZ_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_NonePaymentErrorZ_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_NonePaymentErrorZ _res_conv = *(LDKCResult_NonePaymentErrorZ*)(_res_ptr); + LDKCResult_UnknownPaymentContextDecodeErrorZ _res_conv = *(LDKCResult_UnknownPaymentContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NonePaymentErrorZ_free(_res_conv); + CResult_UnknownPaymentContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_NonePaymentErrorZ_clone_ptr(LDKCResult_NonePaymentErrorZ *NONNULL_PTR arg) { - LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); - *ret_conv = CResult_NonePaymentErrorZ_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_NonePaymentErrorZ_clone_ptr(int64_t arg) { - LDKCResult_NonePaymentErrorZ* arg_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NonePaymentErrorZ_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_NonePaymentErrorZ_clone(int64_t orig) { - LDKCResult_NonePaymentErrorZ* orig_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(orig); - LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); - *ret_conv = CResult_NonePaymentErrorZ_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_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_ok(int64_tArray o) { - LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o_constr; - o_constr.datalen = o->arr_len; - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ), "LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ Elements"); - else - o_constr.data = NULL; - int64_t* o_vals = o->elems; - for (size_t o = 0; o < o_constr.datalen; o++) { - int64_t o_conv_40 = o_vals[o]; - void* o_conv_40_ptr = untag_ptr(o_conv_40); - CHECK_ACCESS(o_conv_40_ptr); - LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o_conv_40_conv = *(LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ*)(o_conv_40_ptr); - o_conv_40_conv = C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone((LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ*)untag_ptr(o_conv_40)); - o_constr.data[o] = o_conv_40_conv; - } - FREE(o); - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_ok(o_constr); +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_ok(int64_t o) { + LDKBolt12OfferContext o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Bolt12OfferContext_clone(&o_conv); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_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); + FREE(untag_ptr(_res)); + CResult_Bolt12OfferContextDecodeErrorZ_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); + 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); + 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); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_ok(int64_t o) { + LDKBolt12RefundContext o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Bolt12RefundContext_clone(&o_conv); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_err(int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKProbingError e_conv = *(LDKProbingError*)(e_ptr); - e_conv = ProbingError_clone((LDKProbingError*)untag_ptr(e)); - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_is_ok(int64_t o) { - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_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_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_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_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ*)(_res_ptr); + LDKCResult_Bolt12RefundContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12RefundContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_free(_res_conv); + CResult_Bolt12RefundContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR arg) { - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_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_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_clone_ptr(int64_t arg) { - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_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_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_clone(int64_t orig) { - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ*)untag_ptr(orig); - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_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); } @@ -29153,6 +34223,101 @@ int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +static inline uint64_t C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR arg) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(int64_t arg) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(int64_t orig) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* orig_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(orig); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(int8_tArray a, int64_t b, int64_t c) { + LDKThirtyTwoBytes a_ref; + CHECK(a->arr_len == 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); + LDKRecipientOnionFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = RecipientOnionFields_clone(&b_conv); + LDKRouteParameters c_conv; + c_conv.inner = untag_ptr(c); + c_conv.is_owned = ptr_is_owned(c); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = RouteParameters_clone(&c_conv); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(a_ref, b_conv, c_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); +} + +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(o_ptr); + o_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone((LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(o)); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err() { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(int64_t o) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* o_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res_conv = *(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(int64_t arg) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* arg_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(int64_t orig) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* orig_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(orig); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -29203,75 +34368,25 @@ int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_OnionMessagePathNoneZ_ok(int64_t o) { - LDKOnionMessagePath o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = OnionMessagePath_clone(&o_conv); - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_OnionMessagePathNoneZ_err() { - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_err(); +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); } - -jboolean CS_LDK_CResult_OnionMessagePathNoneZ_is_ok(int64_t o) { - LDKCResult_OnionMessagePathNoneZ* o_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_OnionMessagePathNoneZ_is_ok(o_conv); +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; } -void CS_LDK_CResult_OnionMessagePathNoneZ_free(int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_OnionMessagePathNoneZ _res_conv = *(LDKCResult_OnionMessagePathNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_OnionMessagePathNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_OnionMessagePathNoneZ_clone_ptr(LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR arg) { - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_clone(arg); +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); } -int64_t CS_LDK_CResult_OnionMessagePathNoneZ_clone_ptr(int64_t arg) { - LDKCResult_OnionMessagePathNoneZ* arg_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OnionMessagePathNoneZ_clone_ptr(arg_conv); - return ret_conv; -} -int64_t CS_LDK_CResult_OnionMessagePathNoneZ_clone(int64_t orig) { - LDKCResult_OnionMessagePathNoneZ* orig_conv = (LDKCResult_OnionMessagePathNoneZ*)untag_ptr(orig); - LDKCResult_OnionMessagePathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessagePathNoneZ), "LDKCResult_OnionMessagePathNoneZ"); - *ret_conv = CResult_OnionMessagePathNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -static inline uint64_t C2Tuple_PublicKeyOnionMessageZ_clone_ptr(LDKC2Tuple_PublicKeyOnionMessageZ *NONNULL_PTR arg) { - LDKC2Tuple_PublicKeyOnionMessageZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyOnionMessageZ), "LDKC2Tuple_PublicKeyOnionMessageZ"); - *ret_conv = C2Tuple_PublicKeyOnionMessageZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t CS_LDK_C2Tuple_PublicKeyOnionMessageZ_clone_ptr(int64_t arg) { - LDKC2Tuple_PublicKeyOnionMessageZ* arg_conv = (LDKC2Tuple_PublicKeyOnionMessageZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_PublicKeyOnionMessageZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_C2Tuple_PublicKeyOnionMessageZ_clone(int64_t orig) { - LDKC2Tuple_PublicKeyOnionMessageZ* orig_conv = (LDKC2Tuple_PublicKeyOnionMessageZ*)untag_ptr(orig); - LDKC2Tuple_PublicKeyOnionMessageZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyOnionMessageZ), "LDKC2Tuple_PublicKeyOnionMessageZ"); - *ret_conv = C2Tuple_PublicKeyOnionMessageZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_C2Tuple_PublicKeyOnionMessageZ_new(int8_tArray a, int64_t b) { +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); @@ -29280,53 +34395,75 @@ int64_t CS_LDK_C2Tuple_PublicKeyOnionMessageZ_new(int8_tArray a, int64_t b) { b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = OnionMessage_clone(&b_conv); - LDKC2Tuple_PublicKeyOnionMessageZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyOnionMessageZ), "LDKC2Tuple_PublicKeyOnionMessageZ"); - *ret_conv = C2Tuple_PublicKeyOnionMessageZ_new(a_ref, 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_C2Tuple_PublicKeyOnionMessageZ_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); - LDKC2Tuple_PublicKeyOnionMessageZ _res_conv = *(LDKC2Tuple_PublicKeyOnionMessageZ*)(_res_ptr); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_PublicKeyOnionMessageZ_free(_res_conv); + C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(_res_conv); } -int64_t CS_LDK_CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_ok(int64_t o) { +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKC2Tuple_PublicKeyOnionMessageZ o_conv = *(LDKC2Tuple_PublicKeyOnionMessageZ*)(o_ptr); - o_conv = C2Tuple_PublicKeyOnionMessageZ_clone((LDKC2Tuple_PublicKeyOnionMessageZ*)untag_ptr(o)); - LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ), "LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ"); - *ret_conv = CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_ok(o_conv); + 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_C2Tuple_PublicKeyOnionMessageZSendErrorZ_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); LDKSendError e_conv = *(LDKSendError*)(e_ptr); e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); - LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ), "LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ"); - *ret_conv = CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_err(e_conv); + 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_C2Tuple_PublicKeyOnionMessageZSendErrorZ_is_ok(int64_t o) { - LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ* o_conv = (LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_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_C2Tuple_PublicKeyOnionMessageZSendErrorZ_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_C2Tuple_PublicKeyOnionMessageZSendErrorZ _res_conv = *(LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ*)(_res_ptr); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res_conv = *(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_free(_res_conv); + CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR arg) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(int64_t arg) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* arg_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(int64_t orig) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* orig_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(orig); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } int64_t CS_LDK_CResult_PeeledOnionNoneZ_ok(int64_t o) { @@ -29360,35 +34497,75 @@ void CS_LDK_CResult_PeeledOnionNoneZ_free(int64_t _res) { CResult_PeeledOnionNoneZ_free(_res_conv); } -int64_t CS_LDK_CResult_NoneSendErrorZ_ok() { - LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); - *ret_conv = CResult_NoneSendErrorZ_ok(); +static inline uint64_t CResult_PeeledOnionNoneZ_clone_ptr(LDKCResult_PeeledOnionNoneZ *NONNULL_PTR arg) { + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_PeeledOnionNoneZ_clone_ptr(int64_t arg) { + LDKCResult_PeeledOnionNoneZ* arg_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PeeledOnionNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_PeeledOnionNoneZ_clone(int64_t orig) { + LDKCResult_PeeledOnionNoneZ* orig_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(orig); + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_CResult_NoneSendErrorZ_err(int64_t e) { +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_SendSuccessSendErrorZ_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_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); - *ret_conv = CResult_NoneSendErrorZ_err(e_conv); + 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_NoneSendErrorZ_is_ok(int64_t o) { - LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneSendErrorZ_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_NoneSendErrorZ_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_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr); + LDKCResult_SendSuccessSendErrorZ _res_conv = *(LDKCResult_SendSuccessSendErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NoneSendErrorZ_free(_res_conv); + CResult_SendSuccessSendErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_SendSuccessSendErrorZ_clone_ptr(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR arg) { + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SendSuccessSendErrorZ* arg_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SendSuccessSendErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone(int64_t orig) { + LDKCResult_SendSuccessSendErrorZ* orig_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(orig); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } int64_t CS_LDK_CResult_BlindedPathNoneZ_ok(int64_t o) { @@ -29490,6 +34667,26 @@ int64_t CS_LDK_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(int64_t or return tag_ptr(ret_conv, true); } +void CS_LDK_CVec_ForwardNodeZ_free(int64_tArray _res) { + LDKCVec_ForwardNodeZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t n = 0; n < _res_constr.datalen; n++) { + int64_t _res_conv_13 = _res_vals[n]; + LDKForwardNode _res_conv_13_conv; + _res_conv_13_conv.inner = untag_ptr(_res_conv_13); + _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); + _res_constr.data[n] = _res_conv_13_conv; + } + FREE(_res); + CVec_ForwardNodeZ_free(_res_constr); +} + int64_t CS_LDK_CResult_BlindedPathDecodeErrorZ_ok(int64_t o) { LDKBlindedPath o_conv; o_conv.inner = untag_ptr(o); @@ -29652,6 +34849,113 @@ int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_ok(int64_t o) { + LDKTrackedSpendableOutput o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = TrackedSpendableOutput_clone(&o_conv); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* o_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TrackedSpendableOutputDecodeErrorZ _res_conv = *(LDKCResult_TrackedSpendableOutputDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TrackedSpendableOutputDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* arg_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone(int64_t orig) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* orig_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKOutputSpendStatus o_conv = *(LDKOutputSpendStatus*)(o_ptr); + o_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(o)); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutputSpendStatusDecodeErrorZ* o_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSpendStatusDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OutputSpendStatusDecodeErrorZ _res_conv = *(LDKCResult_OutputSpendStatusDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OutputSpendStatusDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OutputSpendStatusDecodeErrorZ* arg_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone(int64_t orig) { + LDKCResult_OutputSpendStatusDecodeErrorZ* orig_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + int64_t CS_LDK_COption_FilterZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -29682,6 +34986,448 @@ void CS_LDK_COption_FilterZ_free(int64_t _res) { COption_FilterZ_free(_res_conv); } +void CS_LDK_CVec_TrackedSpendableOutputZ_free(int64_tArray _res) { + LDKCVec_TrackedSpendableOutputZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTrackedSpendableOutput), "LDKCVec_TrackedSpendableOutputZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = _res->elems; + for (size_t y = 0; y < _res_constr.datalen; y++) { + int64_t _res_conv_24 = _res_vals[y]; + LDKTrackedSpendableOutput _res_conv_24_conv; + _res_conv_24_conv.inner = untag_ptr(_res_conv_24); + _res_conv_24_conv.is_owned = ptr_is_owned(_res_conv_24); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_24_conv); + _res_constr.data[y] = _res_conv_24_conv; + } + FREE(_res); + CVec_TrackedSpendableOutputZ_free(_res_constr); +} + +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_ok(int64_t o) { + LDKOutputSweeper o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKOutputSweeper + + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = CResult_OutputSweeperDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = CResult_OutputSweeperDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_OutputSweeperDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutputSweeperDecodeErrorZ* o_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSweeperDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OutputSweeperDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OutputSweeperDecodeErrorZ _res_conv = *(LDKCResult_OutputSweeperDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OutputSweeperDecodeErrorZ_free(_res_conv); +} + +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_new(int64_t a, int64_t b) { + LDKBestBlock a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = BestBlock_clone(&a_conv); + LDKOutputSweeper b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + // WARNING: we need a move here but no clone is available for LDKOutputSweeper + + LDKC2Tuple_BestBlockOutputSweeperZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BestBlockOutputSweeperZ), "LDKC2Tuple_BestBlockOutputSweeperZ"); + *ret_conv = C2Tuple_BestBlockOutputSweeperZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_BestBlockOutputSweeperZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_BestBlockOutputSweeperZ _res_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_BestBlockOutputSweeperZ_free(_res_conv); +} + +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_BestBlockOutputSweeperZ o_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(o_ptr); + // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BestBlockOutputSweeperZ + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(_res_conv); +} + +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_ok(int64_t o) { + LDKDelayedPaymentBasepoint o_conv; + o_conv.inner = untag_ptr(o); + 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_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_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; +} + +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); +} + +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; +} + +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_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); +} + +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); +} + +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; +} + +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); +} + +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); +} + +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); +} + +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); +} + +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; +} + +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); +} + +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; +} + +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); +} + +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); +} + +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); +} + +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; +} + +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); +} + +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); +} +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; +} + +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_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); +} + +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); +} + +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; +} + +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); +} + +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_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 = 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); +} + +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); +} + +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_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); +} + +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; +} + +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_CResult_LockedChannelMonitorNoneZ_ok(int64_t o) { LDKLockedChannelMonitor o_conv; o_conv.inner = untag_ptr(o); @@ -29715,24 +35461,67 @@ void CS_LDK_CResult_LockedChannelMonitorNoneZ_free(int64_t _res) { CResult_LockedChannelMonitorNoneZ_free(_res_conv); } -void CS_LDK_CVec_OutPointZ_free(int64_tArray _res) { - LDKCVec_OutPointZ _res_constr; +static inline uint64_t C2Tuple_OutPointChannelIdZ_clone_ptr(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OutPointChannelIdZ* arg_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointChannelIdZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_clone(int64_t orig) { + LDKC2Tuple_OutPointChannelIdZ* orig_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(orig); + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_new(int64_t a, int64_t b) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKChannelId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ChannelId_clone(&b_conv); + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_C2Tuple_OutPointChannelIdZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OutPointChannelIdZ _res_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OutPointChannelIdZ_free(_res_conv); +} + +void CS_LDK_CVec_C2Tuple_OutPointChannelIdZZ_free(int64_tArray _res) { + LDKCVec_C2Tuple_OutPointChannelIdZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKCVec_C2Tuple_OutPointChannelIdZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t k = 0; k < _res_constr.datalen; k++) { - int64_t _res_conv_10 = _res_vals[k]; - LDKOutPoint _res_conv_10_conv; - _res_conv_10_conv.inner = untag_ptr(_res_conv_10); - _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); - _res_constr.data[k] = _res_conv_10_conv; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_t _res_conv_29 = _res_vals[d]; + void* _res_conv_29_ptr = untag_ptr(_res_conv_29); + CHECK_ACCESS(_res_conv_29_ptr); + LDKC2Tuple_OutPointChannelIdZ _res_conv_29_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_conv_29_ptr); + FREE(untag_ptr(_res_conv_29)); + _res_constr.data[d] = _res_conv_29_conv; } FREE(_res); - CVec_OutPointZ_free(_res_constr); + CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); } void CS_LDK_CVec_MonitorUpdateIdZ_free(int64_tArray _res) { @@ -30087,6 +35876,16 @@ int64_t CS_LDK_Hostname_clone(int64_t orig) { 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; +} + jboolean CS_LDK_Hostname_eq(int64_t a, int64_t b) { LDKHostname a_conv; a_conv.inner = untag_ptr(a); @@ -30112,6 +35911,18 @@ int8_t CS_LDK_Hostname_len(int64_t this_arg) { return ret_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_Hostname_write(int64_t obj) { LDKHostname obj_conv; obj_conv.inner = untag_ptr(obj); @@ -30173,6 +35984,16 @@ int64_t CS_LDK_TransactionU16LenLimited_clone(int64_t orig) { 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); @@ -30212,6 +36033,19 @@ int8_tArray CS_LDK_TransactionU16LenLimited_into_transaction(int64_t this_arg) return ret_arr; } +int8_tArray CS_LDK_TransactionU16LenLimited_as_transaction(int64_t this_arg) { + LDKTransactionU16LenLimited this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction ret_var = TransactionU16LenLimited_as_transaction(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + Transaction_free(ret_var); + return ret_arr; +} + int8_tArray CS_LDK_TransactionU16LenLimited_write(int64_t obj) { LDKTransactionU16LenLimited obj_conv; obj_conv.inner = untag_ptr(obj); @@ -30444,6 +36278,55 @@ int64_t CS_LDK_MonitorUpdatingPersister_as_Persist(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int32_t CS_LDK_ShortChannelIdError_clone(int64_t orig) { + LDKShortChannelIdError* orig_conv = (LDKShortChannelIdError*)untag_ptr(orig); + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_ShortChannelIdError_block_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_block_overflow()); + return ret_conv; +} + +int32_t CS_LDK_ShortChannelIdError_tx_index_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_tx_index_overflow()); + return ret_conv; +} + +int32_t CS_LDK_ShortChannelIdError_vout_index_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_vout_index_overflow()); + return ret_conv; +} + +jboolean CS_LDK_ShortChannelIdError_eq(int64_t a, int64_t b) { + LDKShortChannelIdError* a_conv = (LDKShortChannelIdError*)untag_ptr(a); + LDKShortChannelIdError* b_conv = (LDKShortChannelIdError*)untag_ptr(b); + jboolean ret_conv = ShortChannelIdError_eq(a_conv, b_conv); + return ret_conv; +} + +int32_t CS_LDK_block_from_scid(int64_t short_channel_id) { + int32_t ret_conv = block_from_scid(short_channel_id); + return ret_conv; +} + +int32_t CS_LDK_tx_index_from_scid(int64_t short_channel_id) { + int32_t ret_conv = tx_index_from_scid(short_channel_id); + return ret_conv; +} + +int16_t CS_LDK_vout_from_scid(int64_t short_channel_id) { + int16_t ret_conv = vout_from_scid(short_channel_id); + return ret_conv; +} + +int64_t CS_LDK_scid_from_parts(int64_t block, int64_t tx_index, int64_t vout_index) { + LDKCResult_u64ShortChannelIdErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u64ShortChannelIdErrorZ), "LDKCResult_u64ShortChannelIdErrorZ"); + *ret_conv = scid_from_parts(block, tx_index, vout_index); + return tag_ptr(ret_conv, true); +} + void CS_LDK_UntrustedString_free(int64_t this_obj) { LDKUntrustedString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -30528,6 +36411,16 @@ jboolean CS_LDK_UntrustedString_eq(int64_t a, int64_t b) { return ret_conv; } +int64_t CS_LDK_UntrustedString_hash(int64_t o) { + LDKUntrustedString o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UntrustedString_hash(&o_conv); + return ret_conv; +} + int8_tArray CS_LDK_UntrustedString_write(int64_t obj) { LDKUntrustedString obj_conv; obj_conv.inner = untag_ptr(obj); @@ -30551,6 +36444,18 @@ int64_t CS_LDK_UntrustedString_read(int8_tArray 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); @@ -30590,53 +36495,659 @@ int64_t CS_LDK_PrintableString_new(jstring a_arg) { return ret_ref; } -void CS_LDK_FutureCallback_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - FutureCallback_free(this_ptr_conv); +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_Future_free(int64_t this_obj) { - LDKFuture this_obj_conv; +void CS_LDK_TrackedSpendableOutput_free(int64_t this_obj) { + LDKTrackedSpendableOutput this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Future_free(this_obj_conv); + TrackedSpendableOutput_free(this_obj_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_get_descriptor(int64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = TrackedSpendableOutput_get_descriptor(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TrackedSpendableOutput_set_descriptor(int64_t this_ptr, int64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKSpendableOutputDescriptor val_conv = *(LDKSpendableOutputDescriptor*)(val_ptr); + val_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(val)); + TrackedSpendableOutput_set_descriptor(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_get_channel_id(int64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelId ret_var = TrackedSpendableOutput_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_TrackedSpendableOutput_set_channel_id(int64_t this_ptr, int64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + TrackedSpendableOutput_set_channel_id(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_get_status(int64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = TrackedSpendableOutput_get_status(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TrackedSpendableOutput_set_status(int64_t this_ptr, int64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKOutputSpendStatus val_conv = *(LDKOutputSpendStatus*)(val_ptr); + val_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(val)); + TrackedSpendableOutput_set_status(&this_ptr_conv, val_conv); } -static inline uint64_t Future_clone_ptr(LDKFuture *NONNULL_PTR arg) { - LDKFuture ret_var = Future_clone(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); + 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; } -int64_t CS_LDK_Future_clone_ptr(int64_t arg) { - LDKFuture arg_conv; + +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_TrackedSpendableOutput_clone_ptr(int64_t arg) { + LDKTrackedSpendableOutput arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Future_clone_ptr(&arg_conv); + int64_t ret_conv = TrackedSpendableOutput_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Future_clone(int64_t orig) { - LDKFuture orig_conv; +int64_t CS_LDK_TrackedSpendableOutput_clone(int64_t orig) { + LDKTrackedSpendableOutput orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKFuture ret_var = Future_clone(&orig_conv); + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } +jboolean CS_LDK_TrackedSpendableOutput_eq(int64_t a, int64_t b) { + LDKTrackedSpendableOutput a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKTrackedSpendableOutput b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = TrackedSpendableOutput_eq(&a_conv, &b_conv); + return ret_conv; +} + +jboolean CS_LDK_TrackedSpendableOutput_is_spent_in(int64_t this_arg, int8_tArray tx) { + LDKTrackedSpendableOutput this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKTransaction tx_ref; + tx_ref.datalen = tx->arr_len; + tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); + tx_ref.data_is_owned = true; + jboolean ret_conv = TrackedSpendableOutput_is_spent_in(&this_arg_conv, tx_ref); + return ret_conv; +} + +int8_tArray CS_LDK_TrackedSpendableOutput_write(int64_t obj) { + LDKTrackedSpendableOutput obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = TrackedSpendableOutput_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_TrackedSpendableOutput_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = TrackedSpendableOutput_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_OutputSpendStatus_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOutputSpendStatus this_ptr_conv = *(LDKOutputSpendStatus*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OutputSpendStatus_free(this_ptr_conv); +} + +static inline uint64_t OutputSpendStatus_clone_ptr(LDKOutputSpendStatus *NONNULL_PTR arg) { + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_OutputSpendStatus_clone_ptr(int64_t arg) { + LDKOutputSpendStatus* arg_conv = (LDKOutputSpendStatus*)untag_ptr(arg); + int64_t ret_conv = OutputSpendStatus_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OutputSpendStatus_clone(int64_t orig) { + LDKOutputSpendStatus* orig_conv = (LDKOutputSpendStatus*)untag_ptr(orig); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OutputSpendStatus_pending_initial_broadcast(int64_t delayed_until_height) { + void* delayed_until_height_ptr = untag_ptr(delayed_until_height); + CHECK_ACCESS(delayed_until_height_ptr); + LDKCOption_u32Z delayed_until_height_conv = *(LDKCOption_u32Z*)(delayed_until_height_ptr); + delayed_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delayed_until_height)); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_initial_broadcast(delayed_until_height_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OutputSpendStatus_pending_first_confirmation(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx) { + LDKThirtyTwoBytes first_broadcast_hash_ref; + CHECK(first_broadcast_hash->arr_len == 32); + memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); + LDKTransaction latest_spending_tx_ref; + latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; + latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); + latest_spending_tx_ref.data_is_owned = true; + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_first_confirmation(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OutputSpendStatus_pending_threshold_confirmations(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx, int32_t confirmation_height, int8_tArray confirmation_hash) { + LDKThirtyTwoBytes first_broadcast_hash_ref; + CHECK(first_broadcast_hash->arr_len == 32); + memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); + LDKTransaction latest_spending_tx_ref; + latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; + latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); + latest_spending_tx_ref.data_is_owned = true; + LDKThirtyTwoBytes confirmation_hash_ref; + CHECK(confirmation_hash->arr_len == 32); + memcpy(confirmation_hash_ref.data, confirmation_hash->elems, 32); FREE(confirmation_hash); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_threshold_confirmations(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref, confirmation_height, confirmation_hash_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_OutputSpendStatus_eq(int64_t a, int64_t b) { + LDKOutputSpendStatus* a_conv = (LDKOutputSpendStatus*)untag_ptr(a); + LDKOutputSpendStatus* b_conv = (LDKOutputSpendStatus*)untag_ptr(b); + jboolean ret_conv = OutputSpendStatus_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_OutputSpendStatus_write(int64_t obj) { + LDKOutputSpendStatus* obj_conv = (LDKOutputSpendStatus*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OutputSpendStatus_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_OutputSpendStatus_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = OutputSpendStatus_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_OutputSweeper_free(int64_t this_obj) { + LDKOutputSweeper this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OutputSweeper_free(this_obj_conv); +} + +int64_t CS_LDK_OutputSweeper_new(int64_t best_block, int64_t broadcaster, int64_t fee_estimator, int64_t chain_data_source, int64_t output_spender, int64_t change_destination_source, int64_t kv_store, int64_t logger) { + LDKBestBlock best_block_conv; + best_block_conv.inner = untag_ptr(best_block); + best_block_conv.is_owned = ptr_is_owned(best_block); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_conv); + best_block_conv = BestBlock_clone(&best_block_conv); + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* chain_data_source_ptr = untag_ptr(chain_data_source); + CHECK_ACCESS(chain_data_source_ptr); + LDKCOption_FilterZ chain_data_source_conv = *(LDKCOption_FilterZ*)(chain_data_source_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (chain_data_source_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (chain_data_source_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&chain_data_source_conv.some); + } + } + void* output_spender_ptr = untag_ptr(output_spender); + CHECK_ACCESS(output_spender_ptr); + LDKOutputSpender output_spender_conv = *(LDKOutputSpender*)(output_spender_ptr); + if (output_spender_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&output_spender_conv); + } + void* change_destination_source_ptr = untag_ptr(change_destination_source); + CHECK_ACCESS(change_destination_source_ptr); + LDKChangeDestinationSource change_destination_source_conv = *(LDKChangeDestinationSource*)(change_destination_source_ptr); + if (change_destination_source_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&change_destination_source_conv); + } + void* kv_store_ptr = untag_ptr(kv_store); + CHECK_ACCESS(kv_store_ptr); + LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); + if (kv_store_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&kv_store_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKOutputSweeper ret_var = OutputSweeper_new(best_block_conv, broadcaster_conv, fee_estimator_conv, chain_data_source_conv, output_spender_conv, change_destination_source_conv, kv_store_conv, logger_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_OutputSweeper_track_spendable_outputs(int64_t this_arg, int64_tArray output_descriptors, int64_t channel_id, jboolean exclude_static_outputs, int64_t delay_until_height) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_SpendableOutputDescriptorZ output_descriptors_constr; + output_descriptors_constr.datalen = output_descriptors->arr_len; + if (output_descriptors_constr.datalen > 0) + output_descriptors_constr.data = MALLOC(output_descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + output_descriptors_constr.data = NULL; + int64_t* output_descriptors_vals = output_descriptors->elems; + for (size_t b = 0; b < output_descriptors_constr.datalen; b++) { + int64_t output_descriptors_conv_27 = output_descriptors_vals[b]; + void* output_descriptors_conv_27_ptr = untag_ptr(output_descriptors_conv_27); + CHECK_ACCESS(output_descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor output_descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(output_descriptors_conv_27_ptr); + output_descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(output_descriptors_conv_27)); + output_descriptors_constr.data[b] = output_descriptors_conv_27_conv; + } + FREE(output_descriptors); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + void* delay_until_height_ptr = untag_ptr(delay_until_height); + CHECK_ACCESS(delay_until_height_ptr); + LDKCOption_u32Z delay_until_height_conv = *(LDKCOption_u32Z*)(delay_until_height_ptr); + delay_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delay_until_height)); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OutputSweeper_track_spendable_outputs(&this_arg_conv, output_descriptors_constr, channel_id_conv, exclude_static_outputs, delay_until_height_conv); + return tag_ptr(ret_conv, true); +} + +int64_tArray CS_LDK_OutputSweeper_tracked_spendable_outputs(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_TrackedSpendableOutputZ ret_var = OutputSweeper_tracked_spendable_outputs(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t y = 0; y < ret_var.datalen; y++) { + LDKTrackedSpendableOutput ret_conv_24_var = ret_var.data[y]; + int64_t ret_conv_24_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_24_var); + ret_conv_24_ref = tag_ptr(ret_conv_24_var.inner, ret_conv_24_var.is_owned); + ret_arr_ptr[y] = ret_conv_24_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +int64_t CS_LDK_OutputSweeper_current_best_block(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBestBlock ret_var = OutputSweeper_current_best_block(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_OutputSweeper_as_Listen(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = OutputSweeper_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_OutputSweeper_as_Confirm(int64_t this_arg) { + LDKOutputSweeper this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = OutputSweeper_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_SpendingDelay_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSpendingDelay this_ptr_conv = *(LDKSpendingDelay*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SpendingDelay_free(this_ptr_conv); +} + +static inline uint64_t SpendingDelay_clone_ptr(LDKSpendingDelay *NONNULL_PTR arg) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_SpendingDelay_clone_ptr(int64_t arg) { + LDKSpendingDelay* arg_conv = (LDKSpendingDelay*)untag_ptr(arg); + int64_t ret_conv = SpendingDelay_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_SpendingDelay_clone(int64_t orig) { + LDKSpendingDelay* orig_conv = (LDKSpendingDelay*)untag_ptr(orig); + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendingDelay_relative(int32_t num_blocks) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_relative(num_blocks); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendingDelay_absolute(int32_t height) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_absolute(height); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OutputSweeper_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_t arg_g) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_a_ptr = untag_ptr(arg_a); + CHECK_ACCESS(arg_a_ptr); + LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); + if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); + } + void* arg_b_ptr = untag_ptr(arg_b); + CHECK_ACCESS(arg_b_ptr); + LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); + if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&arg_b_conv); + } + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (arg_c_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&arg_c_conv.some); + } + } + void* arg_d_ptr = untag_ptr(arg_d); + CHECK_ACCESS(arg_d_ptr); + LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); + if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&arg_d_conv); + } + void* arg_e_ptr = untag_ptr(arg_e); + CHECK_ACCESS(arg_e_ptr); + LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); + if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + } + void* arg_f_ptr = untag_ptr(arg_f); + CHECK_ACCESS(arg_f_ptr); + LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); + if (arg_f_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&arg_f_conv); + } + void* arg_g_ptr = untag_ptr(arg_g); + CHECK_ACCESS(arg_g_ptr); + LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); + if (arg_g_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_g_conv); + } + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = OutputSweeper_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_t arg_g) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_a_ptr = untag_ptr(arg_a); + CHECK_ACCESS(arg_a_ptr); + LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); + if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); + } + void* arg_b_ptr = untag_ptr(arg_b); + CHECK_ACCESS(arg_b_ptr); + LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); + if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&arg_b_conv); + } + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (arg_c_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&arg_c_conv.some); + } + } + void* arg_d_ptr = untag_ptr(arg_d); + CHECK_ACCESS(arg_d_ptr); + LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); + if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&arg_d_conv); + } + void* arg_e_ptr = untag_ptr(arg_e); + CHECK_ACCESS(arg_e_ptr); + LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); + if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + } + void* arg_f_ptr = untag_ptr(arg_f); + CHECK_ACCESS(arg_f_ptr); + LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); + if (arg_f_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&arg_f_conv); + } + void* arg_g_ptr = untag_ptr(arg_g); + CHECK_ACCESS(arg_g_ptr); + LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); + if (arg_g_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_g_conv); + } + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = C2Tuple_BestBlockOutputSweeperZ_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_FutureCallback_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FutureCallback_free(this_ptr_conv); +} + +void CS_LDK_Future_free(int64_t this_obj) { + LDKFuture this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Future_free(this_obj_conv); +} + void CS_LDK_Future_register_callback_fn(int64_t this_arg, int64_t callback) { LDKFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -30658,8 +37169,8 @@ void CS_LDK_Future_wait(int64_t this_arg) { this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = Future_clone(&this_arg_conv); - Future_wait(this_arg_conv); + this_arg_conv.is_owned = false; + Future_wait(&this_arg_conv); } jboolean CS_LDK_Future_wait_timeout(int64_t this_arg, int64_t max_wait) { @@ -30667,8 +37178,8 @@ jboolean CS_LDK_Future_wait_timeout(int64_t this_arg, int64_t max_wait) { this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = Future_clone(&this_arg_conv); - jboolean ret_conv = Future_wait_timeout(this_arg_conv, max_wait); + this_arg_conv.is_owned = false; + jboolean ret_conv = Future_wait_timeout(&this_arg_conv, max_wait); return ret_conv; } @@ -30685,8 +37196,8 @@ int64_t CS_LDK_Sleeper_from_single_future(int64_t future) { future_conv.inner = untag_ptr(future); future_conv.is_owned = ptr_is_owned(future); CHECK_INNER_FIELD_ACCESS_OR_NULL(future_conv); - future_conv = Future_clone(&future_conv); - LDKSleeper ret_var = Sleeper_from_single_future(future_conv); + future_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_single_future(&future_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -30698,13 +37209,13 @@ int64_t CS_LDK_Sleeper_from_two_futures(int64_t fut_a, int64_t fut_b) { fut_a_conv.inner = untag_ptr(fut_a); fut_a_conv.is_owned = ptr_is_owned(fut_a); CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_a_conv); - fut_a_conv = Future_clone(&fut_a_conv); + fut_a_conv.is_owned = false; LDKFuture fut_b_conv; fut_b_conv.inner = untag_ptr(fut_b); fut_b_conv.is_owned = ptr_is_owned(fut_b); CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_b_conv); - fut_b_conv = Future_clone(&fut_b_conv); - LDKSleeper ret_var = Sleeper_from_two_futures(fut_a_conv, fut_b_conv); + fut_b_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_two_futures(&fut_a_conv, &fut_b_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -30725,7 +37236,8 @@ int64_t CS_LDK_Sleeper_new(int64_tArray futures) { futures_conv_8_conv.inner = untag_ptr(futures_conv_8); futures_conv_8_conv.is_owned = ptr_is_owned(futures_conv_8); CHECK_INNER_FIELD_ACCESS_OR_NULL(futures_conv_8_conv); - futures_conv_8_conv = Future_clone(&futures_conv_8_conv); + // WARNING: we need a move here but no clone is available for LDKFuture + futures_constr.data[i] = futures_conv_8_conv; } FREE(futures); @@ -30804,6 +37316,14 @@ int64_t CS_LDK_Level_hash(int64_t o) { 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; @@ -30837,6 +37357,56 @@ void CS_LDK_Record_set_level(int64_t this_ptr, int32_t val) { Record_set_level(&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; +} + +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); +} + +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 ret_ref = 0; + CHECK_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); +} + jstring CS_LDK_Record_get_args(int64_t this_ptr) { LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -30922,6 +37492,26 @@ void CS_LDK_Record_set_line(int64_t this_ptr, int32_t val) { Record_set_line(&this_ptr_conv, val); } +int64_t CS_LDK_Record_new(int32_t level_arg, int8_tArray peer_id_arg, int64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg) { + 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 Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { LDKRecord ret_var = Record_clone(arg); int64_t ret_ref = 0; @@ -32170,6 +38760,59 @@ void CS_LDK_BestBlock_free(int64_t this_obj) { BestBlock_free(this_obj_conv); } +int8_tArray CS_LDK_BestBlock_get_block_hash(int64_t this_ptr) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *BestBlock_get_block_hash(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_BestBlock_set_block_hash(int64_t this_ptr, int8_tArray val) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + BestBlock_set_block_hash(&this_ptr_conv, val_ref); +} + +int32_t CS_LDK_BestBlock_get_height(int64_t this_ptr) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = BestBlock_get_height(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BestBlock_set_height(int64_t this_ptr, int32_t val) { + LDKBestBlock this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + BestBlock_set_height(&this_ptr_conv, val); +} + +int64_t CS_LDK_BestBlock_new(int8_tArray block_hash_arg, int32_t height_arg) { + LDKThirtyTwoBytes block_hash_arg_ref; + CHECK(block_hash_arg->arr_len == 32); + memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg); + LDKBestBlock ret_var = BestBlock_new(block_hash_arg_ref, height_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { LDKBestBlock ret_var = BestBlock_clone(arg); int64_t ret_ref = 0; @@ -32200,6 +38843,16 @@ int64_t CS_LDK_BestBlock_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_BestBlock_hash(int64_t o) { + LDKBestBlock o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BestBlock_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_BestBlock_eq(int64_t a, int64_t b) { LDKBestBlock a_conv; a_conv.inner = untag_ptr(a); @@ -32224,36 +38877,27 @@ int64_t CS_LDK_BestBlock_from_network(int32_t network) { return ret_ref; } -int64_t CS_LDK_BestBlock_new(int8_tArray block_hash, int32_t height) { - LDKThirtyTwoBytes block_hash_ref; - CHECK(block_hash->arr_len == 32); - memcpy(block_hash_ref.data, block_hash->elems, 32); FREE(block_hash); - LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -int8_tArray CS_LDK_BestBlock_block_hash(int64_t this_arg) { - LDKBestBlock this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, BestBlock_block_hash(&this_arg_conv).data, 32); +int8_tArray CS_LDK_BestBlock_write(int64_t obj) { + LDKBestBlock obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = BestBlock_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } -int32_t CS_LDK_BestBlock_height(int64_t this_arg) { - LDKBestBlock this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int32_t ret_conv = BestBlock_height(&this_arg_conv); - return ret_conv; +int64_t CS_LDK_BestBlock_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = BestBlock_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } void CS_LDK_Listen_free(int64_t this_ptr) { @@ -32386,9 +39030,10 @@ int8_tArray CS_LDK_WatchedOutput_get_script_pubkey(int64_t this_ptr) { this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); + 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; } @@ -32501,11 +39146,6 @@ int32_t CS_LDK_ConfirmationTarget_on_chain_sweep() { return ret_conv; } -int32_t CS_LDK_ConfirmationTarget_max_allowed_non_anchor_channel_remote_fee() { - int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_max_allowed_non_anchor_channel_remote_fee()); - 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; @@ -32531,6 +39171,11 @@ int32_t CS_LDK_ConfirmationTarget_channel_close_minimum() { return ret_conv; } +int32_t CS_LDK_ConfirmationTarget_output_spending_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_output_spending_fee()); + return ret_conv; +} + int64_t CS_LDK_ConfirmationTarget_hash(int64_t o) { LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); int64_t ret_conv = ConfirmationTarget_hash(o_conv); @@ -32748,16 +39393,14 @@ int64_tArray CS_LDK_ChainMonitor_list_monitors(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); + LDKCVec_C2Tuple_OutPointChannelIdZZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t k = 0; k < ret_var.datalen; k++) { - LDKOutPoint ret_conv_10_var = ret_var.data[k]; - int64_t ret_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); - ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned); - ret_arr_ptr[k] = ret_conv_10_ref; + for (size_t d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OutPointChannelIdZ* ret_conv_29_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv_29_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_29_conv, true); } FREE(ret_var.data); @@ -32827,6 +39470,29 @@ void CS_LDK_ChainMonitor_rebroadcast_pending_claims(int64_t this_arg) { ChainMonitor_rebroadcast_pending_claims(&this_arg_conv); } +void CS_LDK_ChainMonitor_signer_unblocked(int64_t this_arg, int64_t monitor_opt) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutPoint monitor_opt_conv; + monitor_opt_conv.inner = untag_ptr(monitor_opt); + monitor_opt_conv.is_owned = ptr_is_owned(monitor_opt); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_opt_conv); + monitor_opt_conv = OutPoint_clone(&monitor_opt_conv); + ChainMonitor_signer_unblocked(&this_arg_conv, monitor_opt_conv); +} + +void CS_LDK_ChainMonitor_archive_fully_resolved_channel_monitors(int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChainMonitor_archive_fully_resolved_channel_monitors(&this_arg_conv); +} + int64_t CS_LDK_ChainMonitor_as_Listen(int64_t this_arg) { LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -32898,6 +39564,33 @@ void CS_LDK_ChannelMonitorUpdate_set_update_id(int64_t this_ptr, int64_t val) { ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } +int64_t CS_LDK_ChannelMonitorUpdate_get_channel_id(int64_t this_ptr) { + LDKChannelMonitorUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelId ret_var = ChannelMonitorUpdate_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_ChannelMonitorUpdate_set_channel_id(int64_t this_ptr, int64_t val) { + LDKChannelMonitorUpdate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + ChannelMonitorUpdate_set_channel_id(&this_ptr_conv, val_conv); +} + static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); int64_t ret_ref = 0; @@ -33007,6 +39700,27 @@ int64_t CS_LDK_MonitorEvent_htlcevent(int64_t a) { return ret_ref; } +int64_t CS_LDK_MonitorEvent_holder_force_closed_with_info(int64_t reason, int64_t outpoint, int64_t channel_id) { + void* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); + reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_holder_force_closed_with_info(reason_conv, outpoint_conv, channel_id_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_MonitorEvent_holder_force_closed(int64_t a) { LDKOutPoint a_conv; a_conv.inner = untag_ptr(a); @@ -33019,14 +39733,19 @@ int64_t CS_LDK_MonitorEvent_holder_force_closed(int64_t a) { return ret_ref; } -int64_t CS_LDK_MonitorEvent_completed(int64_t funding_txo, int64_t monitor_update_id) { +int64_t CS_LDK_MonitorEvent_completed(int64_t funding_txo, int64_t channel_id, int64_t monitor_update_id) { LDKOutPoint funding_txo_conv; funding_txo_conv.inner = untag_ptr(funding_txo); funding_txo_conv.is_owned = ptr_is_owned(funding_txo); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_completed(funding_txo_conv, monitor_update_id); + *ret_copy = MonitorEvent_completed(funding_txo_conv, channel_id_conv, monitor_update_id); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -33326,6 +40045,19 @@ int64_t CS_LDK_ChannelMonitor_get_funding_txo(int64_t this_arg) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_ChannelMonitor_channel_id(int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId ret_var = ChannelMonitor_channel_id(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + int64_tArray CS_LDK_ChannelMonitor_get_outputs_to_watch(int64_t this_arg) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -33346,7 +40078,7 @@ int64_tArray CS_LDK_ChannelMonitor_get_outputs_to_watch(int64_t this_arg) { return ret_arr; } -void CS_LDK_ChannelMonitor_load_outputs_to_watch(int64_t this_arg, int64_t filter) { +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); @@ -33355,7 +40087,10 @@ void CS_LDK_ChannelMonitor_load_outputs_to_watch(int64_t this_arg, int64_t filt void* filter_ptr = untag_ptr(filter); if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); } LDKFilter* filter_conv = (LDKFilter*)filter_ptr; - ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv); + 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) { @@ -33458,29 +40193,22 @@ int8_tArray CS_LDK_ChannelMonitor_get_counterparty_node_id(int64_t this_arg) { return ret_arr; } -ptrArray CS_LDK_ChannelMonitor_get_latest_holder_commitment_txn(int64_t this_arg, int64_t logger) { +void CS_LDK_ChannelMonitor_broadcast_latest_holder_commitment_txn(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; void* logger_ptr = untag_ptr(logger); if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - LDKTransaction ret_conv_8_var = ret_var.data[i]; - int8_tArray ret_conv_8_arr = init_int8_tArray(ret_conv_8_var.datalen, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_conv_8_var.data, ret_conv_8_var.datalen); - Transaction_free(ret_conv_8_var); - ret_arr_ptr[i] = ret_conv_8_arr; - } - - FREE(ret_var.data); - return ret_arr; + ChannelMonitor_broadcast_latest_holder_commitment_txn(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); } int64_tArray CS_LDK_ChannelMonitor_block_connected(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { @@ -33524,12 +40252,8 @@ int64_tArray CS_LDK_ChannelMonitor_block_connected(int64_t this_arg, int8_tArra LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); } void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } + 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__); @@ -33569,12 +40293,8 @@ void CS_LDK_ChannelMonitor_block_disconnected(int64_t this_arg, int8_tArray hea LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); } void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } + 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); } @@ -33619,12 +40339,8 @@ int64_tArray CS_LDK_ChannelMonitor_transactions_confirmed(int64_t this_arg, int LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); } void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } + 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__); @@ -33664,12 +40380,8 @@ void CS_LDK_ChannelMonitor_transaction_unconfirmed(int64_t this_arg, int8_tArra LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); } void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } + 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); } @@ -33698,12 +40410,8 @@ int64_tArray CS_LDK_ChannelMonitor_best_block_updated(int64_t this_arg, int8_tA LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); } void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } + 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__); @@ -33724,14 +40432,14 @@ int64_tArray CS_LDK_ChannelMonitor_get_relevant_txids(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); + 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 x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ), "LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + 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); @@ -33772,13 +40480,35 @@ void CS_LDK_ChannelMonitor_rebroadcast_pending_claims(int64_t this_arg, int64_t LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); } void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { + if (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. - LDKLogger_JCalls_cloned(&logger_conv); + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); } - ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_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) { @@ -33807,6 +40537,19 @@ int64_tArray CS_LDK_ChannelMonitor_get_spendable_outputs(int64_t this_arg, int8 return ret_arr; } +jboolean CS_LDK_ChannelMonitor_is_fully_resolved(int64_t this_arg, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + jboolean ret_conv = ChannelMonitor_is_fully_resolved(&this_arg_conv, logger_conv); + return ret_conv; +} + int64_tArray CS_LDK_ChannelMonitor_get_claimable_balances(int64_t this_arg) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -33960,15 +40703,16 @@ int64_t CS_LDK_OutPoint_hash(int64_t o) { return ret_conv; } -int8_tArray CS_LDK_OutPoint_to_channel_id(int64_t this_arg) { - LDKOutPoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, OutPoint_to_channel_id(&this_arg_conv).data, 32); - return ret_arr; +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) { @@ -33994,420 +40738,560 @@ int64_t CS_LDK_OutPoint_read(int8_tArray ser) { 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); -} - -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; +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); - ChannelManager_free(this_obj_conv); + InboundHTLCErr_free(this_obj_conv); } -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); +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; } -int32_t CS_LDK_ChainParameters_get_network(int64_t this_ptr) { - LDKChainParameters this_ptr_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; - int32_t ret_conv = LDKNetwork_to_cs(ChainParameters_get_network(&this_ptr_conv)); - return ret_conv; + InboundHTLCErr_set_err_code(&this_ptr_conv, val); } -void CS_LDK_ChainParameters_set_network(int64_t this_ptr, int32_t val) { - LDKChainParameters this_ptr_conv; +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; - LDKNetwork val_conv = LDKNetwork_from_cs(val); - ChainParameters_set_network(&this_ptr_conv, val_conv); + 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_ChainParameters_get_best_block(int64_t this_ptr) { - LDKChainParameters this_ptr_conv; +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; - 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; + 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); } -void CS_LDK_ChainParameters_set_best_block(int64_t this_ptr, int64_t val) { - LDKChainParameters this_ptr_conv; +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; - 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); + 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; } -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); +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 ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { - LDKChainParameters ret_var = ChainParameters_clone(arg); +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_ChainParameters_clone_ptr(int64_t arg) { - LDKChainParameters arg_conv; +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 = ChainParameters_clone_ptr(&arg_conv); + int64_t ret_conv = InboundHTLCErr_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChainParameters_clone(int64_t orig) { - LDKChainParameters orig_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; - LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); + 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; } -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); +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; } -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); +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; } -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); +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); } -int32_t CS_LDK_CounterpartyForwardingInfo_get_fee_proportional_millionths(int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; +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; - int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; + 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_CounterpartyForwardingInfo_set_fee_proportional_millionths(int64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; +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; - CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); + 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); } -int16_t CS_LDK_CounterpartyForwardingInfo_get_cltv_expiry_delta(int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; +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; - int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); + int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedForward_get_failure(&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; +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; - CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); + LDKBlindedFailure val_conv = LDKBlindedFailure_from_cs(val); + BlindedForward_set_failure(&this_ptr_conv, val_conv); } -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 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 CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); +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_CounterpartyForwardingInfo_clone_ptr(int64_t arg) { - LDKCounterpartyForwardingInfo arg_conv; +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 = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedForward_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_CounterpartyForwardingInfo_clone(int64_t orig) { - LDKCounterpartyForwardingInfo orig_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; - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); + 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; } -void CS_LDK_ChannelCounterparty_free(int64_t this_obj) { - LDKChannelCounterparty this_obj_conv; +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); + a_conv.is_owned = false; + LDKBlindedForward b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BlindedForward_eq(&a_conv, &b_conv); + return ret_conv; +} + +void 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); - ChannelCounterparty_free(this_obj_conv); + PendingHTLCInfo_free(this_obj_conv); } -int8_tArray CS_LDK_ChannelCounterparty_get_node_id(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_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; - 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; + 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_ChannelCounterparty_set_node_id(int64_t this_ptr, int8_tArray val) { - LDKChannelCounterparty this_ptr_conv; +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; - 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); + 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); } -int64_t CS_LDK_ChannelCounterparty_get_features(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_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; - 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; + 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_ChannelCounterparty_set_features(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; +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; - 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); + 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); } -int64_t CS_LDK_ChannelCounterparty_get_unspendable_punishment_reserve(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; +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; - int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); - return ret_conv; + 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_ChannelCounterparty_set_unspendable_punishment_reserve(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_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; - ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); + 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_ChannelCounterparty_get_forwarding_info(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; +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; - 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); + 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_ChannelCounterparty_set_forwarding_info(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; +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; - LDKCounterpartyForwardingInfo val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = CounterpartyForwardingInfo_clone(&val_conv); - ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); + void* 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_ChannelCounterparty_get_outbound_htlc_minimum_msat(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_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; - 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 ret_conv = PendingHTLCInfo_get_outgoing_amt_msat(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelCounterparty_set_outbound_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_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; - 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); + PendingHTLCInfo_set_outgoing_amt_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelCounterparty_get_outbound_htlc_maximum_msat(int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; +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 = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv); + *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_ChannelCounterparty_set_outbound_htlc_maximum_msat(int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; +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); @@ -34416,1039 +41300,437 @@ void CS_LDK_ChannelCounterparty_set_outbound_htlc_maximum_msat(int64_t this_ptr 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); + PendingHTLCInfo_set_skimmed_fee_msat(&this_ptr_conv, val_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_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 ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { - LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); +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_ChannelCounterparty_clone_ptr(int64_t arg) { - LDKChannelCounterparty arg_conv; +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 = ChannelCounterparty_clone_ptr(&arg_conv); + int64_t ret_conv = PendingHTLCInfo_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelCounterparty_clone(int64_t orig) { - LDKChannelCounterparty orig_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; - LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); + 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; } -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); +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; } -int8_tArray CS_LDK_ChannelDetails_get_channel_id(int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ChannelDetails_get_channel_id(&this_ptr_conv), 32); - return ret_arr; +int32_t CS_LDK_BlindedFailure_from_introduction_node() { + int32_t ret_conv = LDKBlindedFailure_to_cs(BlindedFailure_from_introduction_node()); + return ret_conv; } -void CS_LDK_ChannelDetails_set_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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); +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_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 ret_ref = 0; - CHECK_INNER_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_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_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); +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_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 ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +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); } -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); +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_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; - 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_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; - 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_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_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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_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; } -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); - 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_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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv); +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; } -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); - 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_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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); +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; } -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); - 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_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; - int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); - return ret_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; - ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); +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_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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); +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_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; - 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); +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); } -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(16, __LINE__); - memcpy(ret_arr->elems, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes, 16); - return ret_arr; +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_ChannelDetails_set_user_channel_id(int64_t this_ptr, int8_tArray val) { - LDKChannelDetails 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; - 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); + int32_t ret_conv = LDKNetwork_to_cs(ChainParameters_get_network(&this_ptr_conv)); + return ret_conv; } -int64_t CS_LDK_ChannelDetails_get_feerate_sat_per_1000_weight(int64_t this_ptr) { - LDKChannelDetails 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; - 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; + LDKNetwork val_conv = LDKNetwork_from_cs(val); + ChainParameters_set_network(&this_ptr_conv, val_conv); } -void CS_LDK_ChannelDetails_set_feerate_sat_per_1000_weight(int64_t this_ptr, int64_t val) { - LDKChannelDetails 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; - 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); + 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_ChannelDetails_get_balance_msat(int64_t this_ptr) { - LDKChannelDetails 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; - int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); - return ret_conv; + 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_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); +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_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); +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_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_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; } -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_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); } -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); +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_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); +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_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_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; +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; } -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_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_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 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; } -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_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_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 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_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); +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_t CS_LDK_ChannelDetails_get_force_close_spend_delay(int64_t this_ptr) { - LDKChannelDetails this_ptr_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; - 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; + 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; } -void CS_LDK_ChannelDetails_set_force_close_spend_delay(int64_t this_ptr, int64_t val) { - LDKChannelDetails 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; - 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); + 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); } -jboolean CS_LDK_ChannelDetails_get_is_outbound(int64_t this_ptr) { - LDKChannelDetails 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; - jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv); + int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); return ret_conv; } -void CS_LDK_ChannelDetails_set_is_outbound(int64_t this_ptr, jboolean val) { - LDKChannelDetails 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; - ChannelDetails_set_is_outbound(&this_ptr_conv, val); + PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); } -jboolean CS_LDK_ChannelDetails_get_is_channel_ready(int64_t this_ptr) { - LDKChannelDetails 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; - jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_ChannelDetails_set_is_channel_ready(int64_t this_ptr, jboolean val) { - LDKChannelDetails 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; - ChannelDetails_set_is_channel_ready(&this_ptr_conv, val); -} - -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; -} - -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); -} - -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_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); -} - -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; -} - -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); -} - -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; -} - -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_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; -} - -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_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; -} - -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); -} - -int64_t CS_LDK_ChannelDetails_new(int8_tArray channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t channel_type_arg, int64_t short_channel_id_arg, int64_t outbound_scid_alias_arg, int64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int8_tArray user_channel_id_arg, int64_t feerate_sat_per_1000_weight_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t next_outbound_htlc_minimum_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t confirmations_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, int64_t channel_shutdown_state_arg, jboolean is_usable_arg, jboolean is_public_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_t config_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); - LDKChannelCounterparty counterparty_arg_conv; - counterparty_arg_conv.inner = untag_ptr(counterparty_arg); - counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); - counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); - LDKOutPoint funding_txo_arg_conv; - funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg); - funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); - funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); - LDKChannelTypeFeatures channel_type_arg_conv; - channel_type_arg_conv.inner = untag_ptr(channel_type_arg); - channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); - channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); - void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg); - CHECK_ACCESS(short_channel_id_arg_ptr); - LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); - short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg)); - void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg); - CHECK_ACCESS(outbound_scid_alias_arg_ptr); - LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr); - outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg)); - void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg); - CHECK_ACCESS(inbound_scid_alias_arg_ptr); - LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr); - inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg)); - void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg); - CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); - LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); - LDKU128 user_channel_id_arg_ref; - CHECK(user_channel_id_arg->arr_len == 16); - memcpy(user_channel_id_arg_ref.le_bytes, user_channel_id_arg->elems, 16); FREE(user_channel_id_arg); - void* feerate_sat_per_1000_weight_arg_ptr = untag_ptr(feerate_sat_per_1000_weight_arg); - CHECK_ACCESS(feerate_sat_per_1000_weight_arg_ptr); - LDKCOption_u32Z feerate_sat_per_1000_weight_arg_conv = *(LDKCOption_u32Z*)(feerate_sat_per_1000_weight_arg_ptr); - feerate_sat_per_1000_weight_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(feerate_sat_per_1000_weight_arg)); - void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg); - CHECK_ACCESS(confirmations_required_arg_ptr); - LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr); - confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg)); - void* confirmations_arg_ptr = untag_ptr(confirmations_arg); - CHECK_ACCESS(confirmations_arg_ptr); - LDKCOption_u32Z confirmations_arg_conv = *(LDKCOption_u32Z*)(confirmations_arg_ptr); - confirmations_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_arg)); - void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg); - CHECK_ACCESS(force_close_spend_delay_arg_ptr); - LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); - force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg)); - void* channel_shutdown_state_arg_ptr = untag_ptr(channel_shutdown_state_arg); - CHECK_ACCESS(channel_shutdown_state_arg_ptr); - LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg_conv = *(LDKCOption_ChannelShutdownStateZ*)(channel_shutdown_state_arg_ptr); - channel_shutdown_state_arg_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(channel_shutdown_state_arg)); - void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg); - CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr); - LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr); - inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg)); - void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg); - CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr); - LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr); - inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg)); - LDKChannelConfig config_arg_conv; - config_arg_conv.inner = untag_ptr(config_arg); - config_arg_conv.is_owned = ptr_is_owned(config_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv); - config_arg_conv = ChannelConfig_clone(&config_arg_conv); - LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg_conv, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { - LDKChannelDetails ret_var = ChannelDetails_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_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; - arg_conv.inner = untag_ptr(arg); - arg_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); - return ret_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; - 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_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; -} - -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; - 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; -} - -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; -} - -int32_t CS_LDK_ChannelShutdownState_not_shutting_down() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_not_shutting_down()); - return ret_conv; -} - -int32_t CS_LDK_ChannelShutdownState_shutdown_initiated() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_initiated()); - return ret_conv; -} - -int32_t CS_LDK_ChannelShutdownState_resolving_htlcs() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_resolving_htlcs()); - return ret_conv; -} - -int32_t CS_LDK_ChannelShutdownState_negotiating_closing_fee() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_negotiating_closing_fee()); - return ret_conv; -} - -int32_t CS_LDK_ChannelShutdownState_shutdown_complete() { - int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_complete()); - return ret_conv; -} - -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; -} - -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; -} - -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; - 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; -} - -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_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; -} - -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); -} - -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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void 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; - 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); + 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) { @@ -35596,7 +41878,7 @@ int64_t CS_LDK_ChannelManager_get_current_default_configuration(int64_t this_ar return ret_ref; } -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 override_config) { +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); @@ -35608,13 +41890,18 @@ int64_t CS_LDK_ChannelManager_create_channel(int64_t this_arg, int8_tArray thei LDKU128 user_channel_id_ref; CHECK(user_channel_id->arr_len == 16); memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); LDKUserConfig override_config_conv; override_config_conv.inner = untag_ptr(override_config); override_config_conv.is_owned = ptr_is_owned(override_config); CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); override_config_conv = UserConfig_clone(&override_config_conv); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, 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); } @@ -35708,34 +41995,36 @@ int64_tArray CS_LDK_ChannelManager_list_recent_payments(int64_t this_arg) { return ret_arr; } -int64_t CS_LDK_ChannelManager_close_channel(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { +int64_t CS_LDK_ChannelManager_close_channel(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t channel_id_arr[32]; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); - uint8_t (*channel_id_ref)[32] = &channel_id_arr; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref); + *ret_conv = ChannelManager_close_channel(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id, int64_t target_feerate_sats_per_1000_weight, int64_t shutdown_script) { +int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, int64_t target_feerate_sats_per_1000_weight, int64_t shutdown_script) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t channel_id_arr[32]; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); - uint8_t (*channel_id_ref)[32] = &channel_id_arr; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); @@ -35749,43 +42038,45 @@ int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t thi CHECK_INNER_FIELD_ACCESS_OR_NULL(shutdown_script_conv); shutdown_script_conv = ShutdownScript_clone(&shutdown_script_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel_with_feerate_and_script(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight_conv, shutdown_script_conv); + *ret_conv = ChannelManager_close_channel_with_feerate_and_script(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, target_feerate_sats_per_1000_weight_conv, shutdown_script_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { +int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t channel_id_arr[32]; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); - uint8_t (*channel_id_ref)[32] = &channel_id_arr; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { +int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t channel_id_arr[32]; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); - uint8_t (*channel_id_ref)[32] = &channel_id_arr; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv.is_owned = false; LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); return tag_ptr(ret_conv, true); } @@ -35991,16 +42282,17 @@ int64_t CS_LDK_ChannelManager_send_preflight_probes(int64_t this_arg, int64_t r return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { +int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t temporary_channel_id_arr[32]; - CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id); - uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv.is_owned = false; LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); @@ -36010,7 +42302,7 @@ int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, i memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); funding_transaction_ref.data_is_owned = true; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref); + *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, funding_transaction_ref); return tag_ptr(ret_conv, true); } @@ -36020,20 +42312,20 @@ int64_t CS_LDK_ChannelManager_batch_funding_transaction_generated(int64_t this_ this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ temporary_channels_constr; + LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels_constr; temporary_channels_constr.datalen = temporary_channels->arr_len; if (temporary_channels_constr.datalen > 0) - temporary_channels_constr.data = MALLOC(temporary_channels_constr.datalen * sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ), "LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ Elements"); + temporary_channels_constr.data = MALLOC(temporary_channels_constr.datalen * sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ Elements"); else temporary_channels_constr.data = NULL; int64_t* temporary_channels_vals = temporary_channels->elems; - for (size_t j = 0; j < temporary_channels_constr.datalen; j++) { - int64_t temporary_channels_conv_35 = temporary_channels_vals[j]; - void* temporary_channels_conv_35_ptr = untag_ptr(temporary_channels_conv_35); - CHECK_ACCESS(temporary_channels_conv_35_ptr); - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ temporary_channels_conv_35_conv = *(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)(temporary_channels_conv_35_ptr); - temporary_channels_conv_35_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone((LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(temporary_channels_conv_35)); - temporary_channels_constr.data[j] = temporary_channels_conv_35_conv; + for (size_t e = 0; e < temporary_channels_constr.datalen; e++) { + int64_t temporary_channels_conv_30 = temporary_channels_vals[e]; + void* temporary_channels_conv_30_ptr = untag_ptr(temporary_channels_conv_30); + CHECK_ACCESS(temporary_channels_conv_30_ptr); + LDKC2Tuple_ChannelIdPublicKeyZ temporary_channels_conv_30_conv = *(LDKC2Tuple_ChannelIdPublicKeyZ*)(temporary_channels_conv_30_ptr); + temporary_channels_conv_30_conv = C2Tuple_ChannelIdPublicKeyZ_clone((LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(temporary_channels_conv_30)); + temporary_channels_constr.data[e] = temporary_channels_conv_30_conv; } FREE(temporary_channels); LDKTransaction funding_transaction_ref; @@ -36046,7 +42338,7 @@ int64_t CS_LDK_ChannelManager_batch_funding_transaction_generated(int64_t this_ return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, ptrArray channel_ids, int64_t config_update) { +int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config_update) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -36055,19 +42347,21 @@ int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, i LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCVec_ThirtyTwoBytesZ channel_ids_constr; + LDKCVec_ChannelIdZ channel_ids_constr; channel_ids_constr.datalen = channel_ids->arr_len; if (channel_ids_constr.datalen > 0) - channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); else channel_ids_constr.data = NULL; - int8_tArray* channel_ids_vals = (void*) channel_ids->elems; - for (size_t i = 0; i < channel_ids_constr.datalen; i++) { - int8_tArray channel_ids_conv_8 = channel_ids_vals[i]; - LDKThirtyTwoBytes channel_ids_conv_8_ref; - CHECK(channel_ids_conv_8->arr_len == 32); - memcpy(channel_ids_conv_8_ref.data, channel_ids_conv_8->elems, 32); FREE(channel_ids_conv_8); - channel_ids_constr.data[i] = channel_ids_conv_8_ref; + int64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + int64_t channel_ids_conv_11 = channel_ids_vals[l]; + LDKChannelId channel_ids_conv_11_conv; + channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); + channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); + channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); + channel_ids_constr.data[l] = channel_ids_conv_11_conv; } FREE(channel_ids); LDKChannelConfigUpdate config_update_conv; @@ -36080,7 +42374,7 @@ int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, i return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, ptrArray channel_ids, int64_t config) { +int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -36089,19 +42383,21 @@ int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArr LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCVec_ThirtyTwoBytesZ channel_ids_constr; + LDKCVec_ChannelIdZ channel_ids_constr; channel_ids_constr.datalen = channel_ids->arr_len; if (channel_ids_constr.datalen > 0) - channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); else channel_ids_constr.data = NULL; - int8_tArray* channel_ids_vals = (void*) channel_ids->elems; - for (size_t i = 0; i < channel_ids_constr.datalen; i++) { - int8_tArray channel_ids_conv_8 = channel_ids_vals[i]; - LDKThirtyTwoBytes channel_ids_conv_8_ref; - CHECK(channel_ids_conv_8->arr_len == 32); - memcpy(channel_ids_conv_8_ref.data, channel_ids_conv_8->elems, 32); FREE(channel_ids_conv_8); - channel_ids_constr.data[i] = channel_ids_conv_8_ref; + int64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + int64_t channel_ids_conv_11 = channel_ids_vals[l]; + LDKChannelId channel_ids_conv_11_conv; + channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); + channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); + channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); + channel_ids_constr.data[l] = channel_ids_conv_11_conv; } FREE(channel_ids); LDKChannelConfig config_conv; @@ -36114,7 +42410,7 @@ int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArr return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id, int8_tArray next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) { +int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id, int64_t next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -36123,15 +42419,16 @@ int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_t LDKThirtyTwoBytes intercept_id_ref; CHECK(intercept_id->arr_len == 32); memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); - uint8_t next_hop_channel_id_arr[32]; - CHECK(next_hop_channel_id->arr_len == 32); - memcpy(next_hop_channel_id_arr, next_hop_channel_id->elems, 32); FREE(next_hop_channel_id); - uint8_t (*next_hop_channel_id_ref)[32] = &next_hop_channel_id_arr; + LDKChannelId next_hop_channel_id_conv; + next_hop_channel_id_conv.inner = untag_ptr(next_hop_channel_id); + next_hop_channel_id_conv.is_owned = ptr_is_owned(next_hop_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(next_hop_channel_id_conv); + next_hop_channel_id_conv.is_owned = false; LDKPublicKey next_node_id_ref; CHECK(next_node_id->arr_len == 33); memcpy(next_node_id_ref.compressed_form, next_node_id->elems, 33); FREE(next_node_id); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, next_hop_channel_id_ref, next_node_id_ref, amt_to_forward_msat); + *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, &next_hop_channel_id_conv, next_node_id_ref, amt_to_forward_msat); return tag_ptr(ret_conv, true); } @@ -36232,16 +42529,17 @@ int8_tArray CS_LDK_ChannelManager_get_our_node_id(int64_t this_arg) { return ret_arr; } -int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { +int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t temporary_channel_id_arr[32]; - CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id); - uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv.is_owned = false; LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); @@ -36249,20 +42547,21 @@ int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int8_tAr CHECK(user_channel_id->arr_len == 16); memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref); + *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { +int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(int64_t this_arg, int64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t temporary_channel_id_arr[32]; - CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id); - uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv.is_owned = false; LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); @@ -36270,40 +42569,73 @@ int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(in CHECK(user_channel_id->arr_len == 16); memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref); + *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_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) { +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; - 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)); + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_ChannelManager_create_refund_builder(int64_t this_arg, int64_t amount_msats, int64_t absolute_expiry, int8_tArray payment_id, int64_t retry_strategy, int64_t max_total_routing_fee_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); + CHECK_ACCESS(max_total_routing_fee_msat_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); + max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_create_refund_builder(&this_arg_conv, amount_msats, absolute_expiry, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); + return tag_ptr(ret_conv, true); +} + +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); @@ -36324,7 +42656,7 @@ int64_t CS_LDK_ChannelManager_request_refund_payment(int64_t this_arg, int64_t refund_conv.is_owned = ptr_is_owned(refund); CHECK_INNER_FIELD_ACCESS_OR_NULL(refund_conv); refund_conv.is_owned = false; - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); *ret_conv = ChannelManager_request_refund_payment(&this_arg_conv, &refund_conv); return tag_ptr(ret_conv, true); } @@ -36587,6 +42919,17 @@ int64_t CS_LDK_ChannelManager_as_OffersMessageHandler(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int64_t CS_LDK_ChannelManager_as_NodeIdLookUp(int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *ret_ret = ChannelManager_as_NodeIdLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + int64_t CS_LDK_provided_init_features(int64_t config) { LDKUserConfig config_conv; config_conv.inner = untag_ptr(config); @@ -36600,130 +42943,126 @@ int64_t CS_LDK_provided_init_features(int64_t config) { return ret_ref; } -int8_tArray CS_LDK_CounterpartyForwardingInfo_write(int64_t obj) { - LDKCounterpartyForwardingInfo obj_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 = CounterpartyForwardingInfo_write(&obj_conv); + 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_CounterpartyForwardingInfo_read(int8_tArray ser) { +int64_t CS_LDK_PhantomRouteHints_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CounterpartyForwardingInfo_read(ser_ref); + LDKCResult_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_ChannelCounterparty_write(int64_t obj) { - LDKChannelCounterparty obj_conv; +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 = ChannelCounterparty_write(&obj_conv); + 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_read(int8_tArray ser) { +int64_t CS_LDK_BlindedForward_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); + 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_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 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_ChannelDetails_read(int8_tArray ser) { +int64_t CS_LDK_PendingHTLCRouting_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); + 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_PhantomRouteHints_write(int64_t obj) { - LDKPhantomRouteHints obj_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 = PhantomRouteHints_write(&obj_conv); + 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_PhantomRouteHints_read(int8_tArray ser) { +int64_t CS_LDK_PendingHTLCInfo_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = PhantomRouteHints_read(ser_ref); + LDKCResult_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_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; -} - -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 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_ChannelShutdownState_read(int8_tArray ser) { +int64_t CS_LDK_BlindedFailure_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_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); @@ -36751,328 +43090,3072 @@ void CS_LDK_ChannelManagerReadArgs_set_entropy_source(int64_t this_ptr, int64_t 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); + 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_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; + // 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_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); + 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_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; + // 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_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); + 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_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; + // 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_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); + 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_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; + // 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_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; + 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_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; + // 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_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); + 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); +} + +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; + // 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_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; + 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_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; + // 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_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); + 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_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; + 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_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; + 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); +} + +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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void 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; + 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; +} + +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_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; +} + +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; +} + +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); +} + +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; + 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_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; + 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; +} + +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; +} + +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; +} + +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_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; +} + +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; +} + +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_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_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); +} + +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; + 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_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; + 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_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; +} + +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 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); + 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; +} + +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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, HtlcBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +int8_tArray CS_LDK_HtlcBasepoint_derive_add_tweak(int64_t this_arg, int8_tArray per_commitment_point) { + LDKHtlcBasepoint this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey per_commitment_point_ref; + CHECK(per_commitment_point->arr_len == 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, HtlcBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); + return ret_arr; +} + +int8_tArray CS_LDK_HtlcBasepoint_write(int64_t obj) { + LDKHtlcBasepoint obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_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; +} + +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); +} + +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); +} + +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; +} + +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); +} + +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_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; +} + +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_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_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; +} + +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); +} + +int8_tArray CS_LDK_add_public_key_tweak(int8_tArray base_point, int8_tArray tweak) { + LDKPublicKey base_point_ref; + CHECK(base_point->arr_len == 33); + memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point); + uint8_t tweak_arr[32]; + CHECK(tweak->arr_len == 32); + memcpy(tweak_arr, tweak->elems, 32); FREE(tweak); + uint8_t (*tweak_ref)[32] = &tweak_arr; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, add_public_key_tweak(base_point_ref, tweak_ref).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_RevocationBasepoint_free(int64_t this_obj) { + LDKRevocationBasepoint this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + 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_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, RevocationBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +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); + 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); +} + +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; +} + +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_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 = RevocationBasepoint_clone_ptr(&arg_conv); + return ret_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; + 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_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; +} + +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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, RevocationBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +int8_tArray 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); +} + +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; +} + +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_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_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; +} + +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; +} + +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); +} + +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; +} + +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; +} + +int32_t CS_LDK_InboundHTLCStateDetails_committed() { + int32_t ret_conv = LDKInboundHTLCStateDetails_to_cs(InboundHTLCStateDetails_committed()); + return ret_conv; +} + +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; +} + +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; +} + +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_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); +} + +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_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; +} + +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_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; +} + +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); +} + +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; +} + +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); +} + +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; +} + +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); +} + +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_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); +} + +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_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); +} + +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; +} + +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; +} + +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_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); +} + +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; +} + +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; +} + +int32_t CS_LDK_OutboundHTLCStateDetails_committed() { + int32_t ret_conv = LDKOutboundHTLCStateDetails_to_cs(OutboundHTLCStateDetails_committed()); + return ret_conv; +} + +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; +} + +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; +} + +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_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); +} + +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_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; +} + +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); +} + +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; +} + +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); +} + +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; +} + +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_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; +} + +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_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; +} + +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; +} + +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_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; +} + +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_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; +} + +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; +} + +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_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; +} + +int8_tArray CS_LDK_CounterpartyForwardingInfo_write(int64_t obj) { + LDKCounterpartyForwardingInfo obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_CounterpartyForwardingInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CounterpartyForwardingInfo_read(ser_ref); + FREE(ser); + 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); +} + +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; +} + +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_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; +} + +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); + 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 ret_ref = 0; + CHECK_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_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; +} + +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_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; +} + +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); +} + +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; +} + +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; +} + +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 = 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_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_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 ret_ref = 0; + CHECK_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 ret_ref = 0; + CHECK_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_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 ret_ref = 0; + CHECK_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); +} + +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; + 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_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; + 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_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; + 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_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); + 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_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; + 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_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); + 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_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; + 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_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); + 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_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; + int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); + return ret_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; + ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); +} + +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; + 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_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; + 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_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(16, __LINE__); + memcpy(ret_arr->elems, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes, 16); + return ret_arr; +} + +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; + 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); +} + +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; +} + +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_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; +} + +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); +} + +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; +} + +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_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_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_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; +} + +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_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; +} + +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_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_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_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; +} + +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); +} + +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; +} + +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); } -int64_t CS_LDK_ChannelManagerReadArgs_get_node_signer(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_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; - // 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; + jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelManagerReadArgs_set_node_signer(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +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; - 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); + ChannelDetails_set_is_outbound(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManagerReadArgs_get_signer_provider(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_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; - // 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; + jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelManagerReadArgs_set_signer_provider(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +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; - 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); + ChannelDetails_set_is_channel_ready(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManagerReadArgs_get_fee_estimator(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_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; - // 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; + 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; } -void CS_LDK_ChannelManagerReadArgs_set_fee_estimator(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_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); - 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); + 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_ChannelManagerReadArgs_get_chain_monitor(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +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; - // 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; + jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelManagerReadArgs_set_chain_monitor(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_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; - 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); + ChannelDetails_set_is_usable(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManagerReadArgs_get_tx_broadcaster(int64_t this_ptr) { - LDKChannelManagerReadArgs 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; - // 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; + jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + return ret_conv; } -void CS_LDK_ChannelManagerReadArgs_set_tx_broadcaster(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs 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; - 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); + ChannelDetails_set_is_public(&this_ptr_conv, val); } -int64_t CS_LDK_ChannelManagerReadArgs_get_router(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +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; - // 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_htlc_minimum_msat(&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_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); - 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_htlc_minimum_msat(&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_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; - // 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; + 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; } -void CS_LDK_ChannelManagerReadArgs_set_logger(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +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); - 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); + 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_ChannelManagerReadArgs_get_default_config(int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +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; - LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); + 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; } -void CS_LDK_ChannelManagerReadArgs_set_default_config(int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +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; - LDKUserConfig val_conv; + 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 = UserConfig_clone(&val_conv); - ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); + val_conv = ChannelConfig_clone(&val_conv); + ChannelDetails_set_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); +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; } - 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); + + FREE(ret_var.data); + return ret_arr; +} + +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; } - 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); + FREE(val); + ChannelDetails_set_pending_inbound_htlcs(&this_ptr_conv, val_constr); +} + +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; + 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; } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); + + FREE(ret_var.data); + return ret_arr; +} + +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; + 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; } - 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"); + FREE(val); + ChannelDetails_set_pending_outbound_htlcs(&this_ptr_conv, val_constr); +} + +int64_t CS_LDK_ChannelDetails_new(int64_t channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t channel_type_arg, int64_t short_channel_id_arg, int64_t outbound_scid_alias_arg, int64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int8_tArray user_channel_id_arg, int64_t feerate_sat_per_1000_weight_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t next_outbound_htlc_minimum_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t confirmations_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, int64_t channel_shutdown_state_arg, jboolean is_usable_arg, jboolean is_public_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_t config_arg, int64_tArray pending_inbound_htlcs_arg, int64_tArray pending_outbound_htlcs_arg) { + 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 - 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; + 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(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); + 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; } -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; +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_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); - // 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); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv); + return ret_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; + 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_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; +} + +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; + 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_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_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); +} + +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; +} + +int32_t CS_LDK_ChannelShutdownState_not_shutting_down() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_not_shutting_down()); + return ret_conv; +} + +int32_t CS_LDK_ChannelShutdownState_shutdown_initiated() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_initiated()); + return ret_conv; +} + +int32_t CS_LDK_ChannelShutdownState_resolving_htlcs() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_resolving_htlcs()); + return ret_conv; +} + +int32_t CS_LDK_ChannelShutdownState_negotiating_closing_fee() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_negotiating_closing_fee()); + return ret_conv; +} + +int32_t CS_LDK_ChannelShutdownState_shutdown_complete() { + int32_t ret_conv = LDKChannelShutdownState_to_cs(ChannelShutdownState_shutdown_complete()); + return ret_conv; +} + +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_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_ChannelShutdownState_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = ChannelShutdownState_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } @@ -37220,6 +46303,19 @@ int64_t CS_LDK_DecodeError_unsupported_compression() { return ret_ref; } +int64_t CS_LDK_DecodeError_dangerous_value() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_dangerous_value(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_DecodeError_hash(int64_t o) { + LDKDecodeError* o_conv = (LDKDecodeError*)untag_ptr(o); + int64_t ret_conv = DecodeError_hash(o_conv); + return ret_conv; +} + jboolean CS_LDK_DecodeError_eq(int64_t a, int64_t b) { LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a); LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b); @@ -37362,1201 +46458,686 @@ int64_t CS_LDK_Init_clone(int64_t orig) { return ret_ref; } -jboolean CS_LDK_Init_eq(int64_t a, int64_t b) { - LDKInit a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKInit b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Init_eq(&a_conv, &b_conv); - return ret_conv; -} - -void CS_LDK_ErrorMessage_free(int64_t this_obj) { - LDKErrorMessage this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ErrorMessage_free(this_obj_conv); -} - -int8_tArray CS_LDK_ErrorMessage_get_channel_id(int64_t this_ptr) { - LDKErrorMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_ErrorMessage_set_channel_id(int64_t this_ptr, int8_tArray val) { - LDKErrorMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ErrorMessage_set_channel_id(&this_ptr_conv, val_ref); -} - -jstring CS_LDK_ErrorMessage_get_data(int64_t this_ptr) { - LDKErrorMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = ErrorMessage_get_data(&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_ErrorMessage_set_data(int64_t this_ptr, jstring val) { - LDKErrorMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - ErrorMessage_set_data(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_ErrorMessage_new(int8_tArray channel_id_arg, jstring data_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); - LDKStr data_arg_conv = str_ref_to_owned_c(data_arg); - LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { - LDKErrorMessage ret_var = ErrorMessage_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_ErrorMessage_clone_ptr(int64_t arg) { - LDKErrorMessage arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_ErrorMessage_clone(int64_t orig) { - LDKErrorMessage orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); - int64_t ret_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_ErrorMessage_eq(int64_t a, int64_t b) { - LDKErrorMessage a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKErrorMessage b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv); - return ret_conv; -} - -void CS_LDK_WarningMessage_free(int64_t this_obj) { - LDKWarningMessage this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - WarningMessage_free(this_obj_conv); -} - -int8_tArray CS_LDK_WarningMessage_get_channel_id(int64_t this_ptr) { - LDKWarningMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *WarningMessage_get_channel_id(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_WarningMessage_set_channel_id(int64_t this_ptr, int8_tArray val) { - LDKWarningMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - WarningMessage_set_channel_id(&this_ptr_conv, val_ref); -} - -jstring CS_LDK_WarningMessage_get_data(int64_t this_ptr) { - LDKWarningMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr ret_str = WarningMessage_get_data(&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_WarningMessage_set_data(int64_t this_ptr, jstring val) { - LDKWarningMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - WarningMessage_set_data(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_WarningMessage_new(int8_tArray channel_id_arg, jstring data_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); - LDKStr data_arg_conv = str_ref_to_owned_c(data_arg); - LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) { - LDKWarningMessage ret_var = WarningMessage_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_WarningMessage_clone_ptr(int64_t arg) { - LDKWarningMessage arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_WarningMessage_clone(int64_t orig) { - LDKWarningMessage orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv); - int64_t ret_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_WarningMessage_eq(int64_t a, int64_t b) { - LDKWarningMessage a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKWarningMessage b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv); - return ret_conv; -} - -void CS_LDK_Ping_free(int64_t this_obj) { - LDKPing this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Ping_free(this_obj_conv); -} - -int16_t CS_LDK_Ping_get_ponglen(int64_t this_ptr) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_Ping_set_ponglen(int64_t this_ptr, int16_t val) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Ping_set_ponglen(&this_ptr_conv, val); -} - -int16_t CS_LDK_Ping_get_byteslen(int64_t this_ptr) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_Ping_set_byteslen(int64_t this_ptr, int16_t val) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Ping_set_byteslen(&this_ptr_conv, val); -} - -int64_t CS_LDK_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) { - LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { - LDKPing ret_var = Ping_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_Ping_clone_ptr(int64_t arg) { - LDKPing arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Ping_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_Ping_clone(int64_t orig) { - LDKPing orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKPing ret_var = Ping_clone(&orig_conv); - int64_t ret_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_Ping_eq(int64_t a, int64_t b) { - LDKPing a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPing b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Ping_eq(&a_conv, &b_conv); - return ret_conv; -} - -void CS_LDK_Pong_free(int64_t this_obj) { - LDKPong this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Pong_free(this_obj_conv); -} - -int16_t CS_LDK_Pong_get_byteslen(int64_t this_ptr) { - LDKPong this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_Pong_set_byteslen(int64_t this_ptr, int16_t val) { - LDKPong this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Pong_set_byteslen(&this_ptr_conv, val); -} - -int64_t CS_LDK_Pong_new(int16_t byteslen_arg) { - LDKPong ret_var = Pong_new(byteslen_arg); - int64_t ret_ref = 0; - 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 Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { - LDKPong ret_var = Pong_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} -int64_t CS_LDK_Pong_clone_ptr(int64_t arg) { - LDKPong arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Pong_clone_ptr(&arg_conv); - return ret_conv; -} - -int64_t CS_LDK_Pong_clone(int64_t orig) { - LDKPong orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKPong ret_var = Pong_clone(&orig_conv); - int64_t ret_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_Pong_eq(int64_t a, int64_t b) { - LDKPong a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPong b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Pong_eq(&a_conv, &b_conv); - return ret_conv; -} - -void CS_LDK_OpenChannel_free(int64_t this_obj) { - LDKOpenChannel this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OpenChannel_free(this_obj_conv); -} - -int8_tArray CS_LDK_OpenChannel_get_chain_hash(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *OpenChannel_get_chain_hash(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_OpenChannel_set_chain_hash(int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - OpenChannel_set_chain_hash(&this_ptr_conv, val_ref); -} - -int8_tArray CS_LDK_OpenChannel_get_temporary_channel_id(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_OpenChannel_set_temporary_channel_id(int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); -} - -int64_t CS_LDK_OpenChannel_get_funding_satoshis(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_funding_satoshis(int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_funding_satoshis(&this_ptr_conv, val); -} - -int64_t CS_LDK_OpenChannel_get_push_msat(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_push_msat(int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_push_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_OpenChannel_get_dust_limit_satoshis(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); -} - -int64_t CS_LDK_OpenChannel_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); +int64_t CS_LDK_Init_hash(int64_t o) { + LDKInit o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Init_hash(&o_conv); return ret_conv; } -void CS_LDK_OpenChannel_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); -} - -int64_t CS_LDK_OpenChannel_get_channel_reserve_satoshis(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); +jboolean CS_LDK_Init_eq(int64_t a, int64_t b) { + LDKInit a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInit b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Init_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_OpenChannel_set_channel_reserve_satoshis(int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); +void CS_LDK_ErrorMessage_free(int64_t this_obj) { + LDKErrorMessage this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ErrorMessage_free(this_obj_conv); } -int64_t CS_LDK_OpenChannel_get_htlc_minimum_msat(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +int64_t CS_LDK_ErrorMessage_get_channel_id(int64_t this_ptr) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + LDKChannelId ret_var = ErrorMessage_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_OpenChannel_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; +void CS_LDK_ErrorMessage_set_channel_id(int64_t this_ptr, int64_t val) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + ErrorMessage_set_channel_id(&this_ptr_conv, val_conv); } -int32_t CS_LDK_OpenChannel_get_feerate_per_kw(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +jstring CS_LDK_ErrorMessage_get_data(int64_t this_ptr) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv); + LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -void CS_LDK_OpenChannel_set_feerate_per_kw(int64_t this_ptr, int32_t val) { - LDKOpenChannel this_ptr_conv; +void CS_LDK_ErrorMessage_set_data(int64_t this_ptr, jstring val) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); + LDKStr val_conv = str_ref_to_owned_c(val); + ErrorMessage_set_data(&this_ptr_conv, val_conv); } -int16_t CS_LDK_OpenChannel_get_to_self_delay(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv); - return ret_conv; +int64_t CS_LDK_ErrorMessage_new(int64_t channel_id_arg, jstring data_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKStr data_arg_conv = str_ref_to_owned_c(data_arg); + LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_conv, data_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_OpenChannel_set_to_self_delay(int64_t this_ptr, int16_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_to_self_delay(&this_ptr_conv, val); +static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { + LDKErrorMessage ret_var = ErrorMessage_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -int16_t CS_LDK_OpenChannel_get_max_accepted_htlcs(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); +int64_t CS_LDK_ErrorMessage_clone_ptr(int64_t arg) { + LDKErrorMessage arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_OpenChannel_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); +int64_t CS_LDK_ErrorMessage_clone(int64_t orig) { + LDKErrorMessage orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); + int64_t ret_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_OpenChannel_get_funding_pubkey(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_ErrorMessage_hash(int64_t o) { + LDKErrorMessage o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ErrorMessage_hash(&o_conv); + return ret_conv; } -void CS_LDK_OpenChannel_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref); +jboolean CS_LDK_ErrorMessage_eq(int64_t a, int64_t b) { + LDKErrorMessage a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKErrorMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv); + return ret_conv; } -int8_tArray CS_LDK_OpenChannel_get_revocation_basepoint(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; +void CS_LDK_WarningMessage_free(int64_t this_obj) { + LDKWarningMessage this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + WarningMessage_free(this_obj_conv); } -void CS_LDK_OpenChannel_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +int64_t CS_LDK_WarningMessage_get_channel_id(int64_t this_ptr) { + LDKWarningMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); + LDKChannelId ret_var = WarningMessage_get_channel_id(&this_ptr_conv); + int64_t ret_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_OpenChannel_get_payment_point(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +void CS_LDK_WarningMessage_set_channel_id(int64_t this_ptr, int64_t val) { + LDKWarningMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + WarningMessage_set_channel_id(&this_ptr_conv, val_conv); } -void CS_LDK_OpenChannel_set_payment_point(int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +jstring CS_LDK_WarningMessage_get_data(int64_t this_ptr) { + LDKWarningMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannel_set_payment_point(&this_ptr_conv, val_ref); + LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -int8_tArray CS_LDK_OpenChannel_get_delayed_payment_basepoint(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +void CS_LDK_WarningMessage_set_data(int64_t this_ptr, jstring val) { + LDKWarningMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKStr val_conv = str_ref_to_owned_c(val); + WarningMessage_set_data(&this_ptr_conv, val_conv); } -void CS_LDK_OpenChannel_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); +int64_t CS_LDK_WarningMessage_new(int64_t channel_id_arg, jstring data_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKStr data_arg_conv = str_ref_to_owned_c(data_arg); + LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_conv, data_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int8_tArray CS_LDK_OpenChannel_get_htlc_basepoint(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; +static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) { + LDKWarningMessage ret_var = WarningMessage_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } - -void CS_LDK_OpenChannel_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); +int64_t CS_LDK_WarningMessage_clone_ptr(int64_t arg) { + LDKWarningMessage arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv); + return ret_conv; } -int8_tArray CS_LDK_OpenChannel_get_first_per_commitment_point(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_WarningMessage_clone(int64_t orig) { + LDKWarningMessage orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_OpenChannel_set_first_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); +int64_t CS_LDK_WarningMessage_hash(int64_t o) { + LDKWarningMessage o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = WarningMessage_hash(&o_conv); + return ret_conv; } -int8_t CS_LDK_OpenChannel_get_channel_flags(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv); +jboolean CS_LDK_WarningMessage_eq(int64_t a, int64_t b) { + LDKWarningMessage a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKWarningMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_OpenChannel_set_channel_flags(int64_t this_ptr, int8_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_channel_flags(&this_ptr_conv, val); +void CS_LDK_Ping_free(int64_t this_obj) { + LDKPing this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Ping_free(this_obj_conv); } -int64_t CS_LDK_OpenChannel_get_shutdown_scriptpubkey(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +int16_t CS_LDK_Ping_get_ponglen(int64_t this_ptr) { + LDKPing this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = OpenChannel_get_shutdown_scriptpubkey(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv); + return ret_conv; } -void CS_LDK_OpenChannel_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; +void CS_LDK_Ping_set_ponglen(int64_t this_ptr, int16_t val) { + LDKPing this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); - val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); - OpenChannel_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); + Ping_set_ponglen(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannel_get_channel_type(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +int16_t CS_LDK_Ping_get_byteslen(int64_t this_ptr) { + LDKPing this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv); + return ret_conv; } -void CS_LDK_OpenChannel_set_channel_type(int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; +void CS_LDK_Ping_set_byteslen(int64_t this_ptr, int16_t val) { + LDKPing this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures val_conv; - val_conv.inner = untag_ptr(val); - val_conv.is_owned = ptr_is_owned(val); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTypeFeatures_clone(&val_conv); - OpenChannel_set_channel_type(&this_ptr_conv, val_conv); + Ping_set_byteslen(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannel_new(int8_tArray chain_hash_arg, int8_tArray temporary_channel_id_arg, int64_t funding_satoshis_arg, int64_t push_msat_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t channel_reserve_satoshis_arg, int64_t htlc_minimum_msat_arg, int32_t feerate_per_kw_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_point_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg, int8_tArray first_per_commitment_point_arg, int8_t channel_flags_arg, int64_t shutdown_scriptpubkey_arg, int64_t channel_type_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg); - LDKPublicKey funding_pubkey_arg_ref; - CHECK(funding_pubkey_arg->arr_len == 33); - memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); - LDKPublicKey revocation_basepoint_arg_ref; - CHECK(revocation_basepoint_arg->arr_len == 33); - memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg); - LDKPublicKey payment_point_arg_ref; - CHECK(payment_point_arg->arr_len == 33); - memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg); - LDKPublicKey delayed_payment_basepoint_arg_ref; - CHECK(delayed_payment_basepoint_arg->arr_len == 33); - memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg); - LDKPublicKey htlc_basepoint_arg_ref; - CHECK(htlc_basepoint_arg->arr_len == 33); - memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg); - LDKPublicKey first_per_commitment_point_arg_ref; - CHECK(first_per_commitment_point_arg->arr_len == 33); - memcpy(first_per_commitment_point_arg_ref.compressed_form, first_per_commitment_point_arg->elems, 33); FREE(first_per_commitment_point_arg); - void* shutdown_scriptpubkey_arg_ptr = untag_ptr(shutdown_scriptpubkey_arg); - CHECK_ACCESS(shutdown_scriptpubkey_arg_ptr); - LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg_conv = *(LDKCOption_CVec_u8ZZ*)(shutdown_scriptpubkey_arg_ptr); - shutdown_scriptpubkey_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(shutdown_scriptpubkey_arg)); - LDKChannelTypeFeatures channel_type_arg_conv; - channel_type_arg_conv.inner = untag_ptr(channel_type_arg); - channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); - channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); - LDKOpenChannel ret_var = OpenChannel_new(chain_hash_arg_ref, temporary_channel_id_arg_ref, funding_satoshis_arg, push_msat_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, channel_reserve_satoshis_arg, htlc_minimum_msat_arg, feerate_per_kw_arg, to_self_delay_arg, max_accepted_htlcs_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, channel_flags_arg, shutdown_scriptpubkey_arg_conv, channel_type_arg_conv); +int64_t CS_LDK_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) { + LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { - LDKOpenChannel ret_var = OpenChannel_clone(arg); +static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { + LDKPing ret_var = Ping_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_OpenChannel_clone_ptr(int64_t arg) { - LDKOpenChannel arg_conv; +int64_t CS_LDK_Ping_clone_ptr(int64_t arg) { + LDKPing arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv); + int64_t ret_conv = Ping_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_OpenChannel_clone(int64_t orig) { - LDKOpenChannel orig_conv; +int64_t CS_LDK_Ping_clone(int64_t orig) { + LDKPing orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); + LDKPing ret_var = Ping_clone(&orig_conv); int64_t ret_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_OpenChannel_eq(int64_t a, int64_t b) { - LDKOpenChannel a_conv; +int64_t CS_LDK_Ping_hash(int64_t o) { + LDKPing o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Ping_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_Ping_eq(int64_t a, int64_t b) { + LDKPing a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKOpenChannel b_conv; + LDKPing b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv); + jboolean ret_conv = Ping_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_free(int64_t this_obj) { - LDKOpenChannelV2 this_obj_conv; +void CS_LDK_Pong_free(int64_t this_obj) { + LDKPong this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OpenChannelV2_free(this_obj_conv); + Pong_free(this_obj_conv); } -int8_tArray CS_LDK_OpenChannelV2_get_chain_hash(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int16_t CS_LDK_Pong_get_byteslen(int64_t this_ptr) { + LDKPong this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *OpenChannelV2_get_chain_hash(&this_ptr_conv), 32); - return ret_arr; + int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv); + return ret_conv; } -void CS_LDK_OpenChannelV2_set_chain_hash(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_Pong_set_byteslen(int64_t this_ptr, int16_t val) { + LDKPong this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - OpenChannelV2_set_chain_hash(&this_ptr_conv, val_ref); + Pong_set_byteslen(&this_ptr_conv, val); } -int8_tArray CS_LDK_OpenChannelV2_get_temporary_channel_id(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *OpenChannelV2_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; +int64_t CS_LDK_Pong_new(int16_t byteslen_arg) { + LDKPong ret_var = Pong_new(byteslen_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_OpenChannelV2_set_temporary_channel_id(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - OpenChannelV2_set_temporary_channel_id(&this_ptr_conv, val_ref); +static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { + LDKPong ret_var = Pong_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_Pong_clone_ptr(int64_t arg) { + LDKPong arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Pong_clone_ptr(&arg_conv); + return ret_conv; } -int32_t CS_LDK_OpenChannelV2_get_funding_feerate_sat_per_1000_weight(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = OpenChannelV2_get_funding_feerate_sat_per_1000_weight(&this_ptr_conv); +int64_t CS_LDK_Pong_clone(int64_t orig) { + LDKPong orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPong ret_var = Pong_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_Pong_hash(int64_t o) { + LDKPong o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Pong_hash(&o_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_funding_feerate_sat_per_1000_weight(int64_t this_ptr, int32_t val) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannelV2_set_funding_feerate_sat_per_1000_weight(&this_ptr_conv, val); +jboolean CS_LDK_Pong_eq(int64_t a, int64_t b) { + LDKPong a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPong b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Pong_eq(&a_conv, &b_conv); + return ret_conv; } -int32_t CS_LDK_OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_free(int64_t this_obj) { + LDKCommonOpenChannelFields this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CommonOpenChannelFields_free(this_obj_conv); +} + +int8_tArray CS_LDK_CommonOpenChannelFields_get_chain_hash(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *CommonOpenChannelFields_get_chain_hash(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(int64_t this_ptr, int32_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_chain_hash(int64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + CommonOpenChannelFields_set_chain_hash(&this_ptr_conv, val_ref); } -int64_t CS_LDK_OpenChannelV2_get_funding_satoshis(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_temporary_channel_id(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = OpenChannelV2_get_funding_satoshis(&this_ptr_conv); - return ret_conv; + LDKChannelId ret_var = CommonOpenChannelFields_get_temporary_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_OpenChannelV2_set_funding_satoshis(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_temporary_channel_id(int64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_funding_satoshis(&this_ptr_conv, val); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + CommonOpenChannelFields_set_temporary_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_OpenChannelV2_get_dust_limit_satoshis(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_funding_satoshis(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = OpenChannelV2_get_dust_limit_satoshis(&this_ptr_conv); + int64_t ret_conv = CommonOpenChannelFields_get_funding_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_funding_satoshis(int64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_dust_limit_satoshis(&this_ptr_conv, val); + CommonOpenChannelFields_set_funding_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannelV2_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_dust_limit_satoshis(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = OpenChannelV2_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + int64_t ret_conv = CommonOpenChannelFields_get_dust_limit_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); + CommonOpenChannelFields_set_dust_limit_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannelV2_get_htlc_minimum_msat(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = OpenChannelV2_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_conv = CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_htlc_minimum_msat(&this_ptr_conv, val); + CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -int16_t CS_LDK_OpenChannelV2_get_to_self_delay(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_htlc_minimum_msat(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = OpenChannelV2_get_to_self_delay(&this_ptr_conv); + int64_t ret_conv = CommonOpenChannelFields_get_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_to_self_delay(int64_t this_ptr, int16_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_to_self_delay(&this_ptr_conv, val); + CommonOpenChannelFields_set_htlc_minimum_msat(&this_ptr_conv, val); } -int16_t CS_LDK_OpenChannelV2_get_max_accepted_htlcs(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int32_t CS_LDK_CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = OpenChannelV2_get_max_accepted_htlcs(&this_ptr_conv); + int32_t ret_conv = CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(int64_t this_ptr, int32_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_max_accepted_htlcs(&this_ptr_conv, val); + CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(&this_ptr_conv, val); } -int32_t CS_LDK_OpenChannelV2_get_locktime(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int16_t CS_LDK_CommonOpenChannelFields_get_to_self_delay(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = OpenChannelV2_get_locktime(&this_ptr_conv); + int16_t ret_conv = CommonOpenChannelFields_get_to_self_delay(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_locktime(int64_t this_ptr, int32_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_to_self_delay(int64_t this_ptr, int16_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_locktime(&this_ptr_conv, val); + CommonOpenChannelFields_set_to_self_delay(&this_ptr_conv, val); } -int8_tArray CS_LDK_OpenChannelV2_get_funding_pubkey(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int16_t CS_LDK_CommonOpenChannelFields_get_max_accepted_htlcs(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannelV2_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int16_t ret_conv = CommonOpenChannelFields_get_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; } -void CS_LDK_OpenChannelV2_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_funding_pubkey(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_max_accepted_htlcs(&this_ptr_conv, val); } -int8_tArray CS_LDK_OpenChannelV2_get_revocation_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_funding_pubkey(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannelV2_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_OpenChannelV2_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -38564,22 +47145,22 @@ void CS_LDK_OpenChannelV2_set_revocation_basepoint(int64_t this_ptr, int8_tArra LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_revocation_basepoint(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_funding_pubkey(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_OpenChannelV2_get_payment_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_revocation_basepoint(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannelV2_get_payment_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_OpenChannelV2_set_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -38587,22 +47168,22 @@ void CS_LDK_OpenChannelV2_set_payment_basepoint(int64_t this_ptr, int8_tArray v LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_payment_basepoint(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_revocation_basepoint(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_OpenChannelV2_get_delayed_payment_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_payment_basepoint(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannelV2_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_OpenChannelV2_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_payment_basepoint(int64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -38610,22 +47191,22 @@ void CS_LDK_OpenChannelV2_set_delayed_payment_basepoint(int64_t this_ptr, int8_ LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_payment_basepoint(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_OpenChannelV2_get_htlc_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_delayed_payment_basepoint(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannelV2_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_OpenChannelV2_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -38633,22 +47214,22 @@ void CS_LDK_OpenChannelV2_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_htlc_basepoint(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_OpenChannelV2_get_first_per_commitment_point(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_htlc_basepoint(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannelV2_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_OpenChannelV2_set_first_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -38656,22 +47237,22 @@ void CS_LDK_OpenChannelV2_set_first_per_commitment_point(int64_t this_ptr, int8 LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_first_per_commitment_point(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_htlc_basepoint(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_OpenChannelV2_get_second_per_commitment_point(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_first_per_commitment_point(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, OpenChannelV2_get_second_per_commitment_point(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_OpenChannelV2_set_second_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_first_per_commitment_point(int64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -38679,42 +47260,42 @@ void CS_LDK_OpenChannelV2_set_second_per_commitment_point(int64_t this_ptr, int LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_second_per_commitment_point(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_first_per_commitment_point(&this_ptr_conv, val_ref); } -int8_t CS_LDK_OpenChannelV2_get_channel_flags(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_t CS_LDK_CommonOpenChannelFields_get_channel_flags(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_t ret_conv = OpenChannelV2_get_channel_flags(&this_ptr_conv); + int8_t ret_conv = CommonOpenChannelFields_get_channel_flags(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_channel_flags(int64_t this_ptr, int8_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_channel_flags(int64_t this_ptr, int8_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_channel_flags(&this_ptr_conv, val); + CommonOpenChannelFields_set_channel_flags(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannelV2_get_shutdown_scriptpubkey(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_shutdown_scriptpubkey(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = OpenChannelV2_get_shutdown_scriptpubkey(&this_ptr_conv); + *ret_copy = CommonOpenChannelFields_get_shutdown_scriptpubkey(&this_ptr_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_OpenChannelV2_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -38723,24 +47304,24 @@ void CS_LDK_OpenChannelV2_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t v CHECK_ACCESS(val_ptr); LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); - OpenChannelV2_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); + CommonOpenChannelFields_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); } -int64_t CS_LDK_OpenChannelV2_get_channel_type(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_channel_type(int64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = OpenChannelV2_get_channel_type(&this_ptr_conv); + LDKChannelTypeFeatures ret_var = CommonOpenChannelFields_get_channel_type(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_OpenChannelV2_set_channel_type(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_channel_type(int64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -38750,36 +47331,18 @@ void CS_LDK_OpenChannelV2_set_channel_type(int64_t this_ptr, int64_t val) { val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelTypeFeatures_clone(&val_conv); - OpenChannelV2_set_channel_type(&this_ptr_conv, val_conv); -} - -int32_t CS_LDK_OpenChannelV2_get_require_confirmed_inputs(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = LDKCOption_NoneZ_to_cs(OpenChannelV2_get_require_confirmed_inputs(&this_ptr_conv)); - return ret_conv; -} - -void CS_LDK_OpenChannelV2_set_require_confirmed_inputs(int64_t this_ptr, int32_t val) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); - OpenChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); + CommonOpenChannelFields_set_channel_type(&this_ptr_conv, val_conv); } -int64_t CS_LDK_OpenChannelV2_new(int8_tArray chain_hash_arg, int8_tArray temporary_channel_id_arg, int32_t funding_feerate_sat_per_1000_weight_arg, int32_t commitment_feerate_sat_per_1000_weight_arg, int64_t funding_satoshis_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t htlc_minimum_msat_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, int32_t locktime_arg, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_basepoint_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg, int8_tArray first_per_commitment_point_arg, int8_tArray second_per_commitment_point_arg, int8_t channel_flags_arg, int64_t shutdown_scriptpubkey_arg, int64_t channel_type_arg, int32_t require_confirmed_inputs_arg) { +int64_t CS_LDK_CommonOpenChannelFields_new(int8_tArray chain_hash_arg, int64_t temporary_channel_id_arg, int64_t funding_satoshis_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t htlc_minimum_msat_arg, int32_t commitment_feerate_sat_per_1000_weight_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_basepoint_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg, int8_tArray first_per_commitment_point_arg, int8_t channel_flags_arg, int64_t shutdown_scriptpubkey_arg, int64_t channel_type_arg) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg); + LDKChannelId temporary_channel_id_arg_conv; + temporary_channel_id_arg_conv.inner = untag_ptr(temporary_channel_id_arg); + temporary_channel_id_arg_conv.is_owned = ptr_is_owned(temporary_channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_arg_conv); + temporary_channel_id_arg_conv = ChannelId_clone(&temporary_channel_id_arg_conv); LDKPublicKey funding_pubkey_arg_ref; CHECK(funding_pubkey_arg->arr_len == 33); memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); @@ -38798,9 +47361,6 @@ int64_t CS_LDK_OpenChannelV2_new(int8_tArray chain_hash_arg, int8_tArray tempor LDKPublicKey first_per_commitment_point_arg_ref; CHECK(first_per_commitment_point_arg->arr_len == 33); memcpy(first_per_commitment_point_arg_ref.compressed_form, first_per_commitment_point_arg->elems, 33); FREE(first_per_commitment_point_arg); - LDKPublicKey second_per_commitment_point_arg_ref; - CHECK(second_per_commitment_point_arg->arr_len == 33); - memcpy(second_per_commitment_point_arg_ref.compressed_form, second_per_commitment_point_arg->elems, 33); FREE(second_per_commitment_point_arg); void* shutdown_scriptpubkey_arg_ptr = untag_ptr(shutdown_scriptpubkey_arg); CHECK_ACCESS(shutdown_scriptpubkey_arg_ptr); LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg_conv = *(LDKCOption_CVec_u8ZZ*)(shutdown_scriptpubkey_arg_ptr); @@ -38810,8 +47370,336 @@ int64_t CS_LDK_OpenChannelV2_new(int8_tArray chain_hash_arg, int8_tArray tempor channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); + LDKCommonOpenChannelFields ret_var = CommonOpenChannelFields_new(chain_hash_arg_ref, temporary_channel_id_arg_conv, funding_satoshis_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, commitment_feerate_sat_per_1000_weight_arg, to_self_delay_arg, max_accepted_htlcs_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_basepoint_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, channel_flags_arg, shutdown_scriptpubkey_arg_conv, channel_type_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t CommonOpenChannelFields_clone_ptr(LDKCommonOpenChannelFields *NONNULL_PTR arg) { + LDKCommonOpenChannelFields ret_var = CommonOpenChannelFields_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_CommonOpenChannelFields_clone_ptr(int64_t arg) { + LDKCommonOpenChannelFields arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = CommonOpenChannelFields_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CommonOpenChannelFields_clone(int64_t orig) { + LDKCommonOpenChannelFields orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKCommonOpenChannelFields ret_var = CommonOpenChannelFields_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_CommonOpenChannelFields_hash(int64_t o) { + LDKCommonOpenChannelFields o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = CommonOpenChannelFields_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_CommonOpenChannelFields_eq(int64_t a, int64_t b) { + LDKCommonOpenChannelFields a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKCommonOpenChannelFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = CommonOpenChannelFields_eq(&a_conv, &b_conv); + return ret_conv; +} + +void CS_LDK_OpenChannel_free(int64_t this_obj) { + LDKOpenChannel this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OpenChannel_free(this_obj_conv); +} + +int64_t CS_LDK_OpenChannel_get_common_fields(int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommonOpenChannelFields ret_var = OpenChannel_get_common_fields(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_OpenChannel_set_common_fields(int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommonOpenChannelFields val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CommonOpenChannelFields_clone(&val_conv); + OpenChannel_set_common_fields(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_OpenChannel_get_push_msat(int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_OpenChannel_set_push_msat(int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OpenChannel_set_push_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_OpenChannel_get_channel_reserve_satoshis(int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_OpenChannel_set_channel_reserve_satoshis(int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); +} + +int64_t CS_LDK_OpenChannel_new(int64_t common_fields_arg, int64_t push_msat_arg, int64_t channel_reserve_satoshis_arg) { + LDKCommonOpenChannelFields common_fields_arg_conv; + common_fields_arg_conv.inner = untag_ptr(common_fields_arg); + common_fields_arg_conv.is_owned = ptr_is_owned(common_fields_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(common_fields_arg_conv); + common_fields_arg_conv = CommonOpenChannelFields_clone(&common_fields_arg_conv); + LDKOpenChannel ret_var = OpenChannel_new(common_fields_arg_conv, push_msat_arg, channel_reserve_satoshis_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { + LDKOpenChannel ret_var = OpenChannel_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_OpenChannel_clone_ptr(int64_t arg) { + LDKOpenChannel arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OpenChannel_clone(int64_t orig) { + LDKOpenChannel orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_OpenChannel_hash(int64_t o) { + LDKOpenChannel o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = OpenChannel_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_OpenChannel_eq(int64_t a, int64_t b) { + LDKOpenChannel a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOpenChannel b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv); + return ret_conv; +} + +void CS_LDK_OpenChannelV2_free(int64_t this_obj) { + LDKOpenChannelV2 this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OpenChannelV2_free(this_obj_conv); +} + +int64_t CS_LDK_OpenChannelV2_get_common_fields(int64_t this_ptr) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommonOpenChannelFields ret_var = OpenChannelV2_get_common_fields(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_OpenChannelV2_set_common_fields(int64_t this_ptr, int64_t val) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommonOpenChannelFields val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CommonOpenChannelFields_clone(&val_conv); + OpenChannelV2_set_common_fields(&this_ptr_conv, val_conv); +} + +int32_t CS_LDK_OpenChannelV2_get_funding_feerate_sat_per_1000_weight(int64_t this_ptr) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = OpenChannelV2_get_funding_feerate_sat_per_1000_weight(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_OpenChannelV2_set_funding_feerate_sat_per_1000_weight(int64_t this_ptr, int32_t val) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OpenChannelV2_set_funding_feerate_sat_per_1000_weight(&this_ptr_conv, val); +} + +int32_t CS_LDK_OpenChannelV2_get_locktime(int64_t this_ptr) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = OpenChannelV2_get_locktime(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_OpenChannelV2_set_locktime(int64_t this_ptr, int32_t val) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OpenChannelV2_set_locktime(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_OpenChannelV2_get_second_per_commitment_point(int64_t this_ptr) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, OpenChannelV2_get_second_per_commitment_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_OpenChannelV2_set_second_per_commitment_point(int64_t this_ptr, int8_tArray val) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + OpenChannelV2_set_second_per_commitment_point(&this_ptr_conv, val_ref); +} + +int32_t CS_LDK_OpenChannelV2_get_require_confirmed_inputs(int64_t this_ptr) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = LDKCOption_NoneZ_to_cs(OpenChannelV2_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; +} + +void CS_LDK_OpenChannelV2_set_require_confirmed_inputs(int64_t this_ptr, int32_t val) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); + OpenChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_OpenChannelV2_new(int64_t common_fields_arg, int32_t funding_feerate_sat_per_1000_weight_arg, int32_t locktime_arg, int8_tArray second_per_commitment_point_arg, int32_t require_confirmed_inputs_arg) { + LDKCommonOpenChannelFields common_fields_arg_conv; + common_fields_arg_conv.inner = untag_ptr(common_fields_arg); + common_fields_arg_conv.is_owned = ptr_is_owned(common_fields_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(common_fields_arg_conv); + common_fields_arg_conv = CommonOpenChannelFields_clone(&common_fields_arg_conv); + LDKPublicKey second_per_commitment_point_arg_ref; + CHECK(second_per_commitment_point_arg->arr_len == 33); + memcpy(second_per_commitment_point_arg_ref.compressed_form, second_per_commitment_point_arg->elems, 33); FREE(second_per_commitment_point_arg); LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_cs(require_confirmed_inputs_arg); - LDKOpenChannelV2 ret_var = OpenChannelV2_new(chain_hash_arg_ref, temporary_channel_id_arg_ref, funding_feerate_sat_per_1000_weight_arg, commitment_feerate_sat_per_1000_weight_arg, funding_satoshis_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, to_self_delay_arg, max_accepted_htlcs_arg, locktime_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_basepoint_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, second_per_commitment_point_arg_ref, channel_flags_arg, shutdown_scriptpubkey_arg_conv, channel_type_arg_conv, require_confirmed_inputs_arg_conv); + LDKOpenChannelV2 ret_var = OpenChannelV2_new(common_fields_arg_conv, funding_feerate_sat_per_1000_weight_arg, locktime_arg, second_per_commitment_point_arg_ref, require_confirmed_inputs_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -38848,6 +47736,16 @@ int64_t CS_LDK_OpenChannelV2_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_OpenChannelV2_hash(int64_t o) { + LDKOpenChannelV2 o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = OpenChannelV2_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_OpenChannelV2_eq(int64_t a, int64_t b) { LDKOpenChannelV2 a_conv; a_conv.inner = untag_ptr(a); @@ -38863,183 +47761,191 @@ jboolean CS_LDK_OpenChannelV2_eq(int64_t a, int64_t b) { return ret_conv; } -void CS_LDK_AcceptChannel_free(int64_t this_obj) { - LDKAcceptChannel this_obj_conv; +void CS_LDK_CommonAcceptChannelFields_free(int64_t this_obj) { + LDKCommonAcceptChannelFields this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - AcceptChannel_free(this_obj_conv); + CommonAcceptChannelFields_free(this_obj_conv); } -int8_tArray CS_LDK_AcceptChannel_get_temporary_channel_id(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_temporary_channel_id(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = CommonAcceptChannelFields_get_temporary_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_AcceptChannel_set_temporary_channel_id(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_temporary_channel_id(int64_t this_ptr, int64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + CommonAcceptChannelFields_set_temporary_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_AcceptChannel_get_dust_limit_satoshis(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_dust_limit_satoshis(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); + int64_t ret_conv = CommonAcceptChannelFields_get_dust_limit_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_AcceptChannel_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); + CommonAcceptChannelFields_set_dust_limit_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_AcceptChannel_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + int64_t ret_conv = CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_AcceptChannel_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); + CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -int64_t CS_LDK_AcceptChannel_get_channel_reserve_satoshis(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_htlc_minimum_msat(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); + int64_t ret_conv = CommonAcceptChannelFields_get_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_AcceptChannel_set_channel_reserve_satoshis(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); + CommonAcceptChannelFields_set_htlc_minimum_msat(&this_ptr_conv, val); } -int64_t CS_LDK_AcceptChannel_get_htlc_minimum_msat(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int32_t CS_LDK_CommonAcceptChannelFields_get_minimum_depth(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); + int32_t ret_conv = CommonAcceptChannelFields_get_minimum_depth(&this_ptr_conv); return ret_conv; } -void CS_LDK_AcceptChannel_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_minimum_depth(int64_t this_ptr, int32_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); + CommonAcceptChannelFields_set_minimum_depth(&this_ptr_conv, val); } -int32_t CS_LDK_AcceptChannel_get_minimum_depth(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int16_t CS_LDK_CommonAcceptChannelFields_get_to_self_delay(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv); + int16_t ret_conv = CommonAcceptChannelFields_get_to_self_delay(&this_ptr_conv); return ret_conv; } -void CS_LDK_AcceptChannel_set_minimum_depth(int64_t this_ptr, int32_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_to_self_delay(int64_t this_ptr, int16_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_minimum_depth(&this_ptr_conv, val); + CommonAcceptChannelFields_set_to_self_delay(&this_ptr_conv, val); } -int16_t CS_LDK_AcceptChannel_get_to_self_delay(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int16_t CS_LDK_CommonAcceptChannelFields_get_max_accepted_htlcs(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv); + int16_t ret_conv = CommonAcceptChannelFields_get_max_accepted_htlcs(&this_ptr_conv); return ret_conv; } -void CS_LDK_AcceptChannel_set_to_self_delay(int64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_to_self_delay(&this_ptr_conv, val); + CommonAcceptChannelFields_set_max_accepted_htlcs(&this_ptr_conv, val); } -int16_t CS_LDK_AcceptChannel_get_max_accepted_htlcs(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_funding_pubkey(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_AcceptChannel_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + CommonAcceptChannelFields_set_funding_pubkey(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_AcceptChannel_get_funding_pubkey(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_revocation_basepoint(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_AcceptChannel_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -39047,22 +47953,22 @@ void CS_LDK_AcceptChannel_set_funding_pubkey(int64_t this_ptr, int8_tArray val) LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_revocation_basepoint(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_AcceptChannel_get_revocation_basepoint(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_payment_basepoint(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_AcceptChannel_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_payment_basepoint(int64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -39070,22 +47976,22 @@ void CS_LDK_AcceptChannel_set_revocation_basepoint(int64_t this_ptr, int8_tArra LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_payment_basepoint(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_AcceptChannel_get_payment_point(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_delayed_payment_basepoint(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_AcceptChannel_set_payment_point(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -39093,22 +47999,22 @@ void CS_LDK_AcceptChannel_set_payment_point(int64_t this_ptr, int8_tArray val) LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_payment_point(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_AcceptChannel_get_delayed_payment_basepoint(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_htlc_basepoint(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_AcceptChannel_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -39116,22 +48022,22 @@ void CS_LDK_AcceptChannel_set_delayed_payment_basepoint(int64_t this_ptr, int8_ LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_htlc_basepoint(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_AcceptChannel_get_htlc_basepoint(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_first_per_commitment_point(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_AcceptChannel_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_first_per_commitment_point(int64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -39139,116 +48045,217 @@ void CS_LDK_AcceptChannel_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_first_per_commitment_point(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_CommonAcceptChannelFields_get_shutdown_scriptpubkey(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = CommonAcceptChannelFields_get_shutdown_scriptpubkey(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_CommonAcceptChannelFields_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); + val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); + CommonAcceptChannelFields_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_CommonAcceptChannelFields_get_channel_type(int64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelTypeFeatures ret_var = CommonAcceptChannelFields_get_channel_type(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_CommonAcceptChannelFields_set_channel_type(int64_t this_ptr, int64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + 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); + CommonAcceptChannelFields_set_channel_type(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_CommonAcceptChannelFields_new(int64_t temporary_channel_id_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t htlc_minimum_msat_arg, int32_t minimum_depth_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_basepoint_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg, int8_tArray first_per_commitment_point_arg, int64_t shutdown_scriptpubkey_arg, int64_t channel_type_arg) { + LDKChannelId temporary_channel_id_arg_conv; + temporary_channel_id_arg_conv.inner = untag_ptr(temporary_channel_id_arg); + temporary_channel_id_arg_conv.is_owned = ptr_is_owned(temporary_channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_arg_conv); + temporary_channel_id_arg_conv = ChannelId_clone(&temporary_channel_id_arg_conv); + LDKPublicKey funding_pubkey_arg_ref; + CHECK(funding_pubkey_arg->arr_len == 33); + memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); + LDKPublicKey revocation_basepoint_arg_ref; + CHECK(revocation_basepoint_arg->arr_len == 33); + memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg); + LDKPublicKey payment_basepoint_arg_ref; + CHECK(payment_basepoint_arg->arr_len == 33); + memcpy(payment_basepoint_arg_ref.compressed_form, payment_basepoint_arg->elems, 33); FREE(payment_basepoint_arg); + LDKPublicKey delayed_payment_basepoint_arg_ref; + CHECK(delayed_payment_basepoint_arg->arr_len == 33); + memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg); + LDKPublicKey htlc_basepoint_arg_ref; + CHECK(htlc_basepoint_arg->arr_len == 33); + memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg); + LDKPublicKey first_per_commitment_point_arg_ref; + CHECK(first_per_commitment_point_arg->arr_len == 33); + memcpy(first_per_commitment_point_arg_ref.compressed_form, first_per_commitment_point_arg->elems, 33); FREE(first_per_commitment_point_arg); + void* shutdown_scriptpubkey_arg_ptr = untag_ptr(shutdown_scriptpubkey_arg); + CHECK_ACCESS(shutdown_scriptpubkey_arg_ptr); + LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg_conv = *(LDKCOption_CVec_u8ZZ*)(shutdown_scriptpubkey_arg_ptr); + shutdown_scriptpubkey_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(shutdown_scriptpubkey_arg)); + LDKChannelTypeFeatures channel_type_arg_conv; + channel_type_arg_conv.inner = untag_ptr(channel_type_arg); + channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); + channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); + LDKCommonAcceptChannelFields ret_var = CommonAcceptChannelFields_new(temporary_channel_id_arg_conv, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, minimum_depth_arg, to_self_delay_arg, max_accepted_htlcs_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_basepoint_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, shutdown_scriptpubkey_arg_conv, channel_type_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t CommonAcceptChannelFields_clone_ptr(LDKCommonAcceptChannelFields *NONNULL_PTR arg) { + LDKCommonAcceptChannelFields ret_var = CommonAcceptChannelFields_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_CommonAcceptChannelFields_clone_ptr(int64_t arg) { + LDKCommonAcceptChannelFields arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = CommonAcceptChannelFields_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CommonAcceptChannelFields_clone(int64_t orig) { + LDKCommonAcceptChannelFields orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKCommonAcceptChannelFields ret_var = CommonAcceptChannelFields_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int8_tArray CS_LDK_AcceptChannel_get_first_per_commitment_point(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_CommonAcceptChannelFields_hash(int64_t o) { + LDKCommonAcceptChannelFields o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = CommonAcceptChannelFields_hash(&o_conv); + return ret_conv; } -void CS_LDK_AcceptChannel_set_first_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); +jboolean CS_LDK_CommonAcceptChannelFields_eq(int64_t a, int64_t b) { + LDKCommonAcceptChannelFields a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKCommonAcceptChannelFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = CommonAcceptChannelFields_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t CS_LDK_AcceptChannel_get_shutdown_scriptpubkey(int64_t this_ptr) { +void CS_LDK_AcceptChannel_free(int64_t this_obj) { + LDKAcceptChannel this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + AcceptChannel_free(this_obj_conv); +} + +int64_t CS_LDK_AcceptChannel_get_common_fields(int64_t this_ptr) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = AcceptChannel_get_shutdown_scriptpubkey(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKCommonAcceptChannelFields ret_var = AcceptChannel_get_common_fields(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_AcceptChannel_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t val) { +void CS_LDK_AcceptChannel_set_common_fields(int64_t this_ptr, int64_t val) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); - val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); - AcceptChannel_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); + LDKCommonAcceptChannelFields val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CommonAcceptChannelFields_clone(&val_conv); + AcceptChannel_set_common_fields(&this_ptr_conv, val_conv); } -int64_t CS_LDK_AcceptChannel_get_channel_type(int64_t this_ptr) { +int64_t CS_LDK_AcceptChannel_get_channel_reserve_satoshis(int64_t this_ptr) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = AcceptChannel_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; + int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; } -void CS_LDK_AcceptChannel_set_channel_type(int64_t this_ptr, int64_t val) { +void CS_LDK_AcceptChannel_set_channel_reserve_satoshis(int64_t this_ptr, int64_t val) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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); - AcceptChannel_set_channel_type(&this_ptr_conv, val_conv); + AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_AcceptChannel_new(int8_tArray temporary_channel_id_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t channel_reserve_satoshis_arg, int64_t htlc_minimum_msat_arg, int32_t minimum_depth_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_point_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg, int8_tArray first_per_commitment_point_arg, int64_t shutdown_scriptpubkey_arg, int64_t channel_type_arg) { - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg); - LDKPublicKey funding_pubkey_arg_ref; - CHECK(funding_pubkey_arg->arr_len == 33); - memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); - LDKPublicKey revocation_basepoint_arg_ref; - CHECK(revocation_basepoint_arg->arr_len == 33); - memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg); - LDKPublicKey payment_point_arg_ref; - CHECK(payment_point_arg->arr_len == 33); - memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg); - LDKPublicKey delayed_payment_basepoint_arg_ref; - CHECK(delayed_payment_basepoint_arg->arr_len == 33); - memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg); - LDKPublicKey htlc_basepoint_arg_ref; - CHECK(htlc_basepoint_arg->arr_len == 33); - memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg); - LDKPublicKey first_per_commitment_point_arg_ref; - CHECK(first_per_commitment_point_arg->arr_len == 33); - memcpy(first_per_commitment_point_arg_ref.compressed_form, first_per_commitment_point_arg->elems, 33); FREE(first_per_commitment_point_arg); - void* shutdown_scriptpubkey_arg_ptr = untag_ptr(shutdown_scriptpubkey_arg); - CHECK_ACCESS(shutdown_scriptpubkey_arg_ptr); - LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg_conv = *(LDKCOption_CVec_u8ZZ*)(shutdown_scriptpubkey_arg_ptr); - shutdown_scriptpubkey_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(shutdown_scriptpubkey_arg)); - LDKChannelTypeFeatures channel_type_arg_conv; - channel_type_arg_conv.inner = untag_ptr(channel_type_arg); - channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); - channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); - LDKAcceptChannel ret_var = AcceptChannel_new(temporary_channel_id_arg_ref, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, channel_reserve_satoshis_arg, htlc_minimum_msat_arg, minimum_depth_arg, to_self_delay_arg, max_accepted_htlcs_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, shutdown_scriptpubkey_arg_conv, channel_type_arg_conv); +int64_t CS_LDK_AcceptChannel_new(int64_t common_fields_arg, int64_t channel_reserve_satoshis_arg) { + LDKCommonAcceptChannelFields common_fields_arg_conv; + common_fields_arg_conv.inner = untag_ptr(common_fields_arg); + common_fields_arg_conv.is_owned = ptr_is_owned(common_fields_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(common_fields_arg_conv); + common_fields_arg_conv = CommonAcceptChannelFields_clone(&common_fields_arg_conv); + LDKAcceptChannel ret_var = AcceptChannel_new(common_fields_arg_conv, channel_reserve_satoshis_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -39285,6 +48292,16 @@ int64_t CS_LDK_AcceptChannel_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_AcceptChannel_hash(int64_t o) { + LDKAcceptChannel o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = AcceptChannel_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_AcceptChannel_eq(int64_t a, int64_t b) { LDKAcceptChannel a_conv; a_conv.inner = untag_ptr(a); @@ -39308,27 +48325,31 @@ void CS_LDK_AcceptChannelV2_free(int64_t this_obj) { AcceptChannelV2_free(this_obj_conv); } -int8_tArray CS_LDK_AcceptChannelV2_get_temporary_channel_id(int64_t this_ptr) { +int64_t CS_LDK_AcceptChannelV2_get_common_fields(int64_t this_ptr) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *AcceptChannelV2_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKCommonAcceptChannelFields ret_var = AcceptChannelV2_get_common_fields(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_AcceptChannelV2_set_temporary_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_AcceptChannelV2_set_common_fields(int64_t this_ptr, int64_t val) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - AcceptChannelV2_set_temporary_channel_id(&this_ptr_conv, val_ref); + LDKCommonAcceptChannelFields val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CommonAcceptChannelFields_clone(&val_conv); + AcceptChannelV2_set_common_fields(&this_ptr_conv, val_conv); } int64_t CS_LDK_AcceptChannelV2_get_funding_satoshis(int64_t this_ptr) { @@ -39350,225 +48371,472 @@ void CS_LDK_AcceptChannelV2_set_funding_satoshis(int64_t this_ptr, int64_t val) AcceptChannelV2_set_funding_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_AcceptChannelV2_get_dust_limit_satoshis(int64_t this_ptr) { +int8_tArray CS_LDK_AcceptChannelV2_get_second_per_commitment_point(int64_t this_ptr) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = AcceptChannelV2_get_dust_limit_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, AcceptChannelV2_get_second_per_commitment_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void CS_LDK_AcceptChannelV2_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { +void CS_LDK_AcceptChannelV2_set_second_per_commitment_point(int64_t this_ptr, int8_tArray val) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannelV2_set_dust_limit_satoshis(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + AcceptChannelV2_set_second_per_commitment_point(&this_ptr_conv, val_ref); } -int64_t CS_LDK_AcceptChannelV2_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { +int32_t CS_LDK_AcceptChannelV2_get_require_confirmed_inputs(int64_t this_ptr) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = AcceptChannelV2_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + int32_t ret_conv = LDKCOption_NoneZ_to_cs(AcceptChannelV2_get_require_confirmed_inputs(&this_ptr_conv)); return ret_conv; } -void CS_LDK_AcceptChannelV2_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { +void CS_LDK_AcceptChannelV2_set_require_confirmed_inputs(int64_t this_ptr, int32_t val) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannelV2_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); + AcceptChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); } -int64_t CS_LDK_AcceptChannelV2_get_htlc_minimum_msat(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = AcceptChannelV2_get_htlc_minimum_msat(&this_ptr_conv); +int64_t CS_LDK_AcceptChannelV2_new(int64_t common_fields_arg, int64_t funding_satoshis_arg, int8_tArray second_per_commitment_point_arg, int32_t require_confirmed_inputs_arg) { + LDKCommonAcceptChannelFields common_fields_arg_conv; + common_fields_arg_conv.inner = untag_ptr(common_fields_arg); + common_fields_arg_conv.is_owned = ptr_is_owned(common_fields_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(common_fields_arg_conv); + common_fields_arg_conv = CommonAcceptChannelFields_clone(&common_fields_arg_conv); + LDKPublicKey second_per_commitment_point_arg_ref; + CHECK(second_per_commitment_point_arg->arr_len == 33); + memcpy(second_per_commitment_point_arg_ref.compressed_form, second_per_commitment_point_arg->elems, 33); FREE(second_per_commitment_point_arg); + LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_cs(require_confirmed_inputs_arg); + LDKAcceptChannelV2 ret_var = AcceptChannelV2_new(common_fields_arg_conv, funding_satoshis_arg, second_per_commitment_point_arg_ref, require_confirmed_inputs_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t AcceptChannelV2_clone_ptr(LDKAcceptChannelV2 *NONNULL_PTR arg) { + LDKAcceptChannelV2 ret_var = AcceptChannelV2_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_AcceptChannelV2_clone_ptr(int64_t arg) { + LDKAcceptChannelV2 arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = AcceptChannelV2_clone_ptr(&arg_conv); return ret_conv; } -void CS_LDK_AcceptChannelV2_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - AcceptChannelV2_set_htlc_minimum_msat(&this_ptr_conv, val); +int64_t CS_LDK_AcceptChannelV2_clone(int64_t orig) { + LDKAcceptChannelV2 orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKAcceptChannelV2 ret_var = AcceptChannelV2_clone(&orig_conv); + int64_t ret_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_AcceptChannelV2_get_minimum_depth(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int64_t CS_LDK_AcceptChannelV2_hash(int64_t o) { + LDKAcceptChannelV2 o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = AcceptChannelV2_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_AcceptChannelV2_eq(int64_t a, int64_t b) { + LDKAcceptChannelV2 a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKAcceptChannelV2 b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = AcceptChannelV2_eq(&a_conv, &b_conv); + return ret_conv; +} + +void CS_LDK_FundingCreated_free(int64_t this_obj) { + LDKFundingCreated this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + FundingCreated_free(this_obj_conv); +} + +int64_t CS_LDK_FundingCreated_get_temporary_channel_id(int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = AcceptChannelV2_get_minimum_depth(&this_ptr_conv); - return ret_conv; + LDKChannelId ret_var = FundingCreated_get_temporary_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_AcceptChannelV2_set_minimum_depth(int64_t this_ptr, int32_t val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_FundingCreated_set_temporary_channel_id(int64_t this_ptr, int64_t val) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannelV2_set_minimum_depth(&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); + FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_conv); } -int16_t CS_LDK_AcceptChannelV2_get_to_self_delay(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int8_tArray CS_LDK_FundingCreated_get_funding_txid(int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = AcceptChannelV2_get_to_self_delay(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *FundingCreated_get_funding_txid(&this_ptr_conv), 32); + return ret_arr; } -void CS_LDK_AcceptChannelV2_set_to_self_delay(int64_t this_ptr, int16_t val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_FundingCreated_set_funding_txid(int64_t this_ptr, int8_tArray val) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannelV2_set_to_self_delay(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + FundingCreated_set_funding_txid(&this_ptr_conv, val_ref); } -int16_t CS_LDK_AcceptChannelV2_get_max_accepted_htlcs(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int16_t CS_LDK_FundingCreated_get_funding_output_index(int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = AcceptChannelV2_get_max_accepted_htlcs(&this_ptr_conv); + int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv); return ret_conv; } -void CS_LDK_AcceptChannelV2_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_FundingCreated_set_funding_output_index(int64_t this_ptr, int16_t val) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannelV2_set_max_accepted_htlcs(&this_ptr_conv, val); + FundingCreated_set_funding_output_index(&this_ptr_conv, val); } -int8_tArray CS_LDK_AcceptChannelV2_get_funding_pubkey(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int8_tArray CS_LDK_FundingCreated_get_signature(int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannelV2_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, FundingCreated_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } -void CS_LDK_AcceptChannelV2_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_FundingCreated_set_signature(int64_t this_ptr, int8_tArray val) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannelV2_set_funding_pubkey(&this_ptr_conv, val_ref); + LDKECDSASignature val_ref; + CHECK(val->arr_len == 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); + FundingCreated_set_signature(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_AcceptChannelV2_get_revocation_basepoint(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int64_t CS_LDK_FundingCreated_new(int64_t temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) { + LDKChannelId temporary_channel_id_arg_conv; + temporary_channel_id_arg_conv.inner = untag_ptr(temporary_channel_id_arg); + temporary_channel_id_arg_conv.is_owned = ptr_is_owned(temporary_channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_arg_conv); + temporary_channel_id_arg_conv = ChannelId_clone(&temporary_channel_id_arg_conv); + LDKThirtyTwoBytes funding_txid_arg_ref; + CHECK(funding_txid_arg->arr_len == 32); + memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); FREE(funding_txid_arg); + LDKECDSASignature signature_arg_ref; + CHECK(signature_arg->arr_len == 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); + LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_conv, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { + LDKFundingCreated ret_var = FundingCreated_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_FundingCreated_clone_ptr(int64_t arg) { + LDKFundingCreated arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_FundingCreated_clone(int64_t orig) { + LDKFundingCreated orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_FundingCreated_hash(int64_t o) { + LDKFundingCreated o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = FundingCreated_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_FundingCreated_eq(int64_t a, int64_t b) { + LDKFundingCreated a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKFundingCreated b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = FundingCreated_eq(&a_conv, &b_conv); + return ret_conv; +} + +void CS_LDK_FundingSigned_free(int64_t this_obj) { + LDKFundingSigned this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + FundingSigned_free(this_obj_conv); +} + +int64_t CS_LDK_FundingSigned_get_channel_id(int64_t this_ptr) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannelV2_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKChannelId ret_var = FundingSigned_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_AcceptChannelV2_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_FundingSigned_set_channel_id(int64_t this_ptr, int64_t val) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannelV2_set_revocation_basepoint(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + FundingSigned_set_channel_id(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_AcceptChannelV2_get_payment_basepoint(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int8_tArray CS_LDK_FundingSigned_get_signature(int64_t this_ptr) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannelV2_get_payment_basepoint(&this_ptr_conv).compressed_form, 33); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, FundingSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } -void CS_LDK_AcceptChannelV2_set_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_FundingSigned_set_signature(int64_t this_ptr, int8_tArray val) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannelV2_set_payment_basepoint(&this_ptr_conv, val_ref); + LDKECDSASignature val_ref; + CHECK(val->arr_len == 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); + FundingSigned_set_signature(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_AcceptChannelV2_get_delayed_payment_basepoint(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int64_t CS_LDK_FundingSigned_new(int64_t channel_id_arg, int8_tArray signature_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKECDSASignature signature_arg_ref; + CHECK(signature_arg->arr_len == 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); + LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_conv, signature_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { + LDKFundingSigned ret_var = FundingSigned_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_FundingSigned_clone_ptr(int64_t arg) { + LDKFundingSigned arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_FundingSigned_clone(int64_t orig) { + LDKFundingSigned orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_FundingSigned_hash(int64_t o) { + LDKFundingSigned o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = FundingSigned_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_FundingSigned_eq(int64_t a, int64_t b) { + LDKFundingSigned a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKFundingSigned b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = FundingSigned_eq(&a_conv, &b_conv); + return ret_conv; +} + +void CS_LDK_ChannelReady_free(int64_t this_obj) { + LDKChannelReady this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelReady_free(this_obj_conv); +} + +int64_t CS_LDK_ChannelReady_get_channel_id(int64_t this_ptr) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannelV2_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKChannelId ret_var = ChannelReady_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_AcceptChannelV2_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_ChannelReady_set_channel_id(int64_t this_ptr, int64_t val) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannelV2_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + ChannelReady_set_channel_id(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_AcceptChannelV2_get_htlc_basepoint(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int8_tArray CS_LDK_ChannelReady_get_next_per_commitment_point(int64_t this_ptr) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannelV2_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_AcceptChannelV2_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_ChannelReady_set_next_per_commitment_point(int64_t this_ptr, int8_tArray val) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -39576,258 +48844,269 @@ void CS_LDK_AcceptChannelV2_set_htlc_basepoint(int64_t this_ptr, int8_tArray va LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannelV2_set_htlc_basepoint(&this_ptr_conv, val_ref); + ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_AcceptChannelV2_get_first_per_commitment_point(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int64_t CS_LDK_ChannelReady_get_short_channel_id_alias(int64_t this_ptr) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannelV2_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_AcceptChannelV2_set_first_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_ChannelReady_set_short_channel_id_alias(int64_t this_ptr, int64_t val) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannelV2_set_first_per_commitment_point(&this_ptr_conv, val_ref); + 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)); + ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_AcceptChannelV2_get_second_per_commitment_point(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, AcceptChannelV2_get_second_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t CS_LDK_ChannelReady_new(int64_t channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_t short_channel_id_alias_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKPublicKey next_per_commitment_point_arg_ref; + CHECK(next_per_commitment_point_arg->arr_len == 33); + memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg); + void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg); + CHECK_ACCESS(short_channel_id_alias_arg_ptr); + LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr); + short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg)); + LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_conv, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) { + LDKChannelReady ret_var = ChannelReady_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_ChannelReady_clone_ptr(int64_t arg) { + LDKChannelReady arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelReady_clone(int64_t orig) { + LDKChannelReady orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChannelReady ret_var = ChannelReady_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_AcceptChannelV2_set_second_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannelV2_set_second_per_commitment_point(&this_ptr_conv, val_ref); +int64_t CS_LDK_ChannelReady_hash(int64_t o) { + LDKChannelReady o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelReady_hash(&o_conv); + return ret_conv; } -int64_t CS_LDK_AcceptChannelV2_get_shutdown_scriptpubkey(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = AcceptChannelV2_get_shutdown_scriptpubkey(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean CS_LDK_ChannelReady_eq(int64_t a, int64_t b) { + LDKChannelReady a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelReady b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelReady_eq(&a_conv, &b_conv); + return ret_conv; } -void CS_LDK_AcceptChannelV2_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); - val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); - AcceptChannelV2_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); +void CS_LDK_Stfu_free(int64_t this_obj) { + LDKStfu this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Stfu_free(this_obj_conv); } -int64_t CS_LDK_AcceptChannelV2_get_channel_type(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int64_t CS_LDK_Stfu_get_channel_id(int64_t this_ptr) { + LDKStfu this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = AcceptChannelV2_get_channel_type(&this_ptr_conv); + LDKChannelId ret_var = Stfu_get_channel_id(&this_ptr_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_AcceptChannelV2_set_channel_type(int64_t this_ptr, int64_t val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_Stfu_set_channel_id(int64_t this_ptr, int64_t val) { + LDKStfu this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures val_conv; + LDKChannelId val_conv; val_conv.inner = untag_ptr(val); val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTypeFeatures_clone(&val_conv); - AcceptChannelV2_set_channel_type(&this_ptr_conv, val_conv); + val_conv = ChannelId_clone(&val_conv); + Stfu_set_channel_id(&this_ptr_conv, val_conv); } -int32_t CS_LDK_AcceptChannelV2_get_require_confirmed_inputs(int64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; +int8_t CS_LDK_Stfu_get_initiator(int64_t this_ptr) { + LDKStfu this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int32_t ret_conv = LDKCOption_NoneZ_to_cs(AcceptChannelV2_get_require_confirmed_inputs(&this_ptr_conv)); + int8_t ret_conv = Stfu_get_initiator(&this_ptr_conv); return ret_conv; } -void CS_LDK_AcceptChannelV2_set_require_confirmed_inputs(int64_t this_ptr, int32_t val) { - LDKAcceptChannelV2 this_ptr_conv; +void CS_LDK_Stfu_set_initiator(int64_t this_ptr, int8_t val) { + LDKStfu this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); - AcceptChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); + Stfu_set_initiator(&this_ptr_conv, val); } -int64_t CS_LDK_AcceptChannelV2_new(int8_tArray temporary_channel_id_arg, int64_t funding_satoshis_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t htlc_minimum_msat_arg, int32_t minimum_depth_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_basepoint_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg, int8_tArray first_per_commitment_point_arg, int8_tArray second_per_commitment_point_arg, int64_t shutdown_scriptpubkey_arg, int64_t channel_type_arg, int32_t require_confirmed_inputs_arg) { - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg); - LDKPublicKey funding_pubkey_arg_ref; - CHECK(funding_pubkey_arg->arr_len == 33); - memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); - LDKPublicKey revocation_basepoint_arg_ref; - CHECK(revocation_basepoint_arg->arr_len == 33); - memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg); - LDKPublicKey payment_basepoint_arg_ref; - CHECK(payment_basepoint_arg->arr_len == 33); - memcpy(payment_basepoint_arg_ref.compressed_form, payment_basepoint_arg->elems, 33); FREE(payment_basepoint_arg); - LDKPublicKey delayed_payment_basepoint_arg_ref; - CHECK(delayed_payment_basepoint_arg->arr_len == 33); - memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg); - LDKPublicKey htlc_basepoint_arg_ref; - CHECK(htlc_basepoint_arg->arr_len == 33); - memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg); - LDKPublicKey first_per_commitment_point_arg_ref; - CHECK(first_per_commitment_point_arg->arr_len == 33); - memcpy(first_per_commitment_point_arg_ref.compressed_form, first_per_commitment_point_arg->elems, 33); FREE(first_per_commitment_point_arg); - LDKPublicKey second_per_commitment_point_arg_ref; - CHECK(second_per_commitment_point_arg->arr_len == 33); - memcpy(second_per_commitment_point_arg_ref.compressed_form, second_per_commitment_point_arg->elems, 33); FREE(second_per_commitment_point_arg); - void* shutdown_scriptpubkey_arg_ptr = untag_ptr(shutdown_scriptpubkey_arg); - CHECK_ACCESS(shutdown_scriptpubkey_arg_ptr); - LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg_conv = *(LDKCOption_CVec_u8ZZ*)(shutdown_scriptpubkey_arg_ptr); - shutdown_scriptpubkey_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(shutdown_scriptpubkey_arg)); - LDKChannelTypeFeatures channel_type_arg_conv; - channel_type_arg_conv.inner = untag_ptr(channel_type_arg); - channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); - channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); - LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_cs(require_confirmed_inputs_arg); - LDKAcceptChannelV2 ret_var = AcceptChannelV2_new(temporary_channel_id_arg_ref, funding_satoshis_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, minimum_depth_arg, to_self_delay_arg, max_accepted_htlcs_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_basepoint_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, second_per_commitment_point_arg_ref, shutdown_scriptpubkey_arg_conv, channel_type_arg_conv, require_confirmed_inputs_arg_conv); +int64_t CS_LDK_Stfu_new(int64_t channel_id_arg, int8_t initiator_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKStfu ret_var = Stfu_new(channel_id_arg_conv, initiator_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t AcceptChannelV2_clone_ptr(LDKAcceptChannelV2 *NONNULL_PTR arg) { - LDKAcceptChannelV2 ret_var = AcceptChannelV2_clone(arg); +static inline uint64_t Stfu_clone_ptr(LDKStfu *NONNULL_PTR arg) { + LDKStfu ret_var = Stfu_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_AcceptChannelV2_clone_ptr(int64_t arg) { - LDKAcceptChannelV2 arg_conv; +int64_t CS_LDK_Stfu_clone_ptr(int64_t arg) { + LDKStfu arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = AcceptChannelV2_clone_ptr(&arg_conv); + int64_t ret_conv = Stfu_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_AcceptChannelV2_clone(int64_t orig) { - LDKAcceptChannelV2 orig_conv; +int64_t CS_LDK_Stfu_clone(int64_t orig) { + LDKStfu orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKAcceptChannelV2 ret_var = AcceptChannelV2_clone(&orig_conv); + LDKStfu ret_var = Stfu_clone(&orig_conv); int64_t ret_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_AcceptChannelV2_eq(int64_t a, int64_t b) { - LDKAcceptChannelV2 a_conv; +jboolean CS_LDK_Stfu_eq(int64_t a, int64_t b) { + LDKStfu a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKAcceptChannelV2 b_conv; + LDKStfu b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = AcceptChannelV2_eq(&a_conv, &b_conv); + jboolean ret_conv = Stfu_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_FundingCreated_free(int64_t this_obj) { - LDKFundingCreated this_obj_conv; +void CS_LDK_Splice_free(int64_t this_obj) { + LDKSplice this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FundingCreated_free(this_obj_conv); + Splice_free(this_obj_conv); } -int8_tArray CS_LDK_FundingCreated_get_temporary_channel_id(int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; +int64_t CS_LDK_Splice_get_channel_id(int64_t this_ptr) { + LDKSplice this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = Splice_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_FundingCreated_set_temporary_channel_id(int64_t this_ptr, int8_tArray val) { - LDKFundingCreated this_ptr_conv; +void CS_LDK_Splice_set_channel_id(int64_t this_ptr, int64_t val) { + LDKSplice this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + Splice_set_channel_id(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_FundingCreated_get_funding_txid(int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; +int8_tArray CS_LDK_Splice_get_chain_hash(int64_t this_ptr) { + LDKSplice this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *FundingCreated_get_funding_txid(&this_ptr_conv), 32); + memcpy(ret_arr->elems, *Splice_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_FundingCreated_set_funding_txid(int64_t this_ptr, int8_tArray val) { - LDKFundingCreated this_ptr_conv; +void CS_LDK_Splice_set_chain_hash(int64_t this_ptr, int8_tArray val) { + LDKSplice this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -39835,134 +49114,201 @@ void CS_LDK_FundingCreated_set_funding_txid(int64_t this_ptr, int8_tArray val) LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); memcpy(val_ref.data, val->elems, 32); FREE(val); - FundingCreated_set_funding_txid(&this_ptr_conv, val_ref); + Splice_set_chain_hash(&this_ptr_conv, val_ref); } -int16_t CS_LDK_FundingCreated_get_funding_output_index(int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; +int64_t CS_LDK_Splice_get_relative_satoshis(int64_t this_ptr) { + LDKSplice this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv); + int64_t ret_conv = Splice_get_relative_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_FundingCreated_set_funding_output_index(int64_t this_ptr, int16_t val) { - LDKFundingCreated this_ptr_conv; +void CS_LDK_Splice_set_relative_satoshis(int64_t this_ptr, int64_t val) { + LDKSplice this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - FundingCreated_set_funding_output_index(&this_ptr_conv, val); + Splice_set_relative_satoshis(&this_ptr_conv, val); } -int8_tArray CS_LDK_FundingCreated_get_signature(int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; +int32_t CS_LDK_Splice_get_funding_feerate_perkw(int64_t this_ptr) { + LDKSplice this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, FundingCreated_get_signature(&this_ptr_conv).compact_form, 64); + int32_t ret_conv = Splice_get_funding_feerate_perkw(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_Splice_set_funding_feerate_perkw(int64_t this_ptr, int32_t val) { + LDKSplice this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + Splice_set_funding_feerate_perkw(&this_ptr_conv, val); +} + +int32_t CS_LDK_Splice_get_locktime(int64_t this_ptr) { + LDKSplice this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = Splice_get_locktime(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_Splice_set_locktime(int64_t this_ptr, int32_t val) { + LDKSplice this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + Splice_set_locktime(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_Splice_get_funding_pubkey(int64_t this_ptr) { + LDKSplice this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Splice_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_FundingCreated_set_signature(int64_t this_ptr, int8_tArray val) { - LDKFundingCreated this_ptr_conv; +void CS_LDK_Splice_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { + LDKSplice this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKECDSASignature val_ref; - CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); FREE(val); - FundingCreated_set_signature(&this_ptr_conv, val_ref); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + Splice_set_funding_pubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_FundingCreated_new(int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) { - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg); - LDKThirtyTwoBytes funding_txid_arg_ref; - CHECK(funding_txid_arg->arr_len == 32); - memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); FREE(funding_txid_arg); - LDKECDSASignature signature_arg_ref; - CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); - LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref); +int64_t CS_LDK_Splice_new(int64_t channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int32_t funding_feerate_perkw_arg, int32_t locktime_arg, int8_tArray funding_pubkey_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK(chain_hash_arg->arr_len == 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); + LDKPublicKey funding_pubkey_arg_ref; + CHECK(funding_pubkey_arg->arr_len == 33); + memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); + LDKSplice ret_var = Splice_new(channel_id_arg_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { - LDKFundingCreated ret_var = FundingCreated_clone(arg); +static inline uint64_t Splice_clone_ptr(LDKSplice *NONNULL_PTR arg) { + LDKSplice ret_var = Splice_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_FundingCreated_clone_ptr(int64_t arg) { - LDKFundingCreated arg_conv; +int64_t CS_LDK_Splice_clone_ptr(int64_t arg) { + LDKSplice arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv); + int64_t ret_conv = Splice_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_FundingCreated_clone(int64_t orig) { - LDKFundingCreated orig_conv; +int64_t CS_LDK_Splice_clone(int64_t orig) { + LDKSplice orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); + LDKSplice ret_var = Splice_clone(&orig_conv); int64_t ret_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_FundingCreated_eq(int64_t a, int64_t b) { - LDKFundingCreated a_conv; +jboolean CS_LDK_Splice_eq(int64_t a, int64_t b) { + LDKSplice a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKFundingCreated b_conv; + LDKSplice b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = FundingCreated_eq(&a_conv, &b_conv); + jboolean ret_conv = Splice_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_FundingSigned_free(int64_t this_obj) { - LDKFundingSigned this_obj_conv; +void CS_LDK_SpliceAck_free(int64_t this_obj) { + LDKSpliceAck this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FundingSigned_free(this_obj_conv); + SpliceAck_free(this_obj_conv); } -int8_tArray CS_LDK_FundingSigned_get_channel_id(int64_t this_ptr) { - LDKFundingSigned this_ptr_conv; +int64_t CS_LDK_SpliceAck_get_channel_id(int64_t this_ptr) { + LDKSpliceAck this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelId ret_var = SpliceAck_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_SpliceAck_set_channel_id(int64_t this_ptr, int64_t val) { + LDKSpliceAck this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + SpliceAck_set_channel_id(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_SpliceAck_get_chain_hash(int64_t this_ptr) { + LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *FundingSigned_get_channel_id(&this_ptr_conv), 32); + memcpy(ret_arr->elems, *SpliceAck_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_FundingSigned_set_channel_id(int64_t this_ptr, int8_tArray val) { - LDKFundingSigned this_ptr_conv; +void CS_LDK_SpliceAck_set_chain_hash(int64_t this_ptr, int8_tArray val) { + LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -39970,230 +49316,205 @@ void CS_LDK_FundingSigned_set_channel_id(int64_t this_ptr, int8_tArray val) { LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); memcpy(val_ref.data, val->elems, 32); FREE(val); - FundingSigned_set_channel_id(&this_ptr_conv, val_ref); + SpliceAck_set_chain_hash(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_FundingSigned_get_signature(int64_t this_ptr) { - LDKFundingSigned this_ptr_conv; +int64_t CS_LDK_SpliceAck_get_relative_satoshis(int64_t this_ptr) { + LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, FundingSigned_get_signature(&this_ptr_conv).compact_form, 64); + int64_t ret_conv = SpliceAck_get_relative_satoshis(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_SpliceAck_set_relative_satoshis(int64_t this_ptr, int64_t val) { + LDKSpliceAck this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + SpliceAck_set_relative_satoshis(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_SpliceAck_get_funding_pubkey(int64_t this_ptr) { + LDKSpliceAck this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, SpliceAck_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void CS_LDK_FundingSigned_set_signature(int64_t this_ptr, int8_tArray val) { - LDKFundingSigned this_ptr_conv; +void CS_LDK_SpliceAck_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { + LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKECDSASignature val_ref; - CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); FREE(val); - FundingSigned_set_signature(&this_ptr_conv, val_ref); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + SpliceAck_set_funding_pubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_FundingSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); - LDKECDSASignature signature_arg_ref; - CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); - LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref); +int64_t CS_LDK_SpliceAck_new(int64_t channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int8_tArray funding_pubkey_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK(chain_hash_arg->arr_len == 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); + LDKPublicKey funding_pubkey_arg_ref; + CHECK(funding_pubkey_arg->arr_len == 33); + memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); + LDKSpliceAck ret_var = SpliceAck_new(channel_id_arg_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_pubkey_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { - LDKFundingSigned ret_var = FundingSigned_clone(arg); +static inline uint64_t SpliceAck_clone_ptr(LDKSpliceAck *NONNULL_PTR arg) { + LDKSpliceAck ret_var = SpliceAck_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_FundingSigned_clone_ptr(int64_t arg) { - LDKFundingSigned arg_conv; +int64_t CS_LDK_SpliceAck_clone_ptr(int64_t arg) { + LDKSpliceAck arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv); + int64_t ret_conv = SpliceAck_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_FundingSigned_clone(int64_t orig) { - LDKFundingSigned orig_conv; +int64_t CS_LDK_SpliceAck_clone(int64_t orig) { + LDKSpliceAck orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); + LDKSpliceAck ret_var = SpliceAck_clone(&orig_conv); int64_t ret_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_FundingSigned_eq(int64_t a, int64_t b) { - LDKFundingSigned a_conv; +jboolean CS_LDK_SpliceAck_eq(int64_t a, int64_t b) { + LDKSpliceAck a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKFundingSigned b_conv; + LDKSpliceAck b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = FundingSigned_eq(&a_conv, &b_conv); + jboolean ret_conv = SpliceAck_eq(&a_conv, &b_conv); return ret_conv; } -void CS_LDK_ChannelReady_free(int64_t this_obj) { - LDKChannelReady this_obj_conv; +void CS_LDK_SpliceLocked_free(int64_t this_obj) { + LDKSpliceLocked this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelReady_free(this_obj_conv); -} - -int8_tArray CS_LDK_ChannelReady_get_channel_id(int64_t this_ptr) { - LDKChannelReady this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ChannelReady_get_channel_id(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_ChannelReady_set_channel_id(int64_t this_ptr, int8_tArray val) { - LDKChannelReady this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ChannelReady_set_channel_id(&this_ptr_conv, val_ref); -} - -int8_tArray CS_LDK_ChannelReady_get_next_per_commitment_point(int64_t this_ptr) { - LDKChannelReady this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_ChannelReady_set_next_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKChannelReady this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref); + SpliceLocked_free(this_obj_conv); } -int64_t CS_LDK_ChannelReady_get_short_channel_id_alias(int64_t this_ptr) { - LDKChannelReady this_ptr_conv; +int64_t CS_LDK_SpliceLocked_get_channel_id(int64_t this_ptr) { + LDKSpliceLocked this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKChannelId ret_var = SpliceLocked_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void CS_LDK_ChannelReady_set_short_channel_id_alias(int64_t this_ptr, int64_t val) { - LDKChannelReady this_ptr_conv; +void CS_LDK_SpliceLocked_set_channel_id(int64_t this_ptr, int64_t val) { + LDKSpliceLocked this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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)); - ChannelReady_set_short_channel_id_alias(&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); + SpliceLocked_set_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelReady_new(int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_t short_channel_id_alias_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); - LDKPublicKey next_per_commitment_point_arg_ref; - CHECK(next_per_commitment_point_arg->arr_len == 33); - memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg); - void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg); - CHECK_ACCESS(short_channel_id_alias_arg_ptr); - LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr); - short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg)); - LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv); +int64_t CS_LDK_SpliceLocked_new(int64_t channel_id_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) { - LDKChannelReady ret_var = ChannelReady_clone(arg); +static inline uint64_t SpliceLocked_clone_ptr(LDKSpliceLocked *NONNULL_PTR arg) { + LDKSpliceLocked ret_var = SpliceLocked_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_ChannelReady_clone_ptr(int64_t arg) { - LDKChannelReady arg_conv; +int64_t CS_LDK_SpliceLocked_clone_ptr(int64_t arg) { + LDKSpliceLocked arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv); + int64_t ret_conv = SpliceLocked_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_ChannelReady_clone(int64_t orig) { - LDKChannelReady orig_conv; +int64_t CS_LDK_SpliceLocked_clone(int64_t orig) { + LDKSpliceLocked orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKChannelReady ret_var = ChannelReady_clone(&orig_conv); + LDKSpliceLocked ret_var = SpliceLocked_clone(&orig_conv); int64_t ret_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_ChannelReady_eq(int64_t a, int64_t b) { - LDKChannelReady a_conv; +jboolean CS_LDK_SpliceLocked_eq(int64_t a, int64_t b) { + LDKSpliceLocked a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKChannelReady b_conv; + LDKSpliceLocked b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = ChannelReady_eq(&a_conv, &b_conv); + jboolean ret_conv = SpliceLocked_eq(&a_conv, &b_conv); return ret_conv; } @@ -40205,27 +49526,31 @@ void CS_LDK_TxAddInput_free(int64_t this_obj) { TxAddInput_free(this_obj_conv); } -int8_tArray CS_LDK_TxAddInput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAddInput_get_channel_id(int64_t this_ptr) { LDKTxAddInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *TxAddInput_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxAddInput_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxAddInput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAddInput_set_channel_id(int64_t this_ptr, int64_t val) { LDKTxAddInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - TxAddInput_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + TxAddInput_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_TxAddInput_get_serial_id(int64_t this_ptr) { @@ -40312,16 +49637,18 @@ void CS_LDK_TxAddInput_set_sequence(int64_t this_ptr, int32_t val) { TxAddInput_set_sequence(&this_ptr_conv, val); } -int64_t CS_LDK_TxAddInput_new(int8_tArray channel_id_arg, int64_t serial_id_arg, int64_t prevtx_arg, int32_t prevtx_out_arg, int32_t sequence_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_TxAddInput_new(int64_t channel_id_arg, int64_t serial_id_arg, int64_t prevtx_arg, int32_t prevtx_out_arg, int32_t sequence_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKTransactionU16LenLimited prevtx_arg_conv; prevtx_arg_conv.inner = untag_ptr(prevtx_arg); prevtx_arg_conv.is_owned = ptr_is_owned(prevtx_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(prevtx_arg_conv); prevtx_arg_conv = TransactionU16LenLimited_clone(&prevtx_arg_conv); - LDKTxAddInput ret_var = TxAddInput_new(channel_id_arg_ref, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg); + LDKTxAddInput ret_var = TxAddInput_new(channel_id_arg_conv, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -40358,6 +49685,16 @@ int64_t CS_LDK_TxAddInput_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_TxAddInput_hash(int64_t o) { + LDKTxAddInput o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TxAddInput_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_TxAddInput_eq(int64_t a, int64_t b) { LDKTxAddInput a_conv; a_conv.inner = untag_ptr(a); @@ -40381,27 +49718,31 @@ void CS_LDK_TxAddOutput_free(int64_t this_obj) { TxAddOutput_free(this_obj_conv); } -int8_tArray CS_LDK_TxAddOutput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAddOutput_get_channel_id(int64_t this_ptr) { LDKTxAddOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *TxAddOutput_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxAddOutput_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxAddOutput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAddOutput_set_channel_id(int64_t this_ptr, int64_t val) { LDKTxAddOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - TxAddOutput_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + TxAddOutput_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_TxAddOutput_get_serial_id(int64_t this_ptr) { @@ -40448,9 +49789,10 @@ int8_tArray CS_LDK_TxAddOutput_get_script(int64_t this_ptr) { this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKu8slice ret_var = TxAddOutput_get_script(&this_ptr_conv); + LDKCVec_u8Z ret_var = TxAddOutput_get_script(&this_ptr_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } @@ -40467,15 +49809,17 @@ void CS_LDK_TxAddOutput_set_script(int64_t this_ptr, int8_tArray val) { TxAddOutput_set_script(&this_ptr_conv, val_ref); } -int64_t CS_LDK_TxAddOutput_new(int8_tArray channel_id_arg, int64_t serial_id_arg, int64_t sats_arg, int8_tArray script_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_TxAddOutput_new(int64_t channel_id_arg, int64_t serial_id_arg, int64_t sats_arg, int8_tArray script_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKCVec_u8Z script_arg_ref; script_arg_ref.datalen = script_arg->arr_len; script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg); - LDKTxAddOutput ret_var = TxAddOutput_new(channel_id_arg_ref, serial_id_arg, sats_arg, script_arg_ref); + LDKTxAddOutput ret_var = TxAddOutput_new(channel_id_arg_conv, serial_id_arg, sats_arg, script_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -40512,6 +49856,16 @@ int64_t CS_LDK_TxAddOutput_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_TxAddOutput_hash(int64_t o) { + LDKTxAddOutput o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TxAddOutput_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_TxAddOutput_eq(int64_t a, int64_t b) { LDKTxAddOutput a_conv; a_conv.inner = untag_ptr(a); @@ -40535,27 +49889,31 @@ void CS_LDK_TxRemoveInput_free(int64_t this_obj) { TxRemoveInput_free(this_obj_conv); } -int8_tArray CS_LDK_TxRemoveInput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxRemoveInput_get_channel_id(int64_t this_ptr) { LDKTxRemoveInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *TxRemoveInput_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxRemoveInput_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxRemoveInput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxRemoveInput_set_channel_id(int64_t this_ptr, int64_t val) { LDKTxRemoveInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - TxRemoveInput_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + TxRemoveInput_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_TxRemoveInput_get_serial_id(int64_t this_ptr) { @@ -40577,11 +49935,13 @@ void CS_LDK_TxRemoveInput_set_serial_id(int64_t this_ptr, int64_t val) { TxRemoveInput_set_serial_id(&this_ptr_conv, val); } -int64_t CS_LDK_TxRemoveInput_new(int8_tArray channel_id_arg, int64_t serial_id_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); - LDKTxRemoveInput ret_var = TxRemoveInput_new(channel_id_arg_ref, serial_id_arg); +int64_t CS_LDK_TxRemoveInput_new(int64_t channel_id_arg, int64_t serial_id_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKTxRemoveInput ret_var = TxRemoveInput_new(channel_id_arg_conv, serial_id_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -40618,6 +49978,16 @@ int64_t CS_LDK_TxRemoveInput_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_TxRemoveInput_hash(int64_t o) { + LDKTxRemoveInput o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TxRemoveInput_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_TxRemoveInput_eq(int64_t a, int64_t b) { LDKTxRemoveInput a_conv; a_conv.inner = untag_ptr(a); @@ -40641,27 +50011,31 @@ void CS_LDK_TxRemoveOutput_free(int64_t this_obj) { TxRemoveOutput_free(this_obj_conv); } -int8_tArray CS_LDK_TxRemoveOutput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxRemoveOutput_get_channel_id(int64_t this_ptr) { LDKTxRemoveOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *TxRemoveOutput_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxRemoveOutput_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxRemoveOutput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxRemoveOutput_set_channel_id(int64_t this_ptr, int64_t val) { LDKTxRemoveOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - TxRemoveOutput_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + TxRemoveOutput_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_TxRemoveOutput_get_serial_id(int64_t this_ptr) { @@ -40683,11 +50057,13 @@ void CS_LDK_TxRemoveOutput_set_serial_id(int64_t this_ptr, int64_t val) { TxRemoveOutput_set_serial_id(&this_ptr_conv, val); } -int64_t CS_LDK_TxRemoveOutput_new(int8_tArray channel_id_arg, int64_t serial_id_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); - LDKTxRemoveOutput ret_var = TxRemoveOutput_new(channel_id_arg_ref, serial_id_arg); +int64_t CS_LDK_TxRemoveOutput_new(int64_t channel_id_arg, int64_t serial_id_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKTxRemoveOutput ret_var = TxRemoveOutput_new(channel_id_arg_conv, serial_id_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -40724,6 +50100,16 @@ int64_t CS_LDK_TxRemoveOutput_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_TxRemoveOutput_hash(int64_t o) { + LDKTxRemoveOutput o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TxRemoveOutput_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_TxRemoveOutput_eq(int64_t a, int64_t b) { LDKTxRemoveOutput a_conv; a_conv.inner = untag_ptr(a); @@ -40747,34 +50133,40 @@ void CS_LDK_TxComplete_free(int64_t this_obj) { TxComplete_free(this_obj_conv); } -int8_tArray CS_LDK_TxComplete_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxComplete_get_channel_id(int64_t this_ptr) { LDKTxComplete this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *TxComplete_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxComplete_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxComplete_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxComplete_set_channel_id(int64_t this_ptr, int64_t val) { LDKTxComplete this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - TxComplete_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + TxComplete_set_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_TxComplete_new(int8_tArray channel_id_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); - LDKTxComplete ret_var = TxComplete_new(channel_id_arg_ref); +int64_t CS_LDK_TxComplete_new(int64_t channel_id_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKTxComplete ret_var = TxComplete_new(channel_id_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -40811,6 +50203,16 @@ int64_t CS_LDK_TxComplete_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_TxComplete_hash(int64_t o) { + LDKTxComplete o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TxComplete_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_TxComplete_eq(int64_t a, int64_t b) { LDKTxComplete a_conv; a_conv.inner = untag_ptr(a); @@ -40834,27 +50236,31 @@ void CS_LDK_TxSignatures_free(int64_t this_obj) { TxSignatures_free(this_obj_conv); } -int8_tArray CS_LDK_TxSignatures_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxSignatures_get_channel_id(int64_t this_ptr) { LDKTxSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *TxSignatures_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxSignatures_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxSignatures_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxSignatures_set_channel_id(int64_t this_ptr, int64_t val) { LDKTxSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - TxSignatures_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + TxSignatures_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray CS_LDK_TxSignatures_get_tx_hash(int64_t this_ptr) { @@ -40928,10 +50334,37 @@ void CS_LDK_TxSignatures_set_witnesses(int64_t this_ptr, ptrArray val) { TxSignatures_set_witnesses(&this_ptr_conv, val_constr); } -int64_t CS_LDK_TxSignatures_new(int8_tArray channel_id_arg, int8_tArray tx_hash_arg, ptrArray witnesses_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_TxSignatures_get_funding_outpoint_sig(int64_t this_ptr) { + LDKTxSignatures this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = TxSignatures_get_funding_outpoint_sig(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TxSignatures_set_funding_outpoint_sig(int64_t this_ptr, int64_t val) { + LDKTxSignatures this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ECDSASignatureZ val_conv = *(LDKCOption_ECDSASignatureZ*)(val_ptr); + val_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(val)); + TxSignatures_set_funding_outpoint_sig(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_TxSignatures_new(int64_t channel_id_arg, int8_tArray tx_hash_arg, ptrArray witnesses_arg, int64_t funding_outpoint_sig_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKThirtyTwoBytes tx_hash_arg_ref; CHECK(tx_hash_arg->arr_len == 32); memcpy(tx_hash_arg_ref.data, tx_hash_arg->elems, 32); FREE(tx_hash_arg); @@ -40952,7 +50385,11 @@ int64_t CS_LDK_TxSignatures_new(int8_tArray channel_id_arg, int8_tArray tx_hash witnesses_arg_constr.data[i] = witnesses_arg_conv_8_ref; } FREE(witnesses_arg); - LDKTxSignatures ret_var = TxSignatures_new(channel_id_arg_ref, tx_hash_arg_ref, witnesses_arg_constr); + void* funding_outpoint_sig_arg_ptr = untag_ptr(funding_outpoint_sig_arg); + CHECK_ACCESS(funding_outpoint_sig_arg_ptr); + LDKCOption_ECDSASignatureZ funding_outpoint_sig_arg_conv = *(LDKCOption_ECDSASignatureZ*)(funding_outpoint_sig_arg_ptr); + funding_outpoint_sig_arg_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(funding_outpoint_sig_arg)); + LDKTxSignatures ret_var = TxSignatures_new(channel_id_arg_conv, tx_hash_arg_ref, witnesses_arg_constr, funding_outpoint_sig_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -40989,6 +50426,16 @@ int64_t CS_LDK_TxSignatures_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_TxSignatures_hash(int64_t o) { + LDKTxSignatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TxSignatures_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_TxSignatures_eq(int64_t a, int64_t b) { LDKTxSignatures a_conv; a_conv.inner = untag_ptr(a); @@ -41012,27 +50459,31 @@ void CS_LDK_TxInitRbf_free(int64_t this_obj) { TxInitRbf_free(this_obj_conv); } -int8_tArray CS_LDK_TxInitRbf_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxInitRbf_get_channel_id(int64_t this_ptr) { LDKTxInitRbf this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *TxInitRbf_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxInitRbf_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxInitRbf_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxInitRbf_set_channel_id(int64_t this_ptr, int64_t val) { LDKTxInitRbf this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - TxInitRbf_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + TxInitRbf_set_channel_id(&this_ptr_conv, val_conv); } int32_t CS_LDK_TxInitRbf_get_locktime(int64_t this_ptr) { @@ -41098,15 +50549,17 @@ void CS_LDK_TxInitRbf_set_funding_output_contribution(int64_t this_ptr, int64_t TxInitRbf_set_funding_output_contribution(&this_ptr_conv, val_conv); } -int64_t CS_LDK_TxInitRbf_new(int8_tArray channel_id_arg, int32_t locktime_arg, int32_t feerate_sat_per_1000_weight_arg, int64_t funding_output_contribution_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_TxInitRbf_new(int64_t channel_id_arg, int32_t locktime_arg, int32_t feerate_sat_per_1000_weight_arg, int64_t funding_output_contribution_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); void* funding_output_contribution_arg_ptr = untag_ptr(funding_output_contribution_arg); CHECK_ACCESS(funding_output_contribution_arg_ptr); LDKCOption_i64Z funding_output_contribution_arg_conv = *(LDKCOption_i64Z*)(funding_output_contribution_arg_ptr); funding_output_contribution_arg_conv = COption_i64Z_clone((LDKCOption_i64Z*)untag_ptr(funding_output_contribution_arg)); - LDKTxInitRbf ret_var = TxInitRbf_new(channel_id_arg_ref, locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_arg_conv); + LDKTxInitRbf ret_var = TxInitRbf_new(channel_id_arg_conv, locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -41143,6 +50596,16 @@ int64_t CS_LDK_TxInitRbf_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_TxInitRbf_hash(int64_t o) { + LDKTxInitRbf o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TxInitRbf_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_TxInitRbf_eq(int64_t a, int64_t b) { LDKTxInitRbf a_conv; a_conv.inner = untag_ptr(a); @@ -41166,27 +50629,31 @@ void CS_LDK_TxAckRbf_free(int64_t this_obj) { TxAckRbf_free(this_obj_conv); } -int8_tArray CS_LDK_TxAckRbf_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAckRbf_get_channel_id(int64_t this_ptr) { LDKTxAckRbf this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *TxAckRbf_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxAckRbf_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxAckRbf_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAckRbf_set_channel_id(int64_t this_ptr, int64_t val) { LDKTxAckRbf this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - TxAckRbf_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + TxAckRbf_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_TxAckRbf_get_funding_output_contribution(int64_t this_ptr) { @@ -41214,15 +50681,17 @@ void CS_LDK_TxAckRbf_set_funding_output_contribution(int64_t this_ptr, int64_t TxAckRbf_set_funding_output_contribution(&this_ptr_conv, val_conv); } -int64_t CS_LDK_TxAckRbf_new(int8_tArray channel_id_arg, int64_t funding_output_contribution_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_TxAckRbf_new(int64_t channel_id_arg, int64_t funding_output_contribution_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); void* funding_output_contribution_arg_ptr = untag_ptr(funding_output_contribution_arg); CHECK_ACCESS(funding_output_contribution_arg_ptr); LDKCOption_i64Z funding_output_contribution_arg_conv = *(LDKCOption_i64Z*)(funding_output_contribution_arg_ptr); funding_output_contribution_arg_conv = COption_i64Z_clone((LDKCOption_i64Z*)untag_ptr(funding_output_contribution_arg)); - LDKTxAckRbf ret_var = TxAckRbf_new(channel_id_arg_ref, funding_output_contribution_arg_conv); + LDKTxAckRbf ret_var = TxAckRbf_new(channel_id_arg_conv, funding_output_contribution_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -41259,6 +50728,16 @@ int64_t CS_LDK_TxAckRbf_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_TxAckRbf_hash(int64_t o) { + LDKTxAckRbf o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TxAckRbf_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_TxAckRbf_eq(int64_t a, int64_t b) { LDKTxAckRbf a_conv; a_conv.inner = untag_ptr(a); @@ -41282,27 +50761,31 @@ void CS_LDK_TxAbort_free(int64_t this_obj) { TxAbort_free(this_obj_conv); } -int8_tArray CS_LDK_TxAbort_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAbort_get_channel_id(int64_t this_ptr) { LDKTxAbort this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *TxAbort_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxAbort_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxAbort_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAbort_set_channel_id(int64_t this_ptr, int64_t val) { LDKTxAbort this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - TxAbort_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + TxAbort_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray CS_LDK_TxAbort_get_data(int64_t this_ptr) { @@ -41331,15 +50814,17 @@ void CS_LDK_TxAbort_set_data(int64_t this_ptr, int8_tArray val) { TxAbort_set_data(&this_ptr_conv, val_ref); } -int64_t CS_LDK_TxAbort_new(int8_tArray channel_id_arg, int8_tArray data_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_TxAbort_new(int64_t channel_id_arg, int8_tArray data_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKCVec_u8Z data_arg_ref; data_arg_ref.datalen = data_arg->arr_len; data_arg_ref.data = MALLOC(data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); memcpy(data_arg_ref.data, data_arg->elems, data_arg_ref.datalen); FREE(data_arg); - LDKTxAbort ret_var = TxAbort_new(channel_id_arg_ref, data_arg_ref); + LDKTxAbort ret_var = TxAbort_new(channel_id_arg_conv, data_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -41376,6 +50861,16 @@ int64_t CS_LDK_TxAbort_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_TxAbort_hash(int64_t o) { + LDKTxAbort o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TxAbort_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_TxAbort_eq(int64_t a, int64_t b) { LDKTxAbort a_conv; a_conv.inner = untag_ptr(a); @@ -41399,27 +50894,31 @@ void CS_LDK_Shutdown_free(int64_t this_obj) { Shutdown_free(this_obj_conv); } -int8_tArray CS_LDK_Shutdown_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_Shutdown_get_channel_id(int64_t this_ptr) { LDKShutdown this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *Shutdown_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = Shutdown_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_Shutdown_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_Shutdown_set_channel_id(int64_t this_ptr, int64_t val) { LDKShutdown this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - Shutdown_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + Shutdown_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray CS_LDK_Shutdown_get_scriptpubkey(int64_t this_ptr) { @@ -41428,9 +50927,10 @@ int8_tArray CS_LDK_Shutdown_get_scriptpubkey(int64_t this_ptr) { this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv); + LDKCVec_u8Z ret_var = Shutdown_get_scriptpubkey(&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; } @@ -41447,15 +50947,17 @@ void CS_LDK_Shutdown_set_scriptpubkey(int64_t this_ptr, int8_tArray val) { Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_Shutdown_new(int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_Shutdown_new(int64_t channel_id_arg, int8_tArray scriptpubkey_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKCVec_u8Z scriptpubkey_arg_ref; scriptpubkey_arg_ref.datalen = scriptpubkey_arg->arr_len; scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); FREE(scriptpubkey_arg); - LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref); + LDKShutdown ret_var = Shutdown_new(channel_id_arg_conv, scriptpubkey_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -41492,6 +50994,16 @@ int64_t CS_LDK_Shutdown_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_Shutdown_hash(int64_t o) { + LDKShutdown o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Shutdown_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_Shutdown_eq(int64_t a, int64_t b) { LDKShutdown a_conv; a_conv.inner = untag_ptr(a); @@ -41591,6 +51103,16 @@ int64_t CS_LDK_ClosingSignedFeeRange_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_ClosingSignedFeeRange_hash(int64_t o) { + LDKClosingSignedFeeRange o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ClosingSignedFeeRange_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_ClosingSignedFeeRange_eq(int64_t a, int64_t b) { LDKClosingSignedFeeRange a_conv; a_conv.inner = untag_ptr(a); @@ -41614,27 +51136,31 @@ void CS_LDK_ClosingSigned_free(int64_t this_obj) { ClosingSigned_free(this_obj_conv); } -int8_tArray CS_LDK_ClosingSigned_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ClosingSigned_get_channel_id(int64_t this_ptr) { LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ClosingSigned_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ClosingSigned_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ClosingSigned_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ClosingSigned_set_channel_id(int64_t this_ptr, int64_t val) { LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ClosingSigned_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + ClosingSigned_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_ClosingSigned_get_fee_satoshis(int64_t this_ptr) { @@ -41706,10 +51232,12 @@ void CS_LDK_ClosingSigned_set_fee_range(int64_t this_ptr, int64_t val) { ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_t fee_range_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_ClosingSigned_new(int64_t channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_t fee_range_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKECDSASignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); @@ -41718,7 +51246,7 @@ int64_t CS_LDK_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satosh fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); - LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); + LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_conv, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -41755,6 +51283,16 @@ int64_t CS_LDK_ClosingSigned_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_ClosingSigned_hash(int64_t o) { + LDKClosingSigned o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ClosingSigned_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_ClosingSigned_eq(int64_t a, int64_t b) { LDKClosingSigned a_conv; a_conv.inner = untag_ptr(a); @@ -41778,27 +51316,31 @@ void CS_LDK_UpdateAddHTLC_free(int64_t this_obj) { UpdateAddHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateAddHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateAddHTLC_get_channel_id(int64_t this_ptr) { LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = UpdateAddHTLC_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_UpdateAddHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateAddHTLC_set_channel_id(int64_t this_ptr, int64_t val) { LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_UpdateAddHTLC_get_htlc_id(int64_t this_ptr) { @@ -41906,6 +51448,84 @@ void CS_LDK_UpdateAddHTLC_set_skimmed_fee_msat(int64_t this_ptr, int64_t val) { UpdateAddHTLC_set_skimmed_fee_msat(&this_ptr_conv, val_conv); } +int64_t CS_LDK_UpdateAddHTLC_get_onion_routing_packet(int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOnionPacket ret_var = UpdateAddHTLC_get_onion_routing_packet(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_UpdateAddHTLC_set_onion_routing_packet(int64_t this_ptr, int64_t val) { + LDKUpdateAddHTLC this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOnionPacket val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OnionPacket_clone(&val_conv); + UpdateAddHTLC_set_onion_routing_packet(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_UpdateAddHTLC_get_blinding_point(int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, UpdateAddHTLC_get_blinding_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_UpdateAddHTLC_set_blinding_point(int64_t this_ptr, int8_tArray val) { + LDKUpdateAddHTLC this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + UpdateAddHTLC_set_blinding_point(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_UpdateAddHTLC_new(int64_t channel_id_arg, int64_t htlc_id_arg, int64_t amount_msat_arg, int8_tArray payment_hash_arg, int32_t cltv_expiry_arg, int64_t skimmed_fee_msat_arg, int64_t onion_routing_packet_arg, int8_tArray blinding_point_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK(payment_hash_arg->arr_len == 32); + memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); + 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)); + LDKOnionPacket onion_routing_packet_arg_conv; + onion_routing_packet_arg_conv.inner = untag_ptr(onion_routing_packet_arg); + onion_routing_packet_arg_conv.is_owned = ptr_is_owned(onion_routing_packet_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_routing_packet_arg_conv); + onion_routing_packet_arg_conv = OnionPacket_clone(&onion_routing_packet_arg_conv); + LDKPublicKey blinding_point_arg_ref; + CHECK(blinding_point_arg->arr_len == 33); + memcpy(blinding_point_arg_ref.compressed_form, blinding_point_arg->elems, 33); FREE(blinding_point_arg); + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_new(channel_id_arg_conv, htlc_id_arg, amount_msat_arg, payment_hash_arg_ref, cltv_expiry_arg, skimmed_fee_msat_arg_conv, onion_routing_packet_arg_conv, blinding_point_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); int64_t ret_ref = 0; @@ -41936,6 +51556,16 @@ int64_t CS_LDK_UpdateAddHTLC_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_UpdateAddHTLC_hash(int64_t o) { + LDKUpdateAddHTLC o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UpdateAddHTLC_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_UpdateAddHTLC_eq(int64_t a, int64_t b) { LDKUpdateAddHTLC a_conv; a_conv.inner = untag_ptr(a); @@ -42055,6 +51685,16 @@ int64_t CS_LDK_OnionMessage_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_OnionMessage_hash(int64_t o) { + LDKOnionMessage o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = OnionMessage_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_OnionMessage_eq(int64_t a, int64_t b) { LDKOnionMessage a_conv; a_conv.inner = untag_ptr(a); @@ -42078,27 +51718,31 @@ void CS_LDK_UpdateFulfillHTLC_free(int64_t this_obj) { UpdateFulfillHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFulfillHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFulfillHTLC_get_channel_id(int64_t this_ptr) { LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = UpdateFulfillHTLC_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_UpdateFulfillHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFulfillHTLC_set_channel_id(int64_t this_ptr, int64_t val) { LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_UpdateFulfillHTLC_get_htlc_id(int64_t this_ptr) { @@ -42143,14 +51787,16 @@ void CS_LDK_UpdateFulfillHTLC_set_payment_preimage(int64_t this_ptr, int8_tArra UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref); } -int64_t CS_LDK_UpdateFulfillHTLC_new(int8_tArray channel_id_arg, int64_t htlc_id_arg, int8_tArray payment_preimage_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_UpdateFulfillHTLC_new(int64_t channel_id_arg, int64_t htlc_id_arg, int8_tArray payment_preimage_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKThirtyTwoBytes payment_preimage_arg_ref; CHECK(payment_preimage_arg->arr_len == 32); memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); FREE(payment_preimage_arg); - LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref); + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_conv, htlc_id_arg, payment_preimage_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -42187,6 +51833,16 @@ int64_t CS_LDK_UpdateFulfillHTLC_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_UpdateFulfillHTLC_hash(int64_t o) { + LDKUpdateFulfillHTLC o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UpdateFulfillHTLC_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_UpdateFulfillHTLC_eq(int64_t a, int64_t b) { LDKUpdateFulfillHTLC a_conv; a_conv.inner = untag_ptr(a); @@ -42210,27 +51866,31 @@ void CS_LDK_UpdateFailHTLC_free(int64_t this_obj) { UpdateFailHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFailHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFailHTLC_get_channel_id(int64_t this_ptr) { LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = UpdateFailHTLC_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_UpdateFailHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFailHTLC_set_channel_id(int64_t this_ptr, int64_t val) { LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_UpdateFailHTLC_get_htlc_id(int64_t this_ptr) { @@ -42282,6 +51942,16 @@ int64_t CS_LDK_UpdateFailHTLC_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_UpdateFailHTLC_hash(int64_t o) { + LDKUpdateFailHTLC o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UpdateFailHTLC_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_UpdateFailHTLC_eq(int64_t a, int64_t b) { LDKUpdateFailHTLC a_conv; a_conv.inner = untag_ptr(a); @@ -42305,27 +51975,31 @@ void CS_LDK_UpdateFailMalformedHTLC_free(int64_t this_obj) { UpdateFailMalformedHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFailMalformedHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFailMalformedHTLC_get_channel_id(int64_t this_ptr) { LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_UpdateFailMalformedHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFailMalformedHTLC_set_channel_id(int64_t this_ptr, int64_t val) { LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_UpdateFailMalformedHTLC_get_htlc_id(int64_t this_ptr) { @@ -42396,6 +52070,16 @@ int64_t CS_LDK_UpdateFailMalformedHTLC_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_UpdateFailMalformedHTLC_hash(int64_t o) { + LDKUpdateFailMalformedHTLC o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UpdateFailMalformedHTLC_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_UpdateFailMalformedHTLC_eq(int64_t a, int64_t b) { LDKUpdateFailMalformedHTLC a_conv; a_conv.inner = untag_ptr(a); @@ -42419,27 +52103,31 @@ void CS_LDK_CommitmentSigned_free(int64_t this_obj) { CommitmentSigned_free(this_obj_conv); } -int8_tArray CS_LDK_CommitmentSigned_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_CommitmentSigned_get_channel_id(int64_t this_ptr) { LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *CommitmentSigned_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = CommitmentSigned_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_CommitmentSigned_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_CommitmentSigned_set_channel_id(int64_t this_ptr, int64_t val) { LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + CommitmentSigned_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray CS_LDK_CommitmentSigned_get_signature(int64_t this_ptr) { @@ -42509,10 +52197,12 @@ void CS_LDK_CommitmentSigned_set_htlc_signatures(int64_t this_ptr, ptrArray val CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); } -int64_t CS_LDK_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_CommitmentSigned_new(int64_t channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKECDSASignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); @@ -42531,7 +52221,7 @@ int64_t CS_LDK_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray sig htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref; } FREE(htlc_signatures_arg); - LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr); + LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_conv, signature_arg_ref, htlc_signatures_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -42568,6 +52258,16 @@ int64_t CS_LDK_CommitmentSigned_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_CommitmentSigned_hash(int64_t o) { + LDKCommitmentSigned o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = CommitmentSigned_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_CommitmentSigned_eq(int64_t a, int64_t b) { LDKCommitmentSigned a_conv; a_conv.inner = untag_ptr(a); @@ -42591,27 +52291,31 @@ void CS_LDK_RevokeAndACK_free(int64_t this_obj) { RevokeAndACK_free(this_obj_conv); } -int8_tArray CS_LDK_RevokeAndACK_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_RevokeAndACK_get_channel_id(int64_t this_ptr) { LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *RevokeAndACK_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = RevokeAndACK_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_RevokeAndACK_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_RevokeAndACK_set_channel_id(int64_t this_ptr, int64_t val) { LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + RevokeAndACK_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray CS_LDK_RevokeAndACK_get_per_commitment_secret(int64_t this_ptr) { @@ -42660,17 +52364,19 @@ void CS_LDK_RevokeAndACK_set_next_per_commitment_point(int64_t this_ptr, int8_t RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref); } -int64_t CS_LDK_RevokeAndACK_new(int8_tArray channel_id_arg, int8_tArray per_commitment_secret_arg, int8_tArray next_per_commitment_point_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_RevokeAndACK_new(int64_t channel_id_arg, int8_tArray per_commitment_secret_arg, int8_tArray next_per_commitment_point_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKThirtyTwoBytes per_commitment_secret_arg_ref; CHECK(per_commitment_secret_arg->arr_len == 32); memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); FREE(per_commitment_secret_arg); LDKPublicKey next_per_commitment_point_arg_ref; CHECK(next_per_commitment_point_arg->arr_len == 33); memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg); - LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref); + LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_conv, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -42707,6 +52413,16 @@ int64_t CS_LDK_RevokeAndACK_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_RevokeAndACK_hash(int64_t o) { + LDKRevokeAndACK o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = RevokeAndACK_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_RevokeAndACK_eq(int64_t a, int64_t b) { LDKRevokeAndACK a_conv; a_conv.inner = untag_ptr(a); @@ -42730,27 +52446,31 @@ void CS_LDK_UpdateFee_free(int64_t this_obj) { UpdateFee_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFee_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFee_get_channel_id(int64_t this_ptr) { LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *UpdateFee_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = UpdateFee_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_UpdateFee_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFee_set_channel_id(int64_t this_ptr, int64_t val) { LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - UpdateFee_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + UpdateFee_set_channel_id(&this_ptr_conv, val_conv); } int32_t CS_LDK_UpdateFee_get_feerate_per_kw(int64_t this_ptr) { @@ -42772,11 +52492,13 @@ void CS_LDK_UpdateFee_set_feerate_per_kw(int64_t this_ptr, int32_t val) { UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } -int64_t CS_LDK_UpdateFee_new(int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); - LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg); +int64_t CS_LDK_UpdateFee_new(int64_t channel_id_arg, int32_t feerate_per_kw_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_conv, feerate_per_kw_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -42813,6 +52535,16 @@ int64_t CS_LDK_UpdateFee_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_UpdateFee_hash(int64_t o) { + LDKUpdateFee o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UpdateFee_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_UpdateFee_eq(int64_t a, int64_t b) { LDKUpdateFee a_conv; a_conv.inner = untag_ptr(a); @@ -42836,27 +52568,31 @@ void CS_LDK_ChannelReestablish_free(int64_t this_obj) { ChannelReestablish_free(this_obj_conv); } -int8_tArray CS_LDK_ChannelReestablish_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ChannelReestablish_get_channel_id(int64_t this_ptr) { LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ChannelReestablish_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ChannelReestablish_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelReestablish_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ChannelReestablish_set_channel_id(int64_t this_ptr, int64_t val) { LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + ChannelReestablish_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_ChannelReestablish_get_next_local_commitment_number(int64_t this_ptr) { @@ -42968,10 +52704,12 @@ void CS_LDK_ChannelReestablish_set_next_funding_txid(int64_t this_ptr, int64_t ChannelReestablish_set_next_funding_txid(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelReestablish_new(int8_tArray channel_id_arg, int64_t next_local_commitment_number_arg, int64_t next_remote_commitment_number_arg, int8_tArray your_last_per_commitment_secret_arg, int8_tArray my_current_per_commitment_point_arg, int64_t next_funding_txid_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_ChannelReestablish_new(int64_t channel_id_arg, int64_t next_local_commitment_number_arg, int64_t next_remote_commitment_number_arg, int8_tArray your_last_per_commitment_secret_arg, int8_tArray my_current_per_commitment_point_arg, int64_t next_funding_txid_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref; CHECK(your_last_per_commitment_secret_arg->arr_len == 32); memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); FREE(your_last_per_commitment_secret_arg); @@ -42982,7 +52720,7 @@ int64_t CS_LDK_ChannelReestablish_new(int8_tArray channel_id_arg, int64_t next_ CHECK_ACCESS(next_funding_txid_arg_ptr); LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(next_funding_txid_arg_ptr); next_funding_txid_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(next_funding_txid_arg)); - LDKChannelReestablish ret_var = ChannelReestablish_new(channel_id_arg_ref, next_local_commitment_number_arg, next_remote_commitment_number_arg, your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref, next_funding_txid_arg_conv); + LDKChannelReestablish ret_var = ChannelReestablish_new(channel_id_arg_conv, next_local_commitment_number_arg, next_remote_commitment_number_arg, your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref, next_funding_txid_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43019,6 +52757,16 @@ int64_t CS_LDK_ChannelReestablish_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_ChannelReestablish_hash(int64_t o) { + LDKChannelReestablish o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelReestablish_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_ChannelReestablish_eq(int64_t a, int64_t b) { LDKChannelReestablish a_conv; a_conv.inner = untag_ptr(a); @@ -43042,27 +52790,31 @@ void CS_LDK_AnnouncementSignatures_free(int64_t this_obj) { AnnouncementSignatures_free(this_obj_conv); } -int8_tArray CS_LDK_AnnouncementSignatures_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_AnnouncementSignatures_get_channel_id(int64_t this_ptr) { LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = AnnouncementSignatures_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_AnnouncementSignatures_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_AnnouncementSignatures_set_channel_id(int64_t this_ptr, int64_t val) { LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_conv); } int64_t CS_LDK_AnnouncementSignatures_get_short_channel_id(int64_t this_ptr) { @@ -43130,17 +52882,19 @@ void CS_LDK_AnnouncementSignatures_set_bitcoin_signature(int64_t this_ptr, int8 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref); } -int64_t CS_LDK_AnnouncementSignatures_new(int8_tArray channel_id_arg, int64_t short_channel_id_arg, int8_tArray node_signature_arg, int8_tArray bitcoin_signature_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_AnnouncementSignatures_new(int64_t channel_id_arg, int64_t short_channel_id_arg, int8_tArray node_signature_arg, int8_tArray bitcoin_signature_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKECDSASignature node_signature_arg_ref; CHECK(node_signature_arg->arr_len == 64); memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); FREE(node_signature_arg); LDKECDSASignature bitcoin_signature_arg_ref; CHECK(bitcoin_signature_arg->arr_len == 64); memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); FREE(bitcoin_signature_arg); - LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref); + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_conv, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43177,6 +52931,16 @@ int64_t CS_LDK_AnnouncementSignatures_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_AnnouncementSignatures_hash(int64_t o) { + LDKAnnouncementSignatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = AnnouncementSignatures_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_AnnouncementSignatures_eq(int64_t a, int64_t b) { LDKAnnouncementSignatures a_conv; a_conv.inner = untag_ptr(a); @@ -43273,6 +53037,12 @@ int64_t CS_LDK_SocketAddress_hostname(int64_t hostname, int16_t port) { return ret_ref; } +int64_t CS_LDK_SocketAddress_hash(int64_t o) { + LDKSocketAddress* o_conv = (LDKSocketAddress*)untag_ptr(o); + int64_t ret_conv = SocketAddress_hash(o_conv); + return ret_conv; +} + jboolean CS_LDK_SocketAddress_eq(int64_t a, int64_t b) { LDKSocketAddress* a_conv = (LDKSocketAddress*)untag_ptr(a); LDKSocketAddress* b_conv = (LDKSocketAddress*)untag_ptr(b); @@ -43325,6 +53095,12 @@ int32_t CS_LDK_SocketAddressParseError_invalid_onion_v3() { return ret_conv; } +int64_t CS_LDK_SocketAddressParseError_hash(int64_t o) { + LDKSocketAddressParseError* o_conv = (LDKSocketAddressParseError*)untag_ptr(o); + int64_t ret_conv = SocketAddressParseError_hash(o_conv); + return ret_conv; +} + jboolean CS_LDK_SocketAddressParseError_eq(int64_t a, int64_t b) { LDKSocketAddressParseError* a_conv = (LDKSocketAddressParseError*)untag_ptr(a); LDKSocketAddressParseError* b_conv = (LDKSocketAddressParseError*)untag_ptr(b); @@ -43332,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"); @@ -43605,6 +53389,107 @@ void CS_LDK_UnsignedNodeAnnouncement_set_addresses(int64_t this_ptr, int64_tArr UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); } +int8_tArray CS_LDK_UnsignedNodeAnnouncement_get_excess_address_data(int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_get_excess_address_data(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_UnsignedNodeAnnouncement_set_excess_address_data(int64_t this_ptr, int8_tArray val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + UnsignedNodeAnnouncement_set_excess_address_data(&this_ptr_conv, val_ref); +} + +int8_tArray CS_LDK_UnsignedNodeAnnouncement_get_excess_data(int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_get_excess_data(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_UnsignedNodeAnnouncement_set_excess_data(int64_t this_ptr, int8_tArray val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + UnsignedNodeAnnouncement_set_excess_data(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_UnsignedNodeAnnouncement_new(int64_t features_arg, int32_t timestamp_arg, int64_t node_id_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_tArray addresses_arg, int8_tArray excess_address_data_arg, int8_tArray excess_data_arg) { + LDKNodeFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = NodeFeatures_clone(&features_arg_conv); + LDKNodeId node_id_arg_conv; + node_id_arg_conv.inner = untag_ptr(node_id_arg); + node_id_arg_conv.is_owned = ptr_is_owned(node_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_arg_conv); + node_id_arg_conv = NodeId_clone(&node_id_arg_conv); + LDKThreeBytes rgb_arg_ref; + CHECK(rgb_arg->arr_len == 3); + memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg); + LDKNodeAlias alias_arg_conv; + alias_arg_conv.inner = untag_ptr(alias_arg); + alias_arg_conv.is_owned = ptr_is_owned(alias_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); + alias_arg_conv = NodeAlias_clone(&alias_arg_conv); + LDKCVec_SocketAddressZ addresses_arg_constr; + addresses_arg_constr.datalen = addresses_arg->arr_len; + if (addresses_arg_constr.datalen > 0) + addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + addresses_arg_constr.data = NULL; + int64_t* addresses_arg_vals = addresses_arg->elems; + for (size_t p = 0; p < addresses_arg_constr.datalen; p++) { + int64_t addresses_arg_conv_15 = addresses_arg_vals[p]; + void* addresses_arg_conv_15_ptr = untag_ptr(addresses_arg_conv_15); + CHECK_ACCESS(addresses_arg_conv_15_ptr); + LDKSocketAddress addresses_arg_conv_15_conv = *(LDKSocketAddress*)(addresses_arg_conv_15_ptr); + addresses_arg_constr.data[p] = addresses_arg_conv_15_conv; + } + FREE(addresses_arg); + LDKCVec_u8Z excess_address_data_arg_ref; + excess_address_data_arg_ref.datalen = excess_address_data_arg->arr_len; + excess_address_data_arg_ref.data = MALLOC(excess_address_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(excess_address_data_arg_ref.data, excess_address_data_arg->elems, excess_address_data_arg_ref.datalen); FREE(excess_address_data_arg); + LDKCVec_u8Z excess_data_arg_ref; + excess_data_arg_ref.datalen = excess_data_arg->arr_len; + excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(excess_data_arg_ref.data, excess_data_arg->elems, excess_data_arg_ref.datalen); FREE(excess_data_arg); + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_new(features_arg_conv, timestamp_arg, node_id_arg_conv, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, excess_address_data_arg_ref, excess_data_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); int64_t ret_ref = 0; @@ -43635,6 +53520,16 @@ int64_t CS_LDK_UnsignedNodeAnnouncement_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_UnsignedNodeAnnouncement_hash(int64_t o) { + LDKUnsignedNodeAnnouncement o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UnsignedNodeAnnouncement_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_UnsignedNodeAnnouncement_eq(int64_t a, int64_t b) { LDKUnsignedNodeAnnouncement a_conv; a_conv.inner = untag_ptr(a); @@ -43754,6 +53649,16 @@ int64_t CS_LDK_NodeAnnouncement_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_NodeAnnouncement_hash(int64_t o) { + LDKNodeAnnouncement o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = NodeAnnouncement_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_NodeAnnouncement_eq(int64_t a, int64_t b) { LDKNodeAnnouncement a_conv; a_conv.inner = untag_ptr(a); @@ -44050,6 +53955,16 @@ int64_t CS_LDK_UnsignedChannelAnnouncement_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_UnsignedChannelAnnouncement_hash(int64_t o) { + LDKUnsignedChannelAnnouncement o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UnsignedChannelAnnouncement_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_UnsignedChannelAnnouncement_eq(int64_t a, int64_t b) { LDKUnsignedChannelAnnouncement a_conv; a_conv.inner = untag_ptr(a); @@ -44247,6 +54162,16 @@ int64_t CS_LDK_ChannelAnnouncement_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_ChannelAnnouncement_hash(int64_t o) { + LDKChannelAnnouncement o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelAnnouncement_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_ChannelAnnouncement_eq(int64_t a, int64_t b) { LDKChannelAnnouncement a_conv; a_conv.inner = untag_ptr(a); @@ -44516,6 +54441,16 @@ int64_t CS_LDK_UnsignedChannelUpdate_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_UnsignedChannelUpdate_hash(int64_t o) { + LDKUnsignedChannelUpdate o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = UnsignedChannelUpdate_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_UnsignedChannelUpdate_eq(int64_t a, int64_t b) { LDKUnsignedChannelUpdate a_conv; a_conv.inner = untag_ptr(a); @@ -44635,6 +54570,16 @@ int64_t CS_LDK_ChannelUpdate_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_ChannelUpdate_hash(int64_t o) { + LDKChannelUpdate o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelUpdate_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_ChannelUpdate_eq(int64_t a, int64_t b) { LDKChannelUpdate a_conv; a_conv.inner = untag_ptr(a); @@ -44760,6 +54705,16 @@ int64_t CS_LDK_QueryChannelRange_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_QueryChannelRange_hash(int64_t o) { + LDKQueryChannelRange o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = QueryChannelRange_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_QueryChannelRange_eq(int64_t a, int64_t b) { LDKQueryChannelRange a_conv; a_conv.inner = untag_ptr(a); @@ -44956,6 +54911,16 @@ int64_t CS_LDK_ReplyChannelRange_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_ReplyChannelRange_hash(int64_t o) { + LDKReplyChannelRange o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ReplyChannelRange_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_ReplyChannelRange_eq(int64_t a, int64_t b) { LDKReplyChannelRange a_conv; a_conv.inner = untag_ptr(a); @@ -45095,6 +55060,16 @@ int64_t CS_LDK_QueryShortChannelIds_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_QueryShortChannelIds_hash(int64_t o) { + LDKQueryShortChannelIds o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = QueryShortChannelIds_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_QueryShortChannelIds_eq(int64_t a, int64_t b) { LDKQueryShortChannelIds a_conv; a_conv.inner = untag_ptr(a); @@ -45201,6 +55176,16 @@ int64_t CS_LDK_ReplyShortChannelIdsEnd_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_ReplyShortChannelIdsEnd_hash(int64_t o) { + LDKReplyShortChannelIdsEnd o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ReplyShortChannelIdsEnd_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_ReplyShortChannelIdsEnd_eq(int64_t a, int64_t b) { LDKReplyShortChannelIdsEnd a_conv; a_conv.inner = untag_ptr(a); @@ -45326,6 +55311,16 @@ int64_t CS_LDK_GossipTimestampFilter_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_GossipTimestampFilter_hash(int64_t o) { + LDKGossipTimestampFilter o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = GossipTimestampFilter_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_GossipTimestampFilter_eq(int64_t a, int64_t b) { LDKGossipTimestampFilter a_conv; a_conv.inner = untag_ptr(a); @@ -45441,6 +55436,12 @@ int64_t CS_LDK_ErrorAction_send_warning_message(int64_t msg, int32_t log_level) return ret_ref; } +int64_t CS_LDK_ErrorAction_hash(int64_t o) { + LDKErrorAction* o_conv = (LDKErrorAction*)untag_ptr(o); + int64_t ret_conv = ErrorAction_hash(o_conv); + return ret_conv; +} + void CS_LDK_LightningError_free(int64_t this_obj) { LDKLightningError this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -45909,6 +55910,16 @@ int64_t CS_LDK_CommitmentUpdate_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_CommitmentUpdate_hash(int64_t o) { + LDKCommitmentUpdate o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = CommitmentUpdate_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_CommitmentUpdate_eq(int64_t a, int64_t b) { LDKCommitmentUpdate a_conv; a_conv.inner = untag_ptr(a); @@ -45951,6 +55962,419 @@ void CS_LDK_OnionMessageHandler_free(int64_t this_ptr) { OnionMessageHandler_free(this_ptr_conv); } +void CS_LDK_FinalOnionHopData_free(int64_t this_obj) { + LDKFinalOnionHopData this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + FinalOnionHopData_free(this_obj_conv); +} + +int8_tArray CS_LDK_FinalOnionHopData_get_payment_secret(int64_t this_ptr) { + LDKFinalOnionHopData this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, *FinalOnionHopData_get_payment_secret(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_FinalOnionHopData_set_payment_secret(int64_t this_ptr, int8_tArray val) { + LDKFinalOnionHopData this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + FinalOnionHopData_set_payment_secret(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_FinalOnionHopData_get_total_msat(int64_t this_ptr) { + LDKFinalOnionHopData this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = FinalOnionHopData_get_total_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_FinalOnionHopData_set_total_msat(int64_t this_ptr, int64_t val) { + LDKFinalOnionHopData this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + FinalOnionHopData_set_total_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_FinalOnionHopData_new(int8_tArray payment_secret_arg, int64_t total_msat_arg) { + LDKThirtyTwoBytes payment_secret_arg_ref; + CHECK(payment_secret_arg->arr_len == 32); + memcpy(payment_secret_arg_ref.data, payment_secret_arg->elems, 32); FREE(payment_secret_arg); + LDKFinalOnionHopData ret_var = FinalOnionHopData_new(payment_secret_arg_ref, total_msat_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t FinalOnionHopData_clone_ptr(LDKFinalOnionHopData *NONNULL_PTR arg) { + LDKFinalOnionHopData ret_var = FinalOnionHopData_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_FinalOnionHopData_clone_ptr(int64_t arg) { + LDKFinalOnionHopData arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = FinalOnionHopData_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_FinalOnionHopData_clone(int64_t orig) { + LDKFinalOnionHopData orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKFinalOnionHopData ret_var = FinalOnionHopData_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_OnionPacket_free(int64_t this_obj) { + LDKOnionPacket this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OnionPacket_free(this_obj_conv); +} + +int8_t CS_LDK_OnionPacket_get_version(int64_t this_ptr) { + LDKOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_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 = OnionPacket_get_version(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_OnionPacket_set_version(int64_t this_ptr, int8_t val) { + LDKOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OnionPacket_set_version(&this_ptr_conv, val); +} + +int64_t CS_LDK_OnionPacket_get_public_key(int64_t this_ptr) { + LDKOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = OnionPacket_get_public_key(&this_ptr_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_OnionPacket_set_public_key(int64_t this_ptr, int64_t val) { + LDKOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCResult_PublicKeySecp256k1ErrorZ val_conv = *(LDKCResult_PublicKeySecp256k1ErrorZ*)(val_ptr); + val_conv = CResult_PublicKeySecp256k1ErrorZ_clone((LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(val)); + OnionPacket_set_public_key(&this_ptr_conv, val_conv); +} + +int8_tArray CS_LDK_OnionPacket_get_hmac(int64_t this_ptr) { + LDKOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(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, *OnionPacket_get_hmac(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_OnionPacket_set_hmac(int64_t this_ptr, int8_tArray val) { + LDKOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + OnionPacket_set_hmac(&this_ptr_conv, val_ref); +} + +static inline uint64_t OnionPacket_clone_ptr(LDKOnionPacket *NONNULL_PTR arg) { + LDKOnionPacket ret_var = OnionPacket_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_OnionPacket_clone_ptr(int64_t arg) { + LDKOnionPacket arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OnionPacket_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OnionPacket_clone(int64_t orig) { + LDKOnionPacket orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOnionPacket ret_var = OnionPacket_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_OnionPacket_hash(int64_t o) { + LDKOnionPacket o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = OnionPacket_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_OnionPacket_eq(int64_t a, int64_t b) { + LDKOnionPacket a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOnionPacket b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OnionPacket_eq(&a_conv, &b_conv); + return ret_conv; +} + +void CS_LDK_TrampolineOnionPacket_free(int64_t this_obj) { + LDKTrampolineOnionPacket this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TrampolineOnionPacket_free(this_obj_conv); +} + +int8_t CS_LDK_TrampolineOnionPacket_get_version(int64_t this_ptr) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_t ret_conv = TrampolineOnionPacket_get_version(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_TrampolineOnionPacket_set_version(int64_t this_ptr, int8_t val) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + TrampolineOnionPacket_set_version(&this_ptr_conv, val); +} + +int8_tArray CS_LDK_TrampolineOnionPacket_get_public_key(int64_t this_ptr) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, TrampolineOnionPacket_get_public_key(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_TrampolineOnionPacket_set_public_key(int64_t this_ptr, int8_tArray val) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + TrampolineOnionPacket_set_public_key(&this_ptr_conv, val_ref); +} + +int8_tArray CS_LDK_TrampolineOnionPacket_get_hop_data(int64_t this_ptr) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z ret_var = TrampolineOnionPacket_get_hop_data(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +void CS_LDK_TrampolineOnionPacket_set_hop_data(int64_t this_ptr, int8_tArray val) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + TrampolineOnionPacket_set_hop_data(&this_ptr_conv, val_ref); +} + +int8_tArray CS_LDK_TrampolineOnionPacket_get_hmac(int64_t this_ptr) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *TrampolineOnionPacket_get_hmac(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_TrampolineOnionPacket_set_hmac(int64_t this_ptr, int8_tArray val) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + TrampolineOnionPacket_set_hmac(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_TrampolineOnionPacket_new(int8_t version_arg, int8_tArray public_key_arg, int8_tArray hop_data_arg, int8_tArray hmac_arg) { + LDKPublicKey public_key_arg_ref; + CHECK(public_key_arg->arr_len == 33); + memcpy(public_key_arg_ref.compressed_form, public_key_arg->elems, 33); FREE(public_key_arg); + LDKCVec_u8Z hop_data_arg_ref; + hop_data_arg_ref.datalen = hop_data_arg->arr_len; + hop_data_arg_ref.data = MALLOC(hop_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(hop_data_arg_ref.data, hop_data_arg->elems, hop_data_arg_ref.datalen); FREE(hop_data_arg); + LDKThirtyTwoBytes hmac_arg_ref; + CHECK(hmac_arg->arr_len == 32); + memcpy(hmac_arg_ref.data, hmac_arg->elems, 32); FREE(hmac_arg); + LDKTrampolineOnionPacket ret_var = TrampolineOnionPacket_new(version_arg, public_key_arg_ref, hop_data_arg_ref, hmac_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t TrampolineOnionPacket_clone_ptr(LDKTrampolineOnionPacket *NONNULL_PTR arg) { + LDKTrampolineOnionPacket ret_var = TrampolineOnionPacket_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_TrampolineOnionPacket_clone_ptr(int64_t arg) { + LDKTrampolineOnionPacket arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = TrampolineOnionPacket_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_TrampolineOnionPacket_clone(int64_t orig) { + LDKTrampolineOnionPacket orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKTrampolineOnionPacket ret_var = TrampolineOnionPacket_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_TrampolineOnionPacket_hash(int64_t o) { + LDKTrampolineOnionPacket o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = TrampolineOnionPacket_hash(&o_conv); + return ret_conv; +} + +jboolean CS_LDK_TrampolineOnionPacket_eq(int64_t a, int64_t b) { + LDKTrampolineOnionPacket a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKTrampolineOnionPacket b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = TrampolineOnionPacket_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_TrampolineOnionPacket_write(int64_t obj) { + LDKTrampolineOnionPacket obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = TrampolineOnionPacket_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +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); @@ -45997,6 +56421,98 @@ int64_t CS_LDK_AcceptChannelV2_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_Stfu_write(int64_t obj) { + LDKStfu obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Stfu_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_Stfu_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_StfuDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StfuDecodeErrorZ), "LDKCResult_StfuDecodeErrorZ"); + *ret_conv = Stfu_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_Splice_write(int64_t obj) { + LDKSplice obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Splice_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_Splice_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_SpliceDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceDecodeErrorZ), "LDKCResult_SpliceDecodeErrorZ"); + *ret_conv = Splice_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_SpliceAck_write(int64_t obj) { + LDKSpliceAck obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = SpliceAck_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_SpliceAck_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_SpliceAckDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceAckDecodeErrorZ), "LDKCResult_SpliceAckDecodeErrorZ"); + *ret_conv = SpliceAck_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_SpliceLocked_write(int64_t obj) { + LDKSpliceLocked obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = SpliceLocked_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_SpliceLocked_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_SpliceLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpliceLockedDecodeErrorZ), "LDKCResult_SpliceLockedDecodeErrorZ"); + *ret_conv = SpliceLocked_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + int8_tArray CS_LDK_TxAddInput_write(int64_t obj) { LDKTxAddInput obj_conv; obj_conv.inner = untag_ptr(obj); @@ -46595,6 +57111,29 @@ int64_t CS_LDK_UpdateFulfillHTLC_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_OnionPacket_write(int64_t obj) { + LDKOnionPacket obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = OnionPacket_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_OnionPacket_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OnionPacketDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionPacketDecodeErrorZ), "LDKCResult_OnionPacketDecodeErrorZ"); + *ret_conv = OnionPacket_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + int8_tArray CS_LDK_UpdateAddHTLC_write(int64_t obj) { LDKUpdateAddHTLC obj_conv; obj_conv.inner = untag_ptr(obj); @@ -46641,6 +57180,29 @@ int8_tArray CS_LDK_OnionMessage_write(int64_t obj) { return ret_arr; } +int8_tArray CS_LDK_FinalOnionHopData_write(int64_t obj) { + LDKFinalOnionHopData obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = FinalOnionHopData_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_FinalOnionHopData_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_FinalOnionHopDataDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FinalOnionHopDataDecodeErrorZ), "LDKCResult_FinalOnionHopDataDecodeErrorZ"); + *ret_conv = FinalOnionHopData_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + int8_tArray CS_LDK_Ping_write(int64_t obj) { LDKPing obj_conv; obj_conv.inner = untag_ptr(obj); @@ -47021,6 +57583,17 @@ int64_t CS_LDK_IgnoringMessageHandler_new() { return ret_ref; } +int64_t CS_LDK_IgnoringMessageHandler_as_EventsProvider(int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = IgnoringMessageHandler_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + int64_t CS_LDK_IgnoringMessageHandler_as_MessageSendEventsProvider(int64_t this_arg) { LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -47319,6 +57892,127 @@ void CS_LDK_SocketDescriptor_free(int64_t this_ptr) { SocketDescriptor_free(this_ptr_conv); } +void CS_LDK_PeerDetails_free(int64_t this_obj) { + LDKPeerDetails this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PeerDetails_free(this_obj_conv); +} + +int8_tArray CS_LDK_PeerDetails_get_counterparty_node_id(int64_t this_ptr) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, PeerDetails_get_counterparty_node_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_PeerDetails_set_counterparty_node_id(int64_t this_ptr, int8_tArray val) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + PeerDetails_set_counterparty_node_id(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_PeerDetails_get_socket_address(int64_t this_ptr) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_SocketAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_SocketAddressZ), "LDKCOption_SocketAddressZ"); + *ret_copy = PeerDetails_get_socket_address(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PeerDetails_set_socket_address(int64_t this_ptr, int64_t val) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_SocketAddressZ val_conv = *(LDKCOption_SocketAddressZ*)(val_ptr); + val_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(val)); + PeerDetails_set_socket_address(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_PeerDetails_get_init_features(int64_t this_ptr) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInitFeatures ret_var = PeerDetails_get_init_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_PeerDetails_set_init_features(int64_t this_ptr, int64_t val) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInitFeatures val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = InitFeatures_clone(&val_conv); + PeerDetails_set_init_features(&this_ptr_conv, val_conv); +} + +jboolean CS_LDK_PeerDetails_get_is_inbound_connection(int64_t this_ptr) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = PeerDetails_get_is_inbound_connection(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_PeerDetails_set_is_inbound_connection(int64_t this_ptr, jboolean val) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PeerDetails_set_is_inbound_connection(&this_ptr_conv, val); +} + +int64_t CS_LDK_PeerDetails_new(int8_tArray counterparty_node_id_arg, int64_t socket_address_arg, int64_t init_features_arg, jboolean is_inbound_connection_arg) { + LDKPublicKey counterparty_node_id_arg_ref; + CHECK(counterparty_node_id_arg->arr_len == 33); + memcpy(counterparty_node_id_arg_ref.compressed_form, counterparty_node_id_arg->elems, 33); FREE(counterparty_node_id_arg); + void* socket_address_arg_ptr = untag_ptr(socket_address_arg); + CHECK_ACCESS(socket_address_arg_ptr); + LDKCOption_SocketAddressZ socket_address_arg_conv = *(LDKCOption_SocketAddressZ*)(socket_address_arg_ptr); + LDKInitFeatures init_features_arg_conv; + init_features_arg_conv.inner = untag_ptr(init_features_arg); + init_features_arg_conv.is_owned = ptr_is_owned(init_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_features_arg_conv); + init_features_arg_conv = InitFeatures_clone(&init_features_arg_conv); + LDKPeerDetails ret_var = PeerDetails_new(counterparty_node_id_arg_ref, socket_address_arg_conv, init_features_arg_conv, is_inbound_connection_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + void CS_LDK_PeerHandleError_free(int64_t this_obj) { LDKPeerHandleError this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -47365,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); @@ -47405,26 +58111,44 @@ int64_t CS_LDK_PeerManager_new(int64_t message_handler, int32_t current_time, i return ret_ref; } -int64_tArray CS_LDK_PeerManager_get_peer_node_ids(int64_t this_arg) { +int64_tArray CS_LDK_PeerManager_list_peers(int64_t this_arg) { LDKPeerManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); + LDKCVec_PeerDetailsZ ret_var = PeerManager_list_peers(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t r = 0; r < ret_var.datalen; r++) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* ret_conv_43_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ), "LDKC2Tuple_PublicKeyCOption_SocketAddressZZ"); - *ret_conv_43_conv = ret_var.data[r]; - ret_arr_ptr[r] = tag_ptr(ret_conv_43_conv, true); + for (size_t n = 0; n < ret_var.datalen; n++) { + LDKPeerDetails ret_conv_13_var = ret_var.data[n]; + int64_t ret_conv_13_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); + ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); + ret_arr_ptr[n] = ret_conv_13_ref; } FREE(ret_var.data); return ret_arr; } +int64_t CS_LDK_PeerManager_peer_by_node_id(int64_t this_arg, int8_tArray their_node_id) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey their_node_id_ref; + CHECK(their_node_id->arr_len == 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); + LDKPeerDetails ret_var = PeerManager_peer_by_node_id(&this_arg_conv, their_node_id_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + int64_t CS_LDK_PeerManager_new_outbound_connection(int64_t this_arg, int8_tArray their_node_id, int64_t descriptor, int64_t remote_network_address) { LDKPeerManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -47801,18 +58525,6 @@ int8_tArray CS_LDK_derive_private_key(int8_tArray per_commitment_point, int8_tA return ret_arr; } -int8_tArray CS_LDK_derive_public_key(int8_tArray per_commitment_point, int8_tArray base_point) { - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - LDKPublicKey base_point_ref; - CHECK(base_point->arr_len == 33); - memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point); - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, derive_public_key(per_commitment_point_ref, base_point_ref).compressed_form, 33); - return ret_arr; -} - int8_tArray CS_LDK_derive_private_revocation_key(int8_tArray per_commitment_secret, int8_tArray countersignatory_revocation_base_secret) { uint8_t per_commitment_secret_arr[32]; CHECK(per_commitment_secret->arr_len == 32); @@ -47827,18 +58539,6 @@ int8_tArray CS_LDK_derive_private_revocation_key(int8_tArray per_commitment_sec return ret_arr; } -int8_tArray CS_LDK_derive_public_revocation_key(int8_tArray per_commitment_point, int8_tArray countersignatory_revocation_base_point) { - LDKPublicKey per_commitment_point_ref; - CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - LDKPublicKey countersignatory_revocation_base_point_ref; - CHECK(countersignatory_revocation_base_point->arr_len == 33); - memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); FREE(countersignatory_revocation_base_point); - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref).compressed_form, 33); - return ret_arr; -} - void CS_LDK_TxCreationKeys_free(int64_t this_obj) { LDKTxCreationKeys this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -47870,115 +58570,139 @@ void CS_LDK_TxCreationKeys_set_per_commitment_point(int64_t this_ptr, int8_tArr TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_TxCreationKeys_get_revocation_key(int64_t this_ptr) { +int64_t CS_LDK_TxCreationKeys_get_revocation_key(int64_t this_ptr) { LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKRevocationKey ret_var = TxCreationKeys_get_revocation_key(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxCreationKeys_set_revocation_key(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxCreationKeys_set_revocation_key(int64_t this_ptr, int64_t val) { LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); + LDKRevocationKey val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = RevocationKey_clone(&val_conv); + TxCreationKeys_set_revocation_key(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_TxCreationKeys_get_broadcaster_htlc_key(int64_t this_ptr) { +int64_t CS_LDK_TxCreationKeys_get_broadcaster_htlc_key(int64_t this_ptr) { LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKHtlcKey ret_var = TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxCreationKeys_set_broadcaster_htlc_key(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxCreationKeys_set_broadcaster_htlc_key(int64_t this_ptr, int64_t val) { LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); + LDKHtlcKey val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = HtlcKey_clone(&val_conv); + TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_TxCreationKeys_get_countersignatory_htlc_key(int64_t this_ptr) { +int64_t CS_LDK_TxCreationKeys_get_countersignatory_htlc_key(int64_t this_ptr) { LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKHtlcKey ret_var = TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxCreationKeys_set_countersignatory_htlc_key(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxCreationKeys_set_countersignatory_htlc_key(int64_t this_ptr, int64_t val) { LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); + LDKHtlcKey val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = HtlcKey_clone(&val_conv); + TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_TxCreationKeys_get_broadcaster_delayed_payment_key(int64_t this_ptr) { +int64_t CS_LDK_TxCreationKeys_get_broadcaster_delayed_payment_key(int64_t this_ptr) { LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKDelayedPaymentKey ret_var = TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_TxCreationKeys_set_broadcaster_delayed_payment_key(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxCreationKeys_set_broadcaster_delayed_payment_key(int64_t this_ptr, int64_t val) { LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); + LDKDelayedPaymentKey val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = DelayedPaymentKey_clone(&val_conv); + TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_conv); } -int64_t CS_LDK_TxCreationKeys_new(int8_tArray per_commitment_point_arg, int8_tArray revocation_key_arg, int8_tArray broadcaster_htlc_key_arg, int8_tArray countersignatory_htlc_key_arg, int8_tArray broadcaster_delayed_payment_key_arg) { +int64_t CS_LDK_TxCreationKeys_new(int8_tArray per_commitment_point_arg, int64_t revocation_key_arg, int64_t broadcaster_htlc_key_arg, int64_t countersignatory_htlc_key_arg, int64_t broadcaster_delayed_payment_key_arg) { LDKPublicKey per_commitment_point_arg_ref; CHECK(per_commitment_point_arg->arr_len == 33); memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg); - LDKPublicKey revocation_key_arg_ref; - CHECK(revocation_key_arg->arr_len == 33); - memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); FREE(revocation_key_arg); - LDKPublicKey broadcaster_htlc_key_arg_ref; - CHECK(broadcaster_htlc_key_arg->arr_len == 33); - memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); FREE(broadcaster_htlc_key_arg); - LDKPublicKey countersignatory_htlc_key_arg_ref; - CHECK(countersignatory_htlc_key_arg->arr_len == 33); - memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); FREE(countersignatory_htlc_key_arg); - LDKPublicKey broadcaster_delayed_payment_key_arg_ref; - CHECK(broadcaster_delayed_payment_key_arg->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); FREE(broadcaster_delayed_payment_key_arg); - LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref); + LDKRevocationKey revocation_key_arg_conv; + revocation_key_arg_conv.inner = untag_ptr(revocation_key_arg); + revocation_key_arg_conv.is_owned = ptr_is_owned(revocation_key_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_key_arg_conv); + revocation_key_arg_conv = RevocationKey_clone(&revocation_key_arg_conv); + LDKHtlcKey broadcaster_htlc_key_arg_conv; + broadcaster_htlc_key_arg_conv.inner = untag_ptr(broadcaster_htlc_key_arg); + broadcaster_htlc_key_arg_conv.is_owned = ptr_is_owned(broadcaster_htlc_key_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_htlc_key_arg_conv); + broadcaster_htlc_key_arg_conv = HtlcKey_clone(&broadcaster_htlc_key_arg_conv); + LDKHtlcKey countersignatory_htlc_key_arg_conv; + countersignatory_htlc_key_arg_conv.inner = untag_ptr(countersignatory_htlc_key_arg); + countersignatory_htlc_key_arg_conv.is_owned = ptr_is_owned(countersignatory_htlc_key_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_htlc_key_arg_conv); + countersignatory_htlc_key_arg_conv = HtlcKey_clone(&countersignatory_htlc_key_arg_conv); + LDKDelayedPaymentKey broadcaster_delayed_payment_key_arg_conv; + broadcaster_delayed_payment_key_arg_conv.inner = untag_ptr(broadcaster_delayed_payment_key_arg); + broadcaster_delayed_payment_key_arg_conv.is_owned = ptr_is_owned(broadcaster_delayed_payment_key_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_delayed_payment_key_arg_conv); + broadcaster_delayed_payment_key_arg_conv = DelayedPaymentKey_clone(&broadcaster_delayed_payment_key_arg_conv); + LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_conv, broadcaster_htlc_key_arg_conv, countersignatory_htlc_key_arg_conv, broadcaster_delayed_payment_key_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -48084,27 +58808,31 @@ void CS_LDK_ChannelPublicKeys_set_funding_pubkey(int64_t this_ptr, int8_tArray ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_ChannelPublicKeys_get_revocation_basepoint(int64_t this_ptr) { +int64_t CS_LDK_ChannelPublicKeys_get_revocation_basepoint(int64_t this_ptr) { LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKRevocationBasepoint ret_var = ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelPublicKeys_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ChannelPublicKeys_set_revocation_basepoint(int64_t this_ptr, int64_t val) { LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); + LDKRevocationBasepoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = RevocationBasepoint_clone(&val_conv); + ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_conv); } int8_tArray CS_LDK_ChannelPublicKeys_get_payment_point(int64_t this_ptr) { @@ -48130,69 +58858,83 @@ void CS_LDK_ChannelPublicKeys_set_payment_point(int64_t this_ptr, int8_tArray v ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); } -int8_tArray CS_LDK_ChannelPublicKeys_get_delayed_payment_basepoint(int64_t this_ptr) { +int64_t CS_LDK_ChannelPublicKeys_get_delayed_payment_basepoint(int64_t this_ptr) { LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKDelayedPaymentBasepoint ret_var = ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelPublicKeys_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ChannelPublicKeys_set_delayed_payment_basepoint(int64_t this_ptr, int64_t val) { LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); + LDKDelayedPaymentBasepoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = DelayedPaymentBasepoint_clone(&val_conv); + ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_ChannelPublicKeys_get_htlc_basepoint(int64_t this_ptr) { +int64_t CS_LDK_ChannelPublicKeys_get_htlc_basepoint(int64_t this_ptr) { LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKHtlcBasepoint ret_var = ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ChannelPublicKeys_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ChannelPublicKeys_set_htlc_basepoint(int64_t this_ptr, int64_t val) { LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); + LDKHtlcBasepoint val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = HtlcBasepoint_clone(&val_conv); + ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelPublicKeys_new(int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_point_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg) { +int64_t CS_LDK_ChannelPublicKeys_new(int8_tArray funding_pubkey_arg, int64_t revocation_basepoint_arg, int8_tArray payment_point_arg, int64_t delayed_payment_basepoint_arg, int64_t htlc_basepoint_arg) { LDKPublicKey funding_pubkey_arg_ref; CHECK(funding_pubkey_arg->arr_len == 33); memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); - LDKPublicKey revocation_basepoint_arg_ref; - CHECK(revocation_basepoint_arg->arr_len == 33); - memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg); + LDKRevocationBasepoint revocation_basepoint_arg_conv; + revocation_basepoint_arg_conv.inner = untag_ptr(revocation_basepoint_arg); + revocation_basepoint_arg_conv.is_owned = ptr_is_owned(revocation_basepoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_basepoint_arg_conv); + revocation_basepoint_arg_conv = RevocationBasepoint_clone(&revocation_basepoint_arg_conv); LDKPublicKey payment_point_arg_ref; CHECK(payment_point_arg->arr_len == 33); memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg); - LDKPublicKey delayed_payment_basepoint_arg_ref; - CHECK(delayed_payment_basepoint_arg->arr_len == 33); - memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg); - LDKPublicKey htlc_basepoint_arg_ref; - CHECK(htlc_basepoint_arg->arr_len == 33); - memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg); - LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref); + LDKDelayedPaymentBasepoint delayed_payment_basepoint_arg_conv; + delayed_payment_basepoint_arg_conv.inner = untag_ptr(delayed_payment_basepoint_arg); + delayed_payment_basepoint_arg_conv.is_owned = ptr_is_owned(delayed_payment_basepoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_basepoint_arg_conv); + delayed_payment_basepoint_arg_conv = DelayedPaymentBasepoint_clone(&delayed_payment_basepoint_arg_conv); + LDKHtlcBasepoint htlc_basepoint_arg_conv; + htlc_basepoint_arg_conv.inner = untag_ptr(htlc_basepoint_arg); + htlc_basepoint_arg_conv.is_owned = ptr_is_owned(htlc_basepoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_basepoint_arg_conv); + htlc_basepoint_arg_conv = HtlcBasepoint_clone(&htlc_basepoint_arg_conv); + LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_conv, payment_point_arg_ref, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -48277,23 +59019,31 @@ int64_t CS_LDK_ChannelPublicKeys_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_TxCreationKeys_derive_new(int8_tArray per_commitment_point, int8_tArray broadcaster_delayed_payment_base, int8_tArray broadcaster_htlc_base, int8_tArray countersignatory_revocation_base, int8_tArray countersignatory_htlc_base) { +int64_t CS_LDK_TxCreationKeys_derive_new(int8_tArray per_commitment_point, int64_t broadcaster_delayed_payment_base, int64_t broadcaster_htlc_base, int64_t countersignatory_revocation_base, int64_t countersignatory_htlc_base) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); - LDKPublicKey broadcaster_delayed_payment_base_ref; - CHECK(broadcaster_delayed_payment_base->arr_len == 33); - memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); FREE(broadcaster_delayed_payment_base); - LDKPublicKey broadcaster_htlc_base_ref; - CHECK(broadcaster_htlc_base->arr_len == 33); - memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); FREE(broadcaster_htlc_base); - LDKPublicKey countersignatory_revocation_base_ref; - CHECK(countersignatory_revocation_base->arr_len == 33); - memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); FREE(countersignatory_revocation_base); - LDKPublicKey countersignatory_htlc_base_ref; - CHECK(countersignatory_htlc_base->arr_len == 33); - memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); FREE(countersignatory_htlc_base); - LDKTxCreationKeys ret_var = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref); + LDKDelayedPaymentBasepoint broadcaster_delayed_payment_base_conv; + broadcaster_delayed_payment_base_conv.inner = untag_ptr(broadcaster_delayed_payment_base); + broadcaster_delayed_payment_base_conv.is_owned = ptr_is_owned(broadcaster_delayed_payment_base); + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_delayed_payment_base_conv); + broadcaster_delayed_payment_base_conv.is_owned = false; + LDKHtlcBasepoint broadcaster_htlc_base_conv; + broadcaster_htlc_base_conv.inner = untag_ptr(broadcaster_htlc_base); + broadcaster_htlc_base_conv.is_owned = ptr_is_owned(broadcaster_htlc_base); + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_htlc_base_conv); + broadcaster_htlc_base_conv.is_owned = false; + LDKRevocationBasepoint countersignatory_revocation_base_conv; + countersignatory_revocation_base_conv.inner = untag_ptr(countersignatory_revocation_base); + countersignatory_revocation_base_conv.is_owned = ptr_is_owned(countersignatory_revocation_base); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_revocation_base_conv); + countersignatory_revocation_base_conv.is_owned = false; + LDKHtlcBasepoint countersignatory_htlc_base_conv; + countersignatory_htlc_base_conv.inner = untag_ptr(countersignatory_htlc_base); + countersignatory_htlc_base_conv.is_owned = ptr_is_owned(countersignatory_htlc_base); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_htlc_base_conv); + countersignatory_htlc_base_conv.is_owned = false; + LDKTxCreationKeys ret_var = TxCreationKeys_derive_new(per_commitment_point_ref, &broadcaster_delayed_payment_base_conv, &broadcaster_htlc_base_conv, &countersignatory_revocation_base_conv, &countersignatory_htlc_base_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -48321,14 +59071,18 @@ int64_t CS_LDK_TxCreationKeys_from_channel_static_keys(int8_tArray per_commitme return ret_ref; } -int8_tArray CS_LDK_get_revokeable_redeemscript(int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) { - LDKPublicKey revocation_key_ref; - CHECK(revocation_key->arr_len == 33); - memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key); - LDKPublicKey broadcaster_delayed_payment_key_ref; - CHECK(broadcaster_delayed_payment_key->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key); - LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref); +int8_tArray CS_LDK_get_revokeable_redeemscript(int64_t revocation_key, int16_t contest_delay, int64_t broadcaster_delayed_payment_key) { + LDKRevocationKey revocation_key_conv; + revocation_key_conv.inner = untag_ptr(revocation_key); + revocation_key_conv.is_owned = ptr_is_owned(revocation_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_key_conv); + revocation_key_conv.is_owned = false; + LDKDelayedPaymentKey broadcaster_delayed_payment_key_conv; + broadcaster_delayed_payment_key_conv.inner = untag_ptr(broadcaster_delayed_payment_key); + broadcaster_delayed_payment_key_conv.is_owned = ptr_is_owned(broadcaster_delayed_payment_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_delayed_payment_key_conv); + broadcaster_delayed_payment_key_conv.is_owned = false; + LDKCVec_u8Z ret_var = get_revokeable_redeemscript(&revocation_key_conv, contest_delay, &broadcaster_delayed_payment_key_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); @@ -48584,7 +59338,7 @@ int8_tArray CS_LDK_make_funding_redeemscript(int8_tArray broadcaster, int8_tArr return ret_arr; } -int8_tArray CS_LDK_build_htlc_transaction(int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, int64_t channel_type_features, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { +int8_tArray CS_LDK_build_htlc_transaction(int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, int64_t channel_type_features, int64_t broadcaster_delayed_payment_key, int64_t revocation_key) { uint8_t commitment_txid_arr[32]; CHECK(commitment_txid->arr_len == 32); memcpy(commitment_txid_arr, commitment_txid->elems, 32); FREE(commitment_txid); @@ -48599,13 +59353,17 @@ int8_tArray CS_LDK_build_htlc_transaction(int8_tArray commitment_txid, int32_t channel_type_features_conv.is_owned = ptr_is_owned(channel_type_features); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_features_conv); channel_type_features_conv.is_owned = false; - LDKPublicKey broadcaster_delayed_payment_key_ref; - CHECK(broadcaster_delayed_payment_key->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key); - LDKPublicKey revocation_key_ref; - CHECK(revocation_key->arr_len == 33); - memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key); - LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, &channel_type_features_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref); + LDKDelayedPaymentKey broadcaster_delayed_payment_key_conv; + broadcaster_delayed_payment_key_conv.inner = untag_ptr(broadcaster_delayed_payment_key); + broadcaster_delayed_payment_key_conv.is_owned = ptr_is_owned(broadcaster_delayed_payment_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_delayed_payment_key_conv); + broadcaster_delayed_payment_key_conv.is_owned = false; + LDKRevocationKey revocation_key_conv; + revocation_key_conv.inner = untag_ptr(revocation_key); + revocation_key_conv.is_owned = ptr_is_owned(revocation_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_key_conv); + revocation_key_conv.is_owned = false; + LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, &channel_type_features_conv, &broadcaster_delayed_payment_key_conv, &revocation_key_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); @@ -50431,6 +61189,96 @@ int64_t CS_LDK_ChannelTypeFeatures_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_InitFeatures_hash(int64_t o) { + LDKInitFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = InitFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_NodeFeatures_hash(int64_t o) { + LDKNodeFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = NodeFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelFeatures_hash(int64_t o) { + LDKChannelFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_Bolt11InvoiceFeatures_hash(int64_t o) { + LDKBolt11InvoiceFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Bolt11InvoiceFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_OfferFeatures_hash(int64_t o) { + LDKOfferFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = OfferFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_InvoiceRequestFeatures_hash(int64_t o) { + LDKInvoiceRequestFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = InvoiceRequestFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_Bolt12InvoiceFeatures_hash(int64_t o) { + LDKBolt12InvoiceFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Bolt12InvoiceFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_BlindedHopFeatures_hash(int64_t o) { + LDKBlindedHopFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = BlindedHopFeatures_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelTypeFeatures_hash(int64_t o) { + LDKChannelTypeFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelTypeFeatures_hash(&o_conv); + return ret_conv; +} + void CS_LDK_InitFeatures_free(int64_t this_obj) { LDKInitFeatures this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -52411,6 +63259,82 @@ jboolean CS_LDK_ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(int64_t t return ret_conv; } +void CS_LDK_InitFeatures_set_route_blinding_optional(int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_route_blinding_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_route_blinding_required(int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_route_blinding_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_route_blinding(int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_route_blinding(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_route_blinding_optional(int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_route_blinding_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_route_blinding_required(int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_route_blinding_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_route_blinding(int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_route_blinding(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_route_blinding(int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_route_blinding(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_route_blinding(int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_route_blinding(&this_arg_conv); + return ret_conv; +} + void CS_LDK_InitFeatures_set_shutdown_any_segwit_optional(int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -53057,6 +63981,120 @@ jboolean CS_LDK_NodeFeatures_requires_keysend(int64_t this_arg) { return ret_conv; } +void CS_LDK_InitFeatures_set_trampoline_routing_optional(int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_trampoline_routing_optional(&this_arg_conv); +} + +void CS_LDK_InitFeatures_set_trampoline_routing_required(int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + InitFeatures_set_trampoline_routing_required(&this_arg_conv); +} + +jboolean CS_LDK_InitFeatures_supports_trampoline_routing(int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_NodeFeatures_set_trampoline_routing_optional(int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_trampoline_routing_optional(&this_arg_conv); +} + +void CS_LDK_NodeFeatures_set_trampoline_routing_required(int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + NodeFeatures_set_trampoline_routing_required(&this_arg_conv); +} + +jboolean CS_LDK_NodeFeatures_supports_trampoline_routing(int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +void CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_optional(int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_trampoline_routing_optional(&this_arg_conv); +} + +void CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_required(int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_trampoline_routing_required(&this_arg_conv); +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_supports_trampoline_routing(int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_InitFeatures_requires_trampoline_routing(int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InitFeatures_requires_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_NodeFeatures_requires_trampoline_routing(int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeFeatures_requires_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +jboolean CS_LDK_Bolt11InvoiceFeatures_requires_trampoline_routing(int64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Bolt11InvoiceFeatures_requires_trampoline_routing(&this_arg_conv); + return ret_conv; +} + void CS_LDK_ShutdownScript_free(int64_t this_obj) { LDKShutdownScript this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -53124,9 +64162,10 @@ int8_tArray CS_LDK_InvalidShutdownScript_get_script(int64_t this_ptr) { this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); + LDKCVec_u8Z ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); return ret_arr; } @@ -53232,14 +64271,13 @@ int64_t CS_LDK_ShutdownScript_new_p2wsh(int8_tArray script_hash) { return ret_ref; } -int64_t CS_LDK_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) { - - LDKu8slice program_ref; - program_ref.datalen = program->arr_len; - program_ref.data = program->elems; +int64_t CS_LDK_ShutdownScript_new_witness_program(int64_t witness_program) { + void* witness_program_ptr = untag_ptr(witness_program); + CHECK_ACCESS(witness_program_ptr); + LDKWitnessProgram witness_program_conv = *(LDKWitnessProgram*)(witness_program_ptr); + witness_program_conv = WitnessProgram_clone((LDKWitnessProgram*)untag_ptr(witness_program)); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref); - FREE(program); + *ret_conv = ShutdownScript_new_witness_program(witness_program_conv); return tag_ptr(ret_conv, true); } @@ -53282,6 +64320,246 @@ 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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelId_free(this_obj_conv); +} + +int8_tArray CS_LDK_ChannelId_get_a(int64_t this_ptr) { + LDKChannelId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *ChannelId_get_a(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_ChannelId_set_a(int64_t this_ptr, int8_tArray val) { + LDKChannelId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + ChannelId_set_a(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_ChannelId_new(int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK(a_arg->arr_len == 32); + memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg); + LDKChannelId ret_var = ChannelId_new(a_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t ChannelId_clone_ptr(LDKChannelId *NONNULL_PTR arg) { + LDKChannelId ret_var = ChannelId_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_ChannelId_clone_ptr(int64_t arg) { + LDKChannelId arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = ChannelId_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelId_clone(int64_t orig) { + LDKChannelId orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKChannelId ret_var = ChannelId_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +jboolean CS_LDK_ChannelId_eq(int64_t a, int64_t b) { + LDKChannelId a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ChannelId_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelId_hash(int64_t o) { + LDKChannelId o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = ChannelId_hash(&o_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelId_v1_from_funding_txid(int8_tArray txid, int16_t output_index) { + uint8_t txid_arr[32]; + CHECK(txid->arr_len == 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); + uint8_t (*txid_ref)[32] = &txid_arr; + LDKChannelId ret_var = ChannelId_v1_from_funding_txid(txid_ref, output_index); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_ChannelId_v1_from_funding_outpoint(int64_t outpoint) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + LDKChannelId ret_var = ChannelId_v1_from_funding_outpoint(outpoint_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_ChannelId_temporary_from_entropy_source(int64_t entropy_source) { + void* entropy_source_ptr = untag_ptr(entropy_source); + if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } + LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + LDKChannelId ret_var = ChannelId_temporary_from_entropy_source(entropy_source_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_ChannelId_from_bytes(int8_tArray data) { + LDKThirtyTwoBytes data_ref; + CHECK(data->arr_len == 32); + memcpy(data_ref.data, data->elems, 32); FREE(data); + LDKChannelId ret_var = ChannelId_from_bytes(data_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_ChannelId_new_zero() { + LDKChannelId ret_var = ChannelId_new_zero(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +jboolean CS_LDK_ChannelId_is_zero(int64_t this_arg) { + LDKChannelId this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = ChannelId_is_zero(&this_arg_conv); + return ret_conv; +} + +int64_t CS_LDK_ChannelId_v2_from_revocation_basepoints(int64_t ours, int64_t theirs) { + LDKRevocationBasepoint ours_conv; + ours_conv.inner = untag_ptr(ours); + ours_conv.is_owned = ptr_is_owned(ours); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ours_conv); + ours_conv.is_owned = false; + LDKRevocationBasepoint theirs_conv; + theirs_conv.inner = untag_ptr(theirs); + theirs_conv.is_owned = ptr_is_owned(theirs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(theirs_conv); + theirs_conv.is_owned = false; + LDKChannelId ret_var = ChannelId_v2_from_revocation_basepoints(&ours_conv, &theirs_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_ChannelId_temporary_v2_from_revocation_basepoint(int64_t our_revocation_basepoint) { + LDKRevocationBasepoint our_revocation_basepoint_conv; + our_revocation_basepoint_conv.inner = untag_ptr(our_revocation_basepoint); + our_revocation_basepoint_conv.is_owned = ptr_is_owned(our_revocation_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(our_revocation_basepoint_conv); + our_revocation_basepoint_conv.is_owned = false; + LDKChannelId ret_var = ChannelId_temporary_v2_from_revocation_basepoint(&our_revocation_basepoint_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int8_tArray CS_LDK_ChannelId_write(int64_t obj) { + LDKChannelId obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ChannelId_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_ChannelId_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = ChannelId_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +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); @@ -53801,6 +65079,413 @@ void CS_LDK_Type_free(int64_t this_ptr) { Type_free(this_ptr_conv); } +void CS_LDK_OfferId_free(int64_t this_obj) { + LDKOfferId this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferId_free(this_obj_conv); +} + +int8_tArray CS_LDK_OfferId_get_a(int64_t this_ptr) { + LDKOfferId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *OfferId_get_a(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_OfferId_set_a(int64_t this_ptr, int8_tArray val) { + LDKOfferId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + OfferId_set_a(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_OfferId_new(int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK(a_arg->arr_len == 32); + memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg); + LDKOfferId ret_var = OfferId_new(a_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t OfferId_clone_ptr(LDKOfferId *NONNULL_PTR arg) { + LDKOfferId ret_var = OfferId_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_OfferId_clone_ptr(int64_t arg) { + LDKOfferId arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferId_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OfferId_clone(int64_t orig) { + LDKOfferId orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferId ret_var = OfferId_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +jboolean CS_LDK_OfferId_eq(int64_t a, int64_t b) { + LDKOfferId a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOfferId b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OfferId_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_OfferId_write(int64_t obj) { + LDKOfferId obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = OfferId_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_OfferId_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = OfferId_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_OfferWithExplicitMetadataBuilder_free(int64_t this_obj) { + LDKOfferWithExplicitMetadataBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferWithExplicitMetadataBuilder_free(this_obj_conv); +} + +static inline uint64_t OfferWithExplicitMetadataBuilder_clone_ptr(LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR arg) { + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_OfferWithExplicitMetadataBuilder_clone_ptr(int64_t arg) { + LDKOfferWithExplicitMetadataBuilder arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferWithExplicitMetadataBuilder_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OfferWithExplicitMetadataBuilder_clone(int64_t orig) { + LDKOfferWithExplicitMetadataBuilder orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_OfferWithDerivedMetadataBuilder_free(int64_t this_obj) { + LDKOfferWithDerivedMetadataBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferWithDerivedMetadataBuilder_free(this_obj_conv); +} + +static inline uint64_t OfferWithDerivedMetadataBuilder_clone_ptr(LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR arg) { + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_clone_ptr(int64_t arg) { + LDKOfferWithDerivedMetadataBuilder arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferWithDerivedMetadataBuilder_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_clone(int64_t orig) { + LDKOfferWithDerivedMetadataBuilder orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_OfferWithExplicitMetadataBuilder_new(int8_tArray signing_pubkey) { + LDKPublicKey signing_pubkey_ref; + CHECK(signing_pubkey->arr_len == 33); + memcpy(signing_pubkey_ref.compressed_form, signing_pubkey->elems, 33); FREE(signing_pubkey); + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_new(signing_pubkey_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_OfferWithExplicitMetadataBuilder_metadata(int64_t this_arg, int8_tArray metadata) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = metadata->arr_len; + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(metadata_ref.data, metadata->elems, metadata_ref.datalen); FREE(metadata); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = OfferWithExplicitMetadataBuilder_metadata(this_arg_conv, metadata_ref); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_OfferWithExplicitMetadataBuilder_chain(int64_t this_arg, int32_t network) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_cs(network); + OfferWithExplicitMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void CS_LDK_OfferWithExplicitMetadataBuilder_amount_msats(int64_t this_arg, int64_t amount_msats) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_amount_msats(this_arg_conv, amount_msats); +} + +void CS_LDK_OfferWithExplicitMetadataBuilder_absolute_expiry(int64_t this_arg, int64_t absolute_expiry) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); +} + +void CS_LDK_OfferWithExplicitMetadataBuilder_description(int64_t this_arg, jstring description) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = str_ref_to_owned_c(description); + OfferWithExplicitMetadataBuilder_description(this_arg_conv, description_conv); +} + +void CS_LDK_OfferWithExplicitMetadataBuilder_issuer(int64_t this_arg, jstring issuer) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = str_ref_to_owned_c(issuer); + OfferWithExplicitMetadataBuilder_issuer(this_arg_conv, issuer_conv); +} + +void CS_LDK_OfferWithExplicitMetadataBuilder_path(int64_t this_arg, int64_t path) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKBlindedPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = BlindedPath_clone(&path_conv); + OfferWithExplicitMetadataBuilder_path(this_arg_conv, path_conv); +} + +void CS_LDK_OfferWithExplicitMetadataBuilder_supported_quantity(int64_t this_arg, int64_t quantity) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); + quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); + OfferWithExplicitMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); +} + +int64_t CS_LDK_OfferWithExplicitMetadataBuilder_build(int64_t this_arg) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = OfferWithExplicitMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(int8_tArray node_id, int64_t expanded_key, int64_t entropy_source) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(node_id_ref, &expanded_key_conv, entropy_source_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_OfferWithDerivedMetadataBuilder_chain(int64_t this_arg, int32_t network) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_cs(network); + OfferWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void CS_LDK_OfferWithDerivedMetadataBuilder_amount_msats(int64_t this_arg, int64_t amount_msats) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_amount_msats(this_arg_conv, amount_msats); +} + +void CS_LDK_OfferWithDerivedMetadataBuilder_absolute_expiry(int64_t this_arg, int64_t absolute_expiry) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); +} + +void CS_LDK_OfferWithDerivedMetadataBuilder_description(int64_t this_arg, jstring description) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = str_ref_to_owned_c(description); + OfferWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); +} + +void CS_LDK_OfferWithDerivedMetadataBuilder_issuer(int64_t this_arg, jstring issuer) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = str_ref_to_owned_c(issuer); + OfferWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); +} + +void CS_LDK_OfferWithDerivedMetadataBuilder_path(int64_t this_arg, int64_t path) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = BlindedPath_clone(&path_conv); + OfferWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); +} + +void CS_LDK_OfferWithDerivedMetadataBuilder_supported_quantity(int64_t this_arg, int64_t quantity) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); + quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); + OfferWithDerivedMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); +} + +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_build(int64_t this_arg) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = OfferWithDerivedMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); +} + void CS_LDK_Offer_free(int64_t this_obj) { LDKOffer this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -53877,10 +65562,9 @@ int64_t CS_LDK_Offer_amount(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = Offer_amount(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = Offer_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -53963,10 +65647,9 @@ int64_t CS_LDK_Offer_supported_quantity(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = Offer_supported_quantity(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Offer_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -53981,6 +65664,19 @@ int8_tArray CS_LDK_Offer_signing_pubkey(int64_t this_arg) { return ret_arr; } +int64_t CS_LDK_Offer_id(int64_t this_arg) { + LDKOffer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOfferId ret_var = Offer_id(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + jboolean CS_LDK_Offer_supports_chain(int64_t this_arg, int8_tArray chain) { LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -54004,6 +65700,16 @@ jboolean CS_LDK_Offer_is_expired(int64_t this_arg) { return ret_conv; } +jboolean CS_LDK_Offer_is_expired_no_std(int64_t this_arg, int64_t duration_since_epoch) { + LDKOffer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Offer_is_expired_no_std(&this_arg_conv, duration_since_epoch); + return ret_conv; +} + jboolean CS_LDK_Offer_is_valid_quantity(int64_t this_arg, int64_t quantity) { LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -54024,6 +65730,89 @@ jboolean CS_LDK_Offer_expects_quantity(int64_t this_arg) { return ret_conv; } +int64_t CS_LDK_Offer_request_invoice_deriving_payer_id(int64_t this_arg, int64_t expanded_key, int64_t entropy_source, int8_tArray payment_id) { + LDKOffer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice_deriving_payer_id(&this_arg_conv, &expanded_key_conv, entropy_source_conv, payment_id_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_Offer_request_invoice_deriving_metadata(int64_t this_arg, int8_tArray payer_id, int64_t expanded_key, int64_t entropy_source, int8_tArray payment_id) { + LDKOffer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey payer_id_ref; + CHECK(payer_id->arr_len == 33); + memcpy(payer_id_ref.compressed_form, payer_id->elems, 33); FREE(payer_id); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice_deriving_metadata(&this_arg_conv, payer_id_ref, &expanded_key_conv, entropy_source_conv, payment_id_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_Offer_request_invoice(int64_t this_arg, int8_tArray metadata, int8_tArray payer_id) { + LDKOffer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = metadata->arr_len; + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(metadata_ref.data, metadata->elems, metadata_ref.datalen); FREE(metadata); + LDKPublicKey payer_id_ref; + CHECK(payer_id->arr_len == 33); + memcpy(payer_id_ref.compressed_form, payer_id->elems, 33); FREE(payer_id); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice(&this_arg_conv, metadata_ref, payer_id_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_Offer_hash(int64_t o) { + LDKOffer o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Offer_hash(&o_conv); + return ret_conv; +} + int8_tArray CS_LDK_Offer_write(int64_t obj) { LDKOffer obj_conv; obj_conv.inner = untag_ptr(obj); @@ -54037,95 +65826,328 @@ int8_tArray CS_LDK_Offer_write(int64_t obj) { return ret_arr; } -void CS_LDK_Amount_free(int64_t this_obj) { - LDKAmount this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Amount_free(this_obj_conv); +void CS_LDK_Amount_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKAmount this_ptr_conv = *(LDKAmount*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Amount_free(this_ptr_conv); } static inline uint64_t Amount_clone_ptr(LDKAmount *NONNULL_PTR arg) { - LDKAmount ret_var = Amount_clone(arg); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } int64_t CS_LDK_Amount_clone_ptr(int64_t arg) { - LDKAmount arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - arg_conv.is_owned = false; - int64_t ret_conv = Amount_clone_ptr(&arg_conv); + LDKAmount* arg_conv = (LDKAmount*)untag_ptr(arg); + int64_t ret_conv = Amount_clone_ptr(arg_conv); return ret_conv; } int64_t CS_LDK_Amount_clone(int64_t orig) { - LDKAmount orig_conv; - orig_conv.inner = untag_ptr(orig); - orig_conv.is_owned = ptr_is_owned(orig); - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - orig_conv.is_owned = false; - LDKAmount ret_var = Amount_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKAmount* orig_conv = (LDKAmount*)untag_ptr(orig); + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Amount_bitcoin(int64_t amount_msats) { + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_bitcoin(amount_msats); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Amount_currency(int8_tArray iso4217_code, int64_t amount) { + LDKThreeBytes iso4217_code_ref; + CHECK(iso4217_code->arr_len == 3); + memcpy(iso4217_code_ref.data, iso4217_code->elems, 3); FREE(iso4217_code); + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_currency(iso4217_code_ref, amount); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_Quantity_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKQuantity this_ptr_conv = *(LDKQuantity*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Quantity_free(this_ptr_conv); +} + +static inline uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_Quantity_clone_ptr(int64_t arg) { + LDKQuantity* arg_conv = (LDKQuantity*)untag_ptr(arg); + int64_t ret_conv = Quantity_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_Quantity_clone(int64_t orig) { + LDKQuantity* orig_conv = (LDKQuantity*)untag_ptr(orig); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_Quantity_free(int64_t this_obj) { - LDKQuantity this_obj_conv; +int64_t CS_LDK_Quantity_bounded(int64_t a) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_bounded(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Quantity_unbounded() { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_unbounded(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Quantity_one() { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_one(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Offer_from_str(jstring s) { + LDKStr s_conv = str_ref_to_owned_c(s); + LDKCResult_OfferBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12ParseErrorZ), "LDKCResult_OfferBolt12ParseErrorZ"); + *ret_conv = Offer_from_str(s_conv); + return tag_ptr(ret_conv, true); +} + +jstring CS_LDK_Offer_to_str(int64_t o) { + LDKOffer o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Offer_to_str(&o_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_free(int64_t this_obj) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Quantity_free(this_obj_conv); + InvoiceWithExplicitSigningPubkeyBuilder_free(this_obj_conv); } -static inline uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg) { - LDKQuantity ret_var = Quantity_clone(arg); +void CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_free(int64_t this_obj) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceWithDerivedSigningPubkeyBuilder_free(this_obj_conv); +} + +int64_t CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_build(int64_t this_arg) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = InvoiceWithExplicitSigningPubkeyBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(int64_t this_arg, int32_t relative_expiry_secs) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); +} + +void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(int64_t this_arg, int8_tArray script_hash) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + uint8_t script_hash_arr[32]; + CHECK(script_hash->arr_len == 32); + memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash); + uint8_t (*script_hash_ref)[32] = &script_hash_arr; + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); +} + +void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(int64_t this_arg, int8_tArray pubkey_hash) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + uint8_t pubkey_hash_arr[20]; + CHECK(pubkey_hash->arr_len == 20); + memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); +} + +void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(int64_t this_arg, int8_tArray utput_key) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + LDKTweakedPublicKey utput_key_ref; + CHECK(utput_key->arr_len == 32); + memcpy(utput_key_ref.x_coordinate, utput_key->elems, 32); FREE(utput_key); + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); +} + +void CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(int64_t this_arg) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this_arg_conv); +} + +int64_t CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(int64_t this_arg) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(this_arg_conv); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(int64_t this_arg, int32_t relative_expiry_secs) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); +} + +void CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(int64_t this_arg, int8_tArray script_hash) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + uint8_t script_hash_arr[32]; + CHECK(script_hash->arr_len == 32); + memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash); + uint8_t (*script_hash_ref)[32] = &script_hash_arr; + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); +} + +void CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(int64_t this_arg, int8_tArray pubkey_hash) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + uint8_t pubkey_hash_arr[20]; + CHECK(pubkey_hash->arr_len == 20); + memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash); + uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr; + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); +} + +void CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(int64_t this_arg, int8_tArray utput_key) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + LDKTweakedPublicKey utput_key_ref; + CHECK(utput_key->arr_len == 32); + memcpy(utput_key_ref.x_coordinate, utput_key->elems, 32); FREE(utput_key); + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); +} + +void CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(int64_t this_arg) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(this_arg_conv); +} + +void CS_LDK_UnsignedBolt12Invoice_free(int64_t this_obj) { + LDKUnsignedBolt12Invoice this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UnsignedBolt12Invoice_free(this_obj_conv); +} + +static inline uint64_t UnsignedBolt12Invoice_clone_ptr(LDKUnsignedBolt12Invoice *NONNULL_PTR arg) { + LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_Quantity_clone_ptr(int64_t arg) { - LDKQuantity arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_clone_ptr(int64_t arg) { + LDKUnsignedBolt12Invoice arg_conv; arg_conv.inner = untag_ptr(arg); arg_conv.is_owned = ptr_is_owned(arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); arg_conv.is_owned = false; - int64_t ret_conv = Quantity_clone_ptr(&arg_conv); + int64_t ret_conv = UnsignedBolt12Invoice_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Quantity_clone(int64_t orig) { - LDKQuantity orig_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_clone(int64_t orig) { + LDKUnsignedBolt12Invoice orig_conv; orig_conv.inner = untag_ptr(orig); orig_conv.is_owned = ptr_is_owned(orig); CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); orig_conv.is_owned = false; - LDKQuantity ret_var = Quantity_clone(&orig_conv); + LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_clone(&orig_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_Offer_from_str(jstring s) { - LDKStr s_conv = str_ref_to_owned_c(s); - LDKCResult_OfferBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12ParseErrorZ), "LDKCResult_OfferBolt12ParseErrorZ"); - *ret_conv = Offer_from_str(s_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_UnsignedBolt12Invoice_free(int64_t this_obj) { - LDKUnsignedBolt12Invoice this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedBolt12Invoice_free(this_obj_conv); +void CS_LDK_SignBolt12InvoiceFn_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignBolt12InvoiceFn this_ptr_conv = *(LDKSignBolt12InvoiceFn*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignBolt12InvoiceFn_free(this_ptr_conv); } int64_t CS_LDK_UnsignedBolt12Invoice_tagged_hash(int64_t this_arg) { @@ -54220,10 +66242,9 @@ int64_t CS_LDK_UnsignedBolt12Invoice_amount(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = UnsignedBolt12Invoice_amount(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = UnsignedBolt12Invoice_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -54306,10 +66327,9 @@ int64_t CS_LDK_UnsignedBolt12Invoice_supported_quantity(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = UnsignedBolt12Invoice_supported_quantity(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = UnsignedBolt12Invoice_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -54490,10 +66510,9 @@ int64_t CS_LDK_Bolt12Invoice_amount(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = Bolt12Invoice_amount(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = Bolt12Invoice_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -54576,10 +66595,9 @@ int64_t CS_LDK_Bolt12Invoice_supported_quantity(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = Bolt12Invoice_supported_quantity(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = Bolt12Invoice_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -54757,6 +66775,16 @@ int64_t CS_LDK_Bolt12Invoice_verify(int64_t this_arg, int64_t key) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_Bolt12Invoice_hash(int64_t o) { + LDKBolt12Invoice o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Bolt12Invoice_hash(&o_conv); + return ret_conv; +} + int8_tArray CS_LDK_UnsignedBolt12Invoice_write(int64_t obj) { LDKUnsignedBolt12Invoice obj_conv; obj_conv.inner = untag_ptr(obj); @@ -55217,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); @@ -55240,6 +67280,142 @@ int64_t CS_LDK_InvoiceError_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +void CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_free(int64_t this_obj) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestWithExplicitPayerIdBuilder_free(this_obj_conv); +} + +void CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_free(int64_t this_obj) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestWithDerivedPayerIdBuilder_free(this_obj_conv); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_build(int64_t this_arg) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_chain(int64_t this_arg, int32_t network) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKNetwork network_conv = LDKNetwork_from_cs(network); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_chain(this_arg_conv, network_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(int64_t this_arg, int64_t amount_msats) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_quantity(int64_t this_arg, int64_t quantity) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_quantity(this_arg_conv, quantity); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_payer_note(int64_t this_arg, jstring payer_note) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKStr payer_note_conv = str_ref_to_owned_c(payer_note); + InvoiceRequestWithExplicitPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(int64_t this_arg) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(this_arg_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_chain(int64_t this_arg, int32_t network) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKNetwork network_conv = LDKNetwork_from_cs(network); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_chain(this_arg_conv, network_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(int64_t this_arg, int64_t amount_msats) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_quantity(int64_t this_arg, int64_t quantity) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_quantity(this_arg_conv, quantity); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_payer_note(int64_t this_arg, jstring payer_note) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKStr payer_note_conv = str_ref_to_owned_c(payer_note); + InvoiceRequestWithDerivedPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); +} + void CS_LDK_UnsignedInvoiceRequest_free(int64_t this_obj) { LDKUnsignedInvoiceRequest this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -55248,6 +67424,45 @@ void CS_LDK_UnsignedInvoiceRequest_free(int64_t this_obj) { UnsignedInvoiceRequest_free(this_obj_conv); } +static inline uint64_t UnsignedInvoiceRequest_clone_ptr(LDKUnsignedInvoiceRequest *NONNULL_PTR arg) { + LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_UnsignedInvoiceRequest_clone_ptr(int64_t arg) { + LDKUnsignedInvoiceRequest arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = UnsignedInvoiceRequest_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_UnsignedInvoiceRequest_clone(int64_t orig) { + LDKUnsignedInvoiceRequest orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_SignInvoiceRequestFn_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignInvoiceRequestFn this_ptr_conv = *(LDKSignInvoiceRequestFn*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignInvoiceRequestFn_free(this_ptr_conv); +} + int64_t CS_LDK_UnsignedInvoiceRequest_tagged_hash(int64_t this_arg) { LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -55307,6 +67522,33 @@ void CS_LDK_VerifiedInvoiceRequest_free(int64_t this_obj) { VerifiedInvoiceRequest_free(this_obj_conv); } +int64_t CS_LDK_VerifiedInvoiceRequest_get_offer_id(int64_t this_ptr) { + LDKVerifiedInvoiceRequest this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId ret_var = VerifiedInvoiceRequest_get_offer_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_VerifiedInvoiceRequest_set_offer_id(int64_t this_ptr, int64_t val) { + LDKVerifiedInvoiceRequest this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OfferId_clone(&val_conv); + VerifiedInvoiceRequest_set_offer_id(&this_ptr_conv, val_conv); +} + int64_t CS_LDK_VerifiedInvoiceRequest_get_keys(int64_t this_ptr) { LDKVerifiedInvoiceRequest this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -55400,10 +67642,9 @@ int64_t CS_LDK_UnsignedInvoiceRequest_amount(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = UnsignedInvoiceRequest_amount(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = UnsignedInvoiceRequest_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -55486,10 +67727,9 @@ int64_t CS_LDK_UnsignedInvoiceRequest_supported_quantity(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = UnsignedInvoiceRequest_supported_quantity(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = UnsignedInvoiceRequest_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -55626,10 +67866,9 @@ int64_t CS_LDK_InvoiceRequest_amount(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = InvoiceRequest_amount(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = InvoiceRequest_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -55712,10 +67951,9 @@ int64_t CS_LDK_InvoiceRequest_supported_quantity(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = InvoiceRequest_supported_quantity(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = InvoiceRequest_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -55814,15 +68052,64 @@ int64_t CS_LDK_InvoiceRequest_payer_note(int64_t this_arg) { return ret_ref; } -int8_tArray CS_LDK_InvoiceRequest_signature(int64_t this_arg) { +int64_t CS_LDK_InvoiceRequest_respond_with(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { LDKInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, InvoiceRequest_signature(&this_arg_conv).compact_form, 64); - return ret_arr; + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; + payment_paths_constr.datalen = payment_paths->arr_len; + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_t payment_paths_conv_37 = payment_paths_vals[l]; + void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); + CHECK_ACCESS(payment_paths_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); + payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); + payment_paths_constr.data[l] = payment_paths_conv_37_conv; + } + FREE(payment_paths); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequest_respond_with(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InvoiceRequest_respond_with_no_std(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; + payment_paths_constr.datalen = payment_paths->arr_len; + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_t payment_paths_conv_37 = payment_paths_vals[l]; + void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); + CHECK_ACCESS(payment_paths_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); + payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); + payment_paths_constr.data[l] = payment_paths_conv_37_conv; + } + FREE(payment_paths); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); } int64_t CS_LDK_InvoiceRequest_verify(int64_t this_arg, int64_t key) { @@ -55841,6 +68128,17 @@ int64_t CS_LDK_InvoiceRequest_verify(int64_t this_arg, int64_t key) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_InvoiceRequest_signature(int64_t this_arg) { + LDKInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_signature(&this_arg_conv).compact_form, 64); + return ret_arr; +} + ptrArray CS_LDK_VerifiedInvoiceRequest_chains(int64_t this_arg) { LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -55879,10 +68177,9 @@ int64_t CS_LDK_VerifiedInvoiceRequest_amount(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = VerifiedInvoiceRequest_amount(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = VerifiedInvoiceRequest_amount(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -55965,10 +68262,9 @@ int64_t CS_LDK_VerifiedInvoiceRequest_supported_quantity(int64_t this_arg) { this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = VerifiedInvoiceRequest_supported_quantity(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = VerifiedInvoiceRequest_supported_quantity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -56067,6 +68363,126 @@ int64_t CS_LDK_VerifiedInvoiceRequest_payer_note(int64_t this_arg) { return ret_ref; } +int64_t CS_LDK_VerifiedInvoiceRequest_respond_with(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; + payment_paths_constr.datalen = payment_paths->arr_len; + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_t payment_paths_conv_37 = payment_paths_vals[l]; + void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); + CHECK_ACCESS(payment_paths_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); + payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); + payment_paths_constr.data[l] = payment_paths_conv_37_conv; + } + FREE(payment_paths); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_with(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_VerifiedInvoiceRequest_respond_with_no_std(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; + payment_paths_constr.datalen = payment_paths->arr_len; + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_t payment_paths_conv_37 = payment_paths_vals[l]; + void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); + CHECK_ACCESS(payment_paths_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); + payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); + payment_paths_constr.data[l] = payment_paths_conv_37_conv; + } + FREE(payment_paths); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; + payment_paths_constr.datalen = payment_paths->arr_len; + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_t payment_paths_conv_37 = payment_paths_vals[l]; + void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); + CHECK_ACCESS(payment_paths_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); + payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); + payment_paths_constr.data[l] = payment_paths_conv_37_conv; + } + FREE(payment_paths); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys_no_std(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; + payment_paths_constr.datalen = payment_paths->arr_len; + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + payment_paths_constr.data = NULL; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_t payment_paths_conv_37 = payment_paths_vals[l]; + void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); + CHECK_ACCESS(payment_paths_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); + payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); + payment_paths_constr.data[l] = payment_paths_conv_37_conv; + } + FREE(payment_paths); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); +} + int8_tArray CS_LDK_UnsignedInvoiceRequest_write(int64_t obj) { LDKUnsignedInvoiceRequest obj_conv; obj_conv.inner = untag_ptr(obj); @@ -56093,6 +68509,177 @@ int8_tArray CS_LDK_InvoiceRequest_write(int64_t obj) { return ret_arr; } +void CS_LDK_InvoiceRequestFields_free(int64_t this_obj) { + LDKInvoiceRequestFields this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestFields_free(this_obj_conv); +} + +int8_tArray CS_LDK_InvoiceRequestFields_get_payer_id(int64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, InvoiceRequestFields_get_payer_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void CS_LDK_InvoiceRequestFields_set_payer_id(int64_t this_ptr, int8_tArray val) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + InvoiceRequestFields_set_payer_id(&this_ptr_conv, val_ref); +} + +int64_t CS_LDK_InvoiceRequestFields_get_quantity(int64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequestFields_get_quantity(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_InvoiceRequestFields_set_quantity(int64_t this_ptr, int64_t val) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + InvoiceRequestFields_set_quantity(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_InvoiceRequestFields_get_payer_note_truncated(int64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString ret_var = InvoiceRequestFields_get_payer_note_truncated(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_InvoiceRequestFields_set_payer_note_truncated(int64_t this_ptr, int64_t val) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UntrustedString_clone(&val_conv); + InvoiceRequestFields_set_payer_note_truncated(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_InvoiceRequestFields_new(int8_tArray payer_id_arg, int64_t quantity_arg, int64_t payer_note_truncated_arg) { + LDKPublicKey payer_id_arg_ref; + CHECK(payer_id_arg->arr_len == 33); + memcpy(payer_id_arg_ref.compressed_form, payer_id_arg->elems, 33); FREE(payer_id_arg); + void* quantity_arg_ptr = untag_ptr(quantity_arg); + CHECK_ACCESS(quantity_arg_ptr); + LDKCOption_u64Z quantity_arg_conv = *(LDKCOption_u64Z*)(quantity_arg_ptr); + quantity_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity_arg)); + LDKUntrustedString payer_note_truncated_arg_conv; + payer_note_truncated_arg_conv.inner = untag_ptr(payer_note_truncated_arg); + payer_note_truncated_arg_conv.is_owned = ptr_is_owned(payer_note_truncated_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payer_note_truncated_arg_conv); + payer_note_truncated_arg_conv = UntrustedString_clone(&payer_note_truncated_arg_conv); + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_new(payer_id_arg_ref, quantity_arg_conv, payer_note_truncated_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t InvoiceRequestFields_clone_ptr(LDKInvoiceRequestFields *NONNULL_PTR arg) { + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_InvoiceRequestFields_clone_ptr(int64_t arg) { + LDKInvoiceRequestFields arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InvoiceRequestFields_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_InvoiceRequestFields_clone(int64_t orig) { + LDKInvoiceRequestFields orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +jboolean CS_LDK_InvoiceRequestFields_eq(int64_t a, int64_t b) { + LDKInvoiceRequestFields a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInvoiceRequestFields b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFields_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray CS_LDK_InvoiceRequestFields_write(int64_t obj) { + LDKInvoiceRequestFields obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvoiceRequestFields_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_InvoiceRequestFields_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = InvoiceRequestFields_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + void CS_LDK_TaggedHash_free(int64_t this_obj) { LDKTaggedHash this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -56101,6 +68688,114 @@ void CS_LDK_TaggedHash_free(int64_t this_obj) { TaggedHash_free(this_obj_conv); } +static inline uint64_t TaggedHash_clone_ptr(LDKTaggedHash *NONNULL_PTR arg) { + LDKTaggedHash ret_var = TaggedHash_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_TaggedHash_clone_ptr(int64_t arg) { + LDKTaggedHash arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = TaggedHash_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_TaggedHash_clone(int64_t orig) { + LDKTaggedHash orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKTaggedHash ret_var = TaggedHash_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int8_tArray CS_LDK_TaggedHash_as_digest(int64_t this_arg) { + LDKTaggedHash this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *TaggedHash_as_digest(&this_arg_conv), 32); + return ret_arr; +} + +jstring CS_LDK_TaggedHash_tag(int64_t this_arg) { + LDKTaggedHash this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKStr ret_str = TaggedHash_tag(&this_arg_conv); + jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray CS_LDK_TaggedHash_merkle_root(int64_t this_arg) { + LDKTaggedHash this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, TaggedHash_merkle_root(&this_arg_conv).data, 32); + return ret_arr; +} + +void CS_LDK_SignError_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSignError this_ptr_conv = *(LDKSignError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignError_free(this_ptr_conv); +} + +static inline uint64_t SignError_clone_ptr(LDKSignError *NONNULL_PTR arg) { + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_SignError_clone_ptr(int64_t arg) { + LDKSignError* arg_conv = (LDKSignError*)untag_ptr(arg); + int64_t ret_conv = SignError_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_SignError_clone(int64_t orig) { + LDKSignError* orig_conv = (LDKSignError*)untag_ptr(orig); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SignError_signing() { + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_signing(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SignError_verification(int32_t a) { + LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_cs(a); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_verification(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + void CS_LDK_Bolt12ParseError_free(int64_t this_obj) { LDKBolt12ParseError this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -56260,6 +68955,11 @@ int32_t CS_LDK_Bolt12SemanticError_missing_paths() { return ret_conv; } +int32_t CS_LDK_Bolt12SemanticError_unexpected_paths() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_paths()); + return ret_conv; +} + int32_t CS_LDK_Bolt12SemanticError_invalid_pay_info() { int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_pay_info()); return ret_conv; @@ -56280,6 +68980,164 @@ int32_t CS_LDK_Bolt12SemanticError_missing_signature() { return ret_conv; } +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_free(int64_t this_obj) { + LDKRefundMaybeWithDerivedMetadataBuilder this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RefundMaybeWithDerivedMetadataBuilder_free(this_obj_conv); +} + +static inline uint64_t RefundMaybeWithDerivedMetadataBuilder_clone_ptr(LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR arg) { + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_clone_ptr(int64_t arg) { + LDKRefundMaybeWithDerivedMetadataBuilder arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = RefundMaybeWithDerivedMetadataBuilder_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_clone(int64_t orig) { + LDKRefundMaybeWithDerivedMetadataBuilder orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_new(int8_tArray metadata, int8_tArray payer_id, int64_t amount_msats) { + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = metadata->arr_len; + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(metadata_ref.data, metadata->elems, metadata_ref.datalen); FREE(metadata); + LDKPublicKey payer_id_ref; + CHECK(payer_id->arr_len == 33); + memcpy(payer_id_ref.compressed_form, payer_id->elems, 33); FREE(payer_id); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_new(metadata_ref, payer_id_ref, amount_msats); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(int8_tArray node_id, int64_t expanded_key, int64_t entropy_source, int64_t amount_msats, int8_tArray payment_id) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(node_id_ref, &expanded_key_conv, entropy_source_conv, amount_msats, payment_id_ref); + return tag_ptr(ret_conv, true); +} + +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_description(int64_t this_arg, jstring description) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = str_ref_to_owned_c(description); + RefundMaybeWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); +} + +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(int64_t this_arg, int64_t absolute_expiry) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); +} + +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_issuer(int64_t this_arg, jstring issuer) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = str_ref_to_owned_c(issuer); + RefundMaybeWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); +} + +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_path(int64_t this_arg, int64_t path) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = BlindedPath_clone(&path_conv); + RefundMaybeWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); +} + +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_chain(int64_t this_arg, int32_t network) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_cs(network); + RefundMaybeWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_quantity(int64_t this_arg, int64_t quantity) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + RefundMaybeWithDerivedMetadataBuilder_quantity(this_arg_conv, quantity); +} + +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_payer_note(int64_t this_arg, jstring payer_note) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr payer_note_conv = str_ref_to_owned_c(payer_note); + RefundMaybeWithDerivedMetadataBuilder_payer_note(this_arg_conv, payer_note_conv); +} + +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_build(int64_t this_arg) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); +} + void CS_LDK_Refund_free(int64_t this_obj) { LDKRefund this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -56353,6 +69211,16 @@ jboolean CS_LDK_Refund_is_expired(int64_t this_arg) { return ret_conv; } +jboolean CS_LDK_Refund_is_expired_no_std(int64_t this_arg, int64_t duration_since_epoch) { + LDKRefund this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = Refund_is_expired_no_std(&this_arg_conv, duration_since_epoch); + return ret_conv; +} + int64_t CS_LDK_Refund_issuer(int64_t this_arg) { LDKRefund this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -56470,6 +69338,16 @@ int64_t CS_LDK_Refund_payer_note(int64_t this_arg) { return ret_ref; } +int64_t CS_LDK_Refund_hash(int64_t o) { + LDKRefund o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Refund_hash(&o_conv); + return ret_conv; +} + int8_tArray CS_LDK_Refund_write(int64_t obj) { LDKRefund obj_conv; obj_conv.inner = untag_ptr(obj); @@ -56490,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)); @@ -56701,6 +69591,16 @@ int64_t CS_LDK_NodeId_from_pubkey(int8_tArray pubkey) { return ret_ref; } +int64_t CS_LDK_NodeId_from_slice(int8_tArray bytes) { + LDKu8slice bytes_ref; + bytes_ref.datalen = bytes->arr_len; + bytes_ref.data = bytes->elems; + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = NodeId_from_slice(bytes_ref); + FREE(bytes); + return tag_ptr(ret_conv, true); +} + int8_tArray CS_LDK_NodeId_as_slice(int64_t this_arg) { LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -56713,6 +69613,17 @@ int8_tArray CS_LDK_NodeId_as_slice(int64_t this_arg) { return ret_arr; } +int8_tArray CS_LDK_NodeId_as_array(int64_t this_arg) { + LDKNodeId this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, *NodeId_as_array(&this_arg_conv), 33); + return ret_arr; +} + int64_t CS_LDK_NodeId_as_pubkey(int64_t this_arg) { LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -56724,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); @@ -57201,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); @@ -57477,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); @@ -57551,25 +70498,41 @@ int64_t CS_LDK_DirectedChannelInfo_channel(int64_t this_arg) { return ret_ref; } -int64_t CS_LDK_DirectedChannelInfo_htlc_maximum_msat(int64_t this_arg) { +int64_t CS_LDK_DirectedChannelInfo_effective_capacity(int64_t this_arg) { LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv); - return ret_conv; + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t CS_LDK_DirectedChannelInfo_effective_capacity(int64_t this_arg) { +int64_t CS_LDK_DirectedChannelInfo_source(int64_t this_arg) { LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKNodeId ret_var = DirectedChannelInfo_source(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_DirectedChannelInfo_target(int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId ret_var = DirectedChannelInfo_target(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } @@ -58100,6 +71063,16 @@ int64_t CS_LDK_NodeAlias_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_NodeAlias_hash(int64_t o) { + LDKNodeAlias o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = NodeAlias_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_NodeAlias_eq(int64_t a, int64_t b) { LDKNodeAlias a_conv; a_conv.inner = untag_ptr(a); @@ -58115,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); @@ -58283,6 +71268,28 @@ jboolean CS_LDK_NodeInfo_eq(int64_t a, int64_t b) { return ret_conv; } +jboolean CS_LDK_NodeInfo_is_tor_only(int64_t this_arg) { + LDKNodeInfo this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = NodeInfo_is_tor_only(&this_arg_conv); + return ret_conv; +} + +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); @@ -58336,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); @@ -58692,7 +71711,7 @@ void CS_LDK_DefaultRouter_free(int64_t this_obj) { DefaultRouter_free(this_obj_conv); } -int64_t CS_LDK_DefaultRouter_new(int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes, int64_t scorer, int64_t score_params) { +int64_t CS_LDK_DefaultRouter_new(int64_t network_graph, int64_t logger, int64_t entropy_source, int64_t scorer, int64_t score_params) { LDKNetworkGraph network_graph_conv; network_graph_conv.inner = untag_ptr(network_graph); network_graph_conv.is_owned = ptr_is_owned(network_graph); @@ -58705,9 +71724,13 @@ int64_t CS_LDK_DefaultRouter_new(int64_t network_graph, int64_t logger, int8_tA // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKThirtyTwoBytes random_seed_bytes_ref; - CHECK(random_seed_bytes->arr_len == 32); - memcpy(random_seed_bytes_ref.data, random_seed_bytes->elems, 32); FREE(random_seed_bytes); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } void* scorer_ptr = untag_ptr(scorer); CHECK_ACCESS(scorer_ptr); LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); @@ -58720,7 +71743,7 @@ int64_t CS_LDK_DefaultRouter_new(int64_t network_graph, int64_t logger, int8_tA score_params_conv.is_owned = ptr_is_owned(score_params); CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_conv); score_params_conv = ProbabilisticScoringFeeParameters_clone(&score_params_conv); - LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv, score_params_conv); + LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, entropy_source_conv, scorer_conv, score_params_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -58738,6 +71761,17 @@ int64_t CS_LDK_DefaultRouter_as_Router(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int64_t CS_LDK_DefaultRouter_as_MessageRouter(int64_t this_arg) { + LDKDefaultRouter this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKMessageRouter* ret_ret = MALLOC(sizeof(LDKMessageRouter), "LDKMessageRouter"); + *ret_ret = DefaultRouter_as_MessageRouter(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + void CS_LDK_Router_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -59784,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); @@ -60149,7 +73195,47 @@ void CS_LDK_PaymentParameters_set_previously_failed_channels(int64_t this_ptr, PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); } -int64_t CS_LDK_PaymentParameters_new(int64_t payee_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg) { +int64_tArray CS_LDK_PaymentParameters_get_previously_failed_blinded_path_idxs(int64_t this_ptr) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_blinded_path_idxs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t g = 0; g < ret_var.datalen; g++) { + int64_t ret_conv_6_conv = ret_var.data[g]; + ret_arr_ptr[g] = ret_conv_6_conv; + } + + FREE(ret_var.data); + return ret_arr; +} + +void CS_LDK_PaymentParameters_set_previously_failed_blinded_path_idxs(int64_t this_ptr, int64_tArray val) { + LDKPaymentParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCVec_u64Z val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + FREE(val); + PaymentParameters_set_previously_failed_blinded_path_idxs(&this_ptr_conv, val_constr); +} + +int64_t CS_LDK_PaymentParameters_new(int64_t payee_arg, int64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg, int64_tArray previously_failed_blinded_path_idxs_arg) { void* payee_arg_ptr = untag_ptr(payee_arg); CHECK_ACCESS(payee_arg_ptr); LDKPayee payee_arg_conv = *(LDKPayee*)(payee_arg_ptr); @@ -60170,7 +73256,19 @@ int64_t CS_LDK_PaymentParameters_new(int64_t payee_arg, int64_t expiry_time_arg previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6; } FREE(previously_failed_channels_arg); - LDKPaymentParameters ret_var = PaymentParameters_new(payee_arg_conv, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr); + LDKCVec_u64Z previously_failed_blinded_path_idxs_arg_constr; + previously_failed_blinded_path_idxs_arg_constr.datalen = previously_failed_blinded_path_idxs_arg->arr_len; + if (previously_failed_blinded_path_idxs_arg_constr.datalen > 0) + previously_failed_blinded_path_idxs_arg_constr.data = MALLOC(previously_failed_blinded_path_idxs_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + previously_failed_blinded_path_idxs_arg_constr.data = NULL; + int64_t* previously_failed_blinded_path_idxs_arg_vals = previously_failed_blinded_path_idxs_arg->elems; + for (size_t g = 0; g < previously_failed_blinded_path_idxs_arg_constr.datalen; g++) { + int64_t previously_failed_blinded_path_idxs_arg_conv_6 = previously_failed_blinded_path_idxs_arg_vals[g]; + previously_failed_blinded_path_idxs_arg_constr.data[g] = previously_failed_blinded_path_idxs_arg_conv_6; + } + FREE(previously_failed_blinded_path_idxs_arg); + LDKPaymentParameters ret_var = PaymentParameters_new(payee_arg_conv, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr, previously_failed_blinded_path_idxs_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -60823,6 +73921,351 @@ int64_t CS_LDK_RouteHintHop_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +void CS_LDK_FirstHopCandidate_free(int64_t this_obj) { + LDKFirstHopCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + FirstHopCandidate_free(this_obj_conv); +} + +static inline uint64_t FirstHopCandidate_clone_ptr(LDKFirstHopCandidate *NONNULL_PTR arg) { + LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_FirstHopCandidate_clone_ptr(int64_t arg) { + LDKFirstHopCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = FirstHopCandidate_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_FirstHopCandidate_clone(int64_t orig) { + LDKFirstHopCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKFirstHopCandidate ret_var = FirstHopCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_PublicHopCandidate_free(int64_t this_obj) { + LDKPublicHopCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PublicHopCandidate_free(this_obj_conv); +} + +int64_t CS_LDK_PublicHopCandidate_get_short_channel_id(int64_t this_ptr) { + LDKPublicHopCandidate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = PublicHopCandidate_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_PublicHopCandidate_set_short_channel_id(int64_t this_ptr, int64_t val) { + LDKPublicHopCandidate this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PublicHopCandidate_set_short_channel_id(&this_ptr_conv, val); +} + +static inline uint64_t PublicHopCandidate_clone_ptr(LDKPublicHopCandidate *NONNULL_PTR arg) { + LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_PublicHopCandidate_clone_ptr(int64_t arg) { + LDKPublicHopCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PublicHopCandidate_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PublicHopCandidate_clone(int64_t orig) { + LDKPublicHopCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPublicHopCandidate ret_var = PublicHopCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_PrivateHopCandidate_free(int64_t this_obj) { + LDKPrivateHopCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PrivateHopCandidate_free(this_obj_conv); +} + +static inline uint64_t PrivateHopCandidate_clone_ptr(LDKPrivateHopCandidate *NONNULL_PTR arg) { + LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_PrivateHopCandidate_clone_ptr(int64_t arg) { + LDKPrivateHopCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = PrivateHopCandidate_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PrivateHopCandidate_clone(int64_t orig) { + LDKPrivateHopCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKPrivateHopCandidate ret_var = PrivateHopCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_BlindedPathCandidate_free(int64_t this_obj) { + LDKBlindedPathCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BlindedPathCandidate_free(this_obj_conv); +} + +static inline uint64_t BlindedPathCandidate_clone_ptr(LDKBlindedPathCandidate *NONNULL_PTR arg) { + LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_BlindedPathCandidate_clone_ptr(int64_t arg) { + LDKBlindedPathCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedPathCandidate_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_BlindedPathCandidate_clone(int64_t orig) { + LDKBlindedPathCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedPathCandidate ret_var = BlindedPathCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_OneHopBlindedPathCandidate_free(int64_t this_obj) { + LDKOneHopBlindedPathCandidate this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OneHopBlindedPathCandidate_free(this_obj_conv); +} + +static inline uint64_t OneHopBlindedPathCandidate_clone_ptr(LDKOneHopBlindedPathCandidate *NONNULL_PTR arg) { + LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_OneHopBlindedPathCandidate_clone_ptr(int64_t arg) { + LDKOneHopBlindedPathCandidate arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OneHopBlindedPathCandidate_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OneHopBlindedPathCandidate_clone(int64_t orig) { + LDKOneHopBlindedPathCandidate orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOneHopBlindedPathCandidate ret_var = OneHopBlindedPathCandidate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_CandidateRouteHop_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKCandidateRouteHop this_ptr_conv = *(LDKCandidateRouteHop*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CandidateRouteHop_free(this_ptr_conv); +} + +static inline uint64_t CandidateRouteHop_clone_ptr(LDKCandidateRouteHop *NONNULL_PTR arg) { + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_CandidateRouteHop_clone_ptr(int64_t arg) { + LDKCandidateRouteHop* arg_conv = (LDKCandidateRouteHop*)untag_ptr(arg); + int64_t ret_conv = CandidateRouteHop_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CandidateRouteHop_clone(int64_t orig) { + LDKCandidateRouteHop* orig_conv = (LDKCandidateRouteHop*)untag_ptr(orig); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_CandidateRouteHop_first_hop(int64_t a) { + LDKFirstHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = FirstHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_first_hop(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_CandidateRouteHop_public_hop(int64_t a) { + LDKPublicHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = PublicHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_public_hop(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_CandidateRouteHop_private_hop(int64_t a) { + LDKPrivateHopCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = PrivateHopCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_private_hop(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_CandidateRouteHop_blinded(int64_t a) { + LDKBlindedPathCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = BlindedPathCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_blinded(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_CandidateRouteHop_one_hop_blinded(int64_t a) { + LDKOneHopBlindedPathCandidate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OneHopBlindedPathCandidate_clone(&a_conv); + LDKCandidateRouteHop *ret_copy = MALLOC(sizeof(LDKCandidateRouteHop), "LDKCandidateRouteHop"); + *ret_copy = CandidateRouteHop_one_hop_blinded(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_CandidateRouteHop_globally_unique_short_channel_id(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = CandidateRouteHop_globally_unique_short_channel_id(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int32_t CS_LDK_CandidateRouteHop_cltv_expiry_delta(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + int32_t ret_conv = CandidateRouteHop_cltv_expiry_delta(this_arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CandidateRouteHop_htlc_minimum_msat(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + int64_t ret_conv = CandidateRouteHop_htlc_minimum_msat(this_arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CandidateRouteHop_fees(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKRoutingFees ret_var = CandidateRouteHop_fees(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_CandidateRouteHop_source(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKNodeId ret_var = CandidateRouteHop_source(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_CandidateRouteHop_target(int64_t this_arg) { + LDKCandidateRouteHop* this_arg_conv = (LDKCandidateRouteHop*)untag_ptr(this_arg); + LDKNodeId ret_var = CandidateRouteHop_target(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + int64_t CS_LDK_find_route(int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int64_t score_params, int8_tArray random_seed_bytes) { LDKPublicKey our_node_pubkey_ref; CHECK(our_node_pubkey->arr_len == 33); @@ -61958,27 +75401,31 @@ void CS_LDK_DelayedPaymentOutputDescriptor_set_output(int64_t this_ptr, int64_t DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } -int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_get_revocation_pubkey(int64_t this_ptr) { +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_revocation_pubkey(int64_t this_ptr) { LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKRevocationKey ret_var = DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_DelayedPaymentOutputDescriptor_set_revocation_pubkey(int64_t this_ptr, int8_tArray val) { +void CS_LDK_DelayedPaymentOutputDescriptor_set_revocation_pubkey(int64_t this_ptr, int64_t val) { LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref); + LDKRevocationKey val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = RevocationKey_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_conv); } int8_tArray CS_LDK_DelayedPaymentOutputDescriptor_get_channel_keys_id(int64_t this_ptr) { @@ -62023,7 +75470,34 @@ void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(int64_t t DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_new(int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int8_tArray revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelTransactionParameters ret_var = DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelTransactionParameters val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTransactionParameters_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_DelayedPaymentOutputDescriptor_new(int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_t channel_transaction_parameters_arg) { LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = untag_ptr(outpoint_arg); outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); @@ -62036,13 +75510,20 @@ int64_t CS_LDK_DelayedPaymentOutputDescriptor_new(int64_t outpoint_arg, int8_tA CHECK_ACCESS(output_arg_ptr); LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg)); - LDKPublicKey revocation_pubkey_arg_ref; - CHECK(revocation_pubkey_arg->arr_len == 33); - memcpy(revocation_pubkey_arg_ref.compressed_form, revocation_pubkey_arg->elems, 33); FREE(revocation_pubkey_arg); + LDKRevocationKey revocation_pubkey_arg_conv; + revocation_pubkey_arg_conv.inner = untag_ptr(revocation_pubkey_arg); + revocation_pubkey_arg_conv.is_owned = ptr_is_owned(revocation_pubkey_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(revocation_pubkey_arg_conv); + revocation_pubkey_arg_conv = RevocationKey_clone(&revocation_pubkey_arg_conv); LDKThirtyTwoBytes channel_keys_id_arg_ref; CHECK(channel_keys_id_arg->arr_len == 32); memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg); - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_arg); + LDKChannelTransactionParameters channel_transaction_parameters_arg_conv; + channel_transaction_parameters_arg_conv.inner = untag_ptr(channel_transaction_parameters_arg); + channel_transaction_parameters_arg_conv.is_owned = ptr_is_owned(channel_transaction_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_transaction_parameters_arg_conv); + channel_transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&channel_transaction_parameters_arg_conv); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg, channel_transaction_parameters_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -62409,7 +75890,7 @@ int64_t CS_LDK_SpendableOutputDescriptor_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_SpendableOutputDescriptor_static_output(int64_t outpoint, int64_t output) { +int64_t CS_LDK_SpendableOutputDescriptor_static_output(int64_t outpoint, int64_t output, int8_tArray channel_keys_id) { LDKOutPoint outpoint_conv; outpoint_conv.inner = untag_ptr(outpoint); outpoint_conv.is_owned = ptr_is_owned(outpoint); @@ -62419,8 +75900,11 @@ int64_t CS_LDK_SpendableOutputDescriptor_static_output(int64_t outpoint, int64_ CHECK_ACCESS(output_ptr); LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output)); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK(channel_keys_id->arr_len == 32); + memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv); + *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv, channel_keys_id_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -62522,7 +76006,7 @@ int64_t CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt(int64_tA CHECK_ACCESS(locktime_ptr); LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); - LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ), "LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ"); + LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ), "LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ"); *ret_conv = SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); return tag_ptr(ret_conv, true); } @@ -62723,6 +76207,29 @@ void CS_LDK_HTLCDescriptor_set_channel_derivation_parameters(int64_t this_ptr, HTLCDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); } +int8_tArray CS_LDK_HTLCDescriptor_get_commitment_txid(int64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *HTLCDescriptor_get_commitment_txid(&this_ptr_conv), 32); + return ret_arr; +} + +void CS_LDK_HTLCDescriptor_set_commitment_txid(int64_t this_ptr, int8_tArray val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + HTLCDescriptor_set_commitment_txid(&this_ptr_conv, val_ref); +} + int64_t CS_LDK_HTLCDescriptor_get_per_commitment_number(int64_t this_ptr) { LDKHTLCDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -62859,6 +76366,37 @@ void CS_LDK_HTLCDescriptor_set_counterparty_sig(int64_t this_ptr, int8_tArray v HTLCDescriptor_set_counterparty_sig(&this_ptr_conv, val_ref); } +int64_t CS_LDK_HTLCDescriptor_new(int64_t channel_derivation_parameters_arg, int8_tArray commitment_txid_arg, int64_t per_commitment_number_arg, int8_tArray per_commitment_point_arg, int32_t feerate_per_kw_arg, int64_t htlc_arg, int64_t preimage_arg, int8_tArray counterparty_sig_arg) { + LDKChannelDerivationParameters channel_derivation_parameters_arg_conv; + channel_derivation_parameters_arg_conv.inner = untag_ptr(channel_derivation_parameters_arg); + channel_derivation_parameters_arg_conv.is_owned = ptr_is_owned(channel_derivation_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_derivation_parameters_arg_conv); + channel_derivation_parameters_arg_conv = ChannelDerivationParameters_clone(&channel_derivation_parameters_arg_conv); + LDKThirtyTwoBytes commitment_txid_arg_ref; + CHECK(commitment_txid_arg->arr_len == 32); + memcpy(commitment_txid_arg_ref.data, commitment_txid_arg->elems, 32); FREE(commitment_txid_arg); + LDKPublicKey per_commitment_point_arg_ref; + CHECK(per_commitment_point_arg->arr_len == 33); + memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg); + LDKHTLCOutputInCommitment htlc_arg_conv; + htlc_arg_conv.inner = untag_ptr(htlc_arg); + htlc_arg_conv.is_owned = ptr_is_owned(htlc_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_arg_conv); + htlc_arg_conv = HTLCOutputInCommitment_clone(&htlc_arg_conv); + void* preimage_arg_ptr = untag_ptr(preimage_arg); + CHECK_ACCESS(preimage_arg_ptr); + LDKCOption_ThirtyTwoBytesZ preimage_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(preimage_arg_ptr); + preimage_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(preimage_arg)); + LDKECDSASignature counterparty_sig_arg_ref; + CHECK(counterparty_sig_arg->arr_len == 64); + memcpy(counterparty_sig_arg_ref.compact_form, counterparty_sig_arg->elems, 64); FREE(counterparty_sig_arg); + LDKHTLCDescriptor ret_var = HTLCDescriptor_new(channel_derivation_parameters_arg_conv, commitment_txid_arg_ref, per_commitment_number_arg, per_commitment_point_arg_ref, feerate_per_kw_arg, htlc_arg_conv, preimage_arg_conv, counterparty_sig_arg_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline uint64_t HTLCDescriptor_clone_ptr(LDKHTLCDescriptor *NONNULL_PTR arg) { LDKHTLCDescriptor ret_var = HTLCDescriptor_clone(arg); int64_t ret_ref = 0; @@ -63029,46 +76567,6 @@ void CS_LDK_ChannelSigner_free(int64_t this_ptr) { ChannelSigner_free(this_ptr_conv); } -void CS_LDK_EcdsaChannelSigner_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EcdsaChannelSigner_free(this_ptr_conv); -} - -static inline uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg) { - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = WriteableEcdsaChannelSigner_clone(arg); - return tag_ptr(ret_ret, true); -} -int64_t CS_LDK_WriteableEcdsaChannelSigner_clone_ptr(int64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKWriteableEcdsaChannelSigner* arg_conv = (LDKWriteableEcdsaChannelSigner*)arg_ptr; - int64_t ret_conv = WriteableEcdsaChannelSigner_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_WriteableEcdsaChannelSigner_clone(int64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKWriteableEcdsaChannelSigner* orig_conv = (LDKWriteableEcdsaChannelSigner*)orig_ptr; - LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); - *ret_ret = WriteableEcdsaChannelSigner_clone(orig_conv); - return tag_ptr(ret_ret, true); -} - -void CS_LDK_WriteableEcdsaChannelSigner_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKWriteableEcdsaChannelSigner this_ptr_conv = *(LDKWriteableEcdsaChannelSigner*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - WriteableEcdsaChannelSigner_free(this_ptr_conv); -} - int32_t CS_LDK_Recipient_clone(int64_t orig) { LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig); int32_t ret_conv = LDKRecipient_to_cs(Recipient_clone(orig_conv)); @@ -63103,6 +76601,15 @@ void CS_LDK_NodeSigner_free(int64_t this_ptr) { NodeSigner_free(this_ptr_conv); } +void CS_LDK_OutputSpender_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOutputSpender this_ptr_conv = *(LDKOutputSpender*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OutputSpender_free(this_ptr_conv); +} + void CS_LDK_SignerProvider_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -63112,6 +76619,15 @@ void CS_LDK_SignerProvider_free(int64_t this_ptr) { SignerProvider_free(this_ptr_conv); } +void CS_LDK_ChangeDestinationSource_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKChangeDestinationSource this_ptr_conv = *(LDKChangeDestinationSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ChangeDestinationSource_free(this_ptr_conv); +} + void CS_LDK_InMemorySigner_free(int64_t this_obj) { LDKInMemorySigner this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -63424,7 +76940,7 @@ int64_t CS_LDK_InMemorySigner_sign_counterparty_payment_input(int64_t this_arg, descriptor_conv.is_owned = ptr_is_owned(descriptor); CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); descriptor_conv.is_owned = false; - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return tag_ptr(ret_conv, true); } @@ -63445,7 +76961,7 @@ int64_t CS_LDK_InMemorySigner_sign_dynamic_p2wsh_input(int64_t this_arg, int8_t descriptor_conv.is_owned = ptr_is_owned(descriptor); CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); descriptor_conv.is_owned = false; - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + LDKCResult_WitnessNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_WitnessNoneZ), "LDKCResult_WitnessNoneZ"); *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return tag_ptr(ret_conv, true); } @@ -63603,76 +77119,36 @@ int64_t CS_LDK_KeysManager_sign_spendable_outputs_psbt(int64_t this_arg, int64_ return tag_ptr(ret_conv, true); } -int64_t CS_LDK_KeysManager_spend_spendable_outputs(int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { +int64_t CS_LDK_KeysManager_as_EntropySource(int64_t this_arg) { LDKKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = descriptors->arr_len; - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - int64_t* descriptors_vals = descriptors->elems; - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - FREE(descriptors); - LDKCVec_TxOutZ outputs_constr; - outputs_constr.datalen = outputs->arr_len; - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = outputs->elems; - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7); - CHECK_ACCESS(outputs_conv_7_ptr); - LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7)); - outputs_constr.data[h] = outputs_conv_7_conv; - } - FREE(outputs); - LDKCVec_u8Z change_destination_script_ref; - change_destination_script_ref.datalen = change_destination_script->arr_len; - change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script); - void* locktime_ptr = untag_ptr(locktime); - CHECK_ACCESS(locktime_ptr); - LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); - locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); - return tag_ptr(ret_conv, true); + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = KeysManager_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int64_t CS_LDK_KeysManager_as_EntropySource(int64_t this_arg) { +int64_t CS_LDK_KeysManager_as_NodeSigner(int64_t this_arg) { LDKKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = KeysManager_as_EntropySource(&this_arg_conv); + LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); + *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv); return tag_ptr(ret_ret, true); } -int64_t CS_LDK_KeysManager_as_NodeSigner(int64_t this_arg) { +int64_t CS_LDK_KeysManager_as_OutputSpender(int64_t this_arg) { LDKKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); - *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv); + LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *ret_ret = KeysManager_as_OutputSpender(&this_arg_conv); return tag_ptr(ret_ret, true); } @@ -63717,6 +77193,17 @@ int64_t CS_LDK_PhantomKeysManager_as_NodeSigner(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int64_t CS_LDK_PhantomKeysManager_as_OutputSpender(int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *ret_ret = PhantomKeysManager_as_OutputSpender(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + int64_t CS_LDK_PhantomKeysManager_as_SignerProvider(int64_t this_arg) { LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -63744,57 +77231,6 @@ int64_t CS_LDK_PhantomKeysManager_new(int8_tArray seed, int64_t starting_time_s return ret_ref; } -int64_t CS_LDK_PhantomKeysManager_spend_spendable_outputs(int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = descriptors->arr_len; - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - int64_t* descriptors_vals = descriptors->elems; - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - FREE(descriptors); - LDKCVec_TxOutZ outputs_constr; - outputs_constr.datalen = outputs->arr_len; - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = outputs->elems; - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7); - CHECK_ACCESS(outputs_conv_7_ptr); - LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7)); - outputs_constr.data[h] = outputs_conv_7_conv; - } - FREE(outputs); - LDKCVec_u8Z change_destination_script_ref; - change_destination_script_ref.datalen = change_destination_script->arr_len; - change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script); - void* locktime_ptr = untag_ptr(locktime); - CHECK_ACCESS(locktime_ptr); - LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); - locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); - return tag_ptr(ret_conv, true); -} - int64_t CS_LDK_PhantomKeysManager_derive_channel_keys(int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -63834,6 +77270,76 @@ int8_tArray CS_LDK_PhantomKeysManager_get_phantom_node_secret_key(int64_t this_ return ret_arr; } +void CS_LDK_RandomBytes_free(int64_t this_obj) { + LDKRandomBytes this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RandomBytes_free(this_obj_conv); +} + +int64_t CS_LDK_RandomBytes_new(int8_tArray seed) { + LDKThirtyTwoBytes seed_ref; + CHECK(seed->arr_len == 32); + memcpy(seed_ref.data, seed->elems, 32); FREE(seed); + LDKRandomBytes ret_var = RandomBytes_new(seed_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_RandomBytes_as_EntropySource(int64_t this_arg) { + LDKRandomBytes this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = RandomBytes_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_EcdsaChannelSigner_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EcdsaChannelSigner_free(this_ptr_conv); +} + +static inline uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg) { + LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); + *ret_ret = WriteableEcdsaChannelSigner_clone(arg); + return tag_ptr(ret_ret, true); +} +int64_t CS_LDK_WriteableEcdsaChannelSigner_clone_ptr(int64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKWriteableEcdsaChannelSigner* arg_conv = (LDKWriteableEcdsaChannelSigner*)arg_ptr; + int64_t ret_conv = WriteableEcdsaChannelSigner_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_WriteableEcdsaChannelSigner_clone(int64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKWriteableEcdsaChannelSigner* orig_conv = (LDKWriteableEcdsaChannelSigner*)orig_ptr; + LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner"); + *ret_ret = WriteableEcdsaChannelSigner_clone(orig_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_WriteableEcdsaChannelSigner_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKWriteableEcdsaChannelSigner this_ptr_conv = *(LDKWriteableEcdsaChannelSigner*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + WriteableEcdsaChannelSigner_free(this_ptr_conv); +} + void CS_LDK_OnionMessenger_free(int64_t this_obj) { LDKOnionMessenger this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -63859,8 +77365,20 @@ void CS_LDK_DefaultMessageRouter_free(int64_t this_obj) { DefaultMessageRouter_free(this_obj_conv); } -int64_t CS_LDK_DefaultMessageRouter_new() { - LDKDefaultMessageRouter ret_var = DefaultMessageRouter_new(); +int64_t CS_LDK_DefaultMessageRouter_new(int64_t network_graph, int64_t entropy_source) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKDefaultMessageRouter ret_var = DefaultMessageRouter_new(&network_graph_conv, entropy_source_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -63955,7 +77473,32 @@ void CS_LDK_OnionMessagePath_set_destination(int64_t this_ptr, int64_t val) { OnionMessagePath_set_destination(&this_ptr_conv, val_conv); } -int64_t CS_LDK_OnionMessagePath_new(ptrArray intermediate_nodes_arg, int64_t destination_arg) { +int64_t CS_LDK_OnionMessagePath_get_first_node_addresses(int64_t this_ptr) { + LDKOnionMessagePath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_CVec_SocketAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_SocketAddressZZ), "LDKCOption_CVec_SocketAddressZZ"); + *ret_copy = OnionMessagePath_get_first_node_addresses(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_OnionMessagePath_set_first_node_addresses(int64_t this_ptr, int64_t val) { + LDKOnionMessagePath this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_SocketAddressZZ val_conv = *(LDKCOption_CVec_SocketAddressZZ*)(val_ptr); + val_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(val)); + OnionMessagePath_set_first_node_addresses(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_OnionMessagePath_new(ptrArray intermediate_nodes_arg, int64_t destination_arg, int64_t first_node_addresses_arg) { LDKCVec_PublicKeyZ intermediate_nodes_arg_constr; intermediate_nodes_arg_constr.datalen = intermediate_nodes_arg->arr_len; if (intermediate_nodes_arg_constr.datalen > 0) @@ -63975,7 +77518,10 @@ int64_t CS_LDK_OnionMessagePath_new(ptrArray intermediate_nodes_arg, int64_t de CHECK_ACCESS(destination_arg_ptr); LDKDestination destination_arg_conv = *(LDKDestination*)(destination_arg_ptr); destination_arg_conv = Destination_clone((LDKDestination*)untag_ptr(destination_arg)); - LDKOnionMessagePath ret_var = OnionMessagePath_new(intermediate_nodes_arg_constr, destination_arg_conv); + void* first_node_addresses_arg_ptr = untag_ptr(first_node_addresses_arg); + CHECK_ACCESS(first_node_addresses_arg_ptr); + LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg_conv = *(LDKCOption_CVec_SocketAddressZZ*)(first_node_addresses_arg_ptr); + LDKOnionMessagePath ret_var = OnionMessagePath_new(intermediate_nodes_arg_constr, destination_arg_conv, first_node_addresses_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -64012,6 +77558,17 @@ int64_t CS_LDK_OnionMessagePath_clone(int64_t orig) { return ret_ref; } +int8_tArray CS_LDK_OnionMessagePath_first_node(int64_t this_arg) { + LDKOnionMessagePath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, OnionMessagePath_first_node(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + void CS_LDK_Destination_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -64063,6 +77620,88 @@ int64_t CS_LDK_Destination_blinded_path(int64_t a) { return ret_ref; } +int64_t CS_LDK_Destination_hash(int64_t o) { + LDKDestination* o_conv = (LDKDestination*)untag_ptr(o); + int64_t ret_conv = Destination_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_Destination_eq(int64_t a, int64_t b) { + LDKDestination* a_conv = (LDKDestination*)untag_ptr(a); + LDKDestination* b_conv = (LDKDestination*)untag_ptr(b); + jboolean ret_conv = Destination_eq(a_conv, b_conv); + return ret_conv; +} + +void CS_LDK_Destination_resolve(int64_t this_arg, int64_t network_graph) { + LDKDestination* this_arg_conv = (LDKDestination*)untag_ptr(this_arg); + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + Destination_resolve(this_arg_conv, &network_graph_conv); +} + +void CS_LDK_SendSuccess_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKSendSuccess this_ptr_conv = *(LDKSendSuccess*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SendSuccess_free(this_ptr_conv); +} + +static inline uint64_t SendSuccess_clone_ptr(LDKSendSuccess *NONNULL_PTR arg) { + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_SendSuccess_clone_ptr(int64_t arg) { + LDKSendSuccess* arg_conv = (LDKSendSuccess*)untag_ptr(arg); + int64_t ret_conv = SendSuccess_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_SendSuccess_clone(int64_t orig) { + LDKSendSuccess* orig_conv = (LDKSendSuccess*)untag_ptr(orig); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SendSuccess_buffered() { + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_buffered(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SendSuccess_buffered_awaiting_connection(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKSendSuccess *ret_copy = MALLOC(sizeof(LDKSendSuccess), "LDKSendSuccess"); + *ret_copy = SendSuccess_buffered_awaiting_connection(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SendSuccess_hash(int64_t o) { + LDKSendSuccess* o_conv = (LDKSendSuccess*)untag_ptr(o); + int64_t ret_conv = SendSuccess_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_SendSuccess_eq(int64_t a, int64_t b) { + LDKSendSuccess* a_conv = (LDKSendSuccess*)untag_ptr(a); + LDKSendSuccess* b_conv = (LDKSendSuccess*)untag_ptr(b); + jboolean ret_conv = SendSuccess_eq(a_conv, b_conv); + return ret_conv; +} + void CS_LDK_SendError_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -64114,9 +77753,19 @@ int64_t CS_LDK_SendError_too_few_blinded_hops() { return ret_ref; } -int64_t CS_LDK_SendError_invalid_first_hop() { +int64_t CS_LDK_SendError_invalid_first_hop(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_invalid_first_hop(); + *ret_copy = SendError_invalid_first_hop(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SendError_path_not_found() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_path_not_found(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -64142,6 +77791,13 @@ int64_t CS_LDK_SendError_get_node_id_failed() { return ret_ref; } +int64_t CS_LDK_SendError_unresolved_introduction_node() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_unresolved_introduction_node(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_SendError_blinded_path_advance_failed() { LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); *ret_copy = SendError_blinded_path_advance_failed(); @@ -64149,6 +77805,12 @@ int64_t CS_LDK_SendError_blinded_path_advance_failed() { return ret_ref; } +int64_t CS_LDK_SendError_hash(int64_t o) { + LDKSendError* o_conv = (LDKSendError*)untag_ptr(o); + int64_t ret_conv = SendError_hash(o_conv); + return ret_conv; +} + jboolean CS_LDK_SendError_eq(int64_t a, int64_t b) { LDKSendError* a_conv = (LDKSendError*)untag_ptr(a); LDKSendError* b_conv = (LDKSendError*)untag_ptr(b); @@ -64194,17 +77856,18 @@ int64_t CS_LDK_PeeledOnion_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_PeeledOnion_forward(int8_tArray a, int64_t b) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); +int64_t CS_LDK_PeeledOnion_forward(int64_t a, int64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKNextMessageHop a_conv = *(LDKNextMessageHop*)(a_ptr); + a_conv = NextMessageHop_clone((LDKNextMessageHop*)untag_ptr(a)); LDKOnionMessage b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = OnionMessage_clone(&b_conv); LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_forward(a_ref, b_conv); + *ret_copy = PeeledOnion_forward(a_conv, b_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -64228,13 +77891,21 @@ int64_t CS_LDK_PeeledOnion_receive(int64_t a, int8_tArray b, int64_t c) { return ret_ref; } -int64_t CS_LDK_create_onion_message(int64_t entropy_source, int64_t node_signer, int64_t path, int64_t contents, int64_t reply_path) { +int64_t CS_LDK_create_onion_message_resolving_destination(int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t network_graph, int64_t path, int64_t contents, int64_t reply_path) { void* entropy_source_ptr = untag_ptr(entropy_source); if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; void* node_signer_ptr = untag_ptr(node_signer); if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; LDKOnionMessagePath path_conv; path_conv.inner = untag_ptr(path); path_conv.is_owned = ptr_is_owned(path); @@ -64252,8 +77923,40 @@ int64_t CS_LDK_create_onion_message(int64_t entropy_source, int64_t node_signer reply_path_conv.is_owned = ptr_is_owned(reply_path); CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); reply_path_conv = BlindedPath_clone(&reply_path_conv); - LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ), "LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ"); - *ret_conv = create_onion_message(entropy_source_conv, node_signer_conv, path_conv, contents_conv, reply_path_conv); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = create_onion_message_resolving_destination(entropy_source_conv, node_signer_conv, node_id_lookup_conv, &network_graph_conv, path_conv, contents_conv, reply_path_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_create_onion_message(int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t path, int64_t contents, int64_t reply_path) { + void* entropy_source_ptr = untag_ptr(entropy_source); + if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } + LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKOnionMessagePath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = OnionMessagePath_clone(&path_conv); + void* contents_ptr = untag_ptr(contents); + CHECK_ACCESS(contents_ptr); + LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); + if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&contents_conv); + } + LDKBlindedPath reply_path_conv; + reply_path_conv.inner = untag_ptr(reply_path); + reply_path_conv.is_owned = ptr_is_owned(reply_path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); + reply_path_conv = BlindedPath_clone(&reply_path_conv); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = create_onion_message(entropy_source_conv, node_signer_conv, node_id_lookup_conv, path_conv, contents_conv, reply_path_conv); return tag_ptr(ret_conv, true); } @@ -64289,7 +77992,7 @@ int64_t CS_LDK_peel_onion_message(int64_t msg, int64_t node_signer, int64_t log return tag_ptr(ret_conv, true); } -int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t message_router, int64_t offers_handler, int64_t custom_handler) { +int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t custom_handler) { void* entropy_source_ptr = untag_ptr(entropy_source); CHECK_ACCESS(entropy_source_ptr); LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); @@ -64311,6 +78014,13 @@ int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + CHECK_ACCESS(node_id_lookup_ptr); + LDKNodeIdLookUp node_id_lookup_conv = *(LDKNodeIdLookUp*)(node_id_lookup_ptr); + if (node_id_lookup_conv.free == LDKNodeIdLookUp_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeIdLookUp_JCalls_cloned(&node_id_lookup_conv); + } void* message_router_ptr = untag_ptr(message_router); CHECK_ACCESS(message_router_ptr); LDKMessageRouter message_router_conv = *(LDKMessageRouter*)(message_router_ptr); @@ -64332,24 +78042,19 @@ int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv); } - LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, message_router_conv, offers_handler_conv, custom_handler_conv); + LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_conv, custom_handler_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t CS_LDK_OnionMessenger_send_onion_message(int64_t this_arg, int64_t path, int64_t contents, int64_t reply_path) { +int64_t CS_LDK_OnionMessenger_send_onion_message(int64_t this_arg, int64_t contents, int64_t destination, int64_t reply_path) { LDKOnionMessenger this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKOnionMessagePath path_conv; - path_conv.inner = untag_ptr(path); - path_conv.is_owned = ptr_is_owned(path); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); - path_conv = OnionMessagePath_clone(&path_conv); void* contents_ptr = untag_ptr(contents); CHECK_ACCESS(contents_ptr); LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); @@ -64357,13 +78062,17 @@ int64_t CS_LDK_OnionMessenger_send_onion_message(int64_t this_arg, int64_t path // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKOnionMessageContents_JCalls_cloned(&contents_conv); } + void* destination_ptr = untag_ptr(destination); + CHECK_ACCESS(destination_ptr); + LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); LDKBlindedPath reply_path_conv; reply_path_conv.inner = untag_ptr(reply_path); reply_path_conv.is_owned = ptr_is_owned(reply_path); CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); reply_path_conv = BlindedPath_clone(&reply_path_conv); - LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); - *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, path_conv, contents_conv, reply_path_conv); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, contents_conv, destination_conv, reply_path_conv); return tag_ptr(ret_conv, true); } @@ -64457,6 +78166,13 @@ jboolean CS_LDK_OffersMessage_is_known_type(int64_t tlv_type) { return ret_conv; } +int64_t CS_LDK_OffersMessage_as_OnionMessageContents(int64_t this_arg) { + LDKOffersMessage* this_arg_conv = (LDKOffersMessage*)untag_ptr(this_arg); + LDKOnionMessageContents* ret_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_ret = OffersMessage_as_OnionMessageContents(this_arg_conv); + return tag_ptr(ret_ret, true); +} + int8_tArray CS_LDK_OffersMessage_write(int64_t obj) { LDKOffersMessage* obj_conv = (LDKOffersMessage*)untag_ptr(obj); LDKCVec_u8Z ret_var = OffersMessage_write(obj_conv); @@ -64626,6 +78342,16 @@ int64_t CS_LDK_Packet_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_Packet_hash(int64_t o) { + LDKPacket o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + int64_t ret_conv = Packet_hash(&o_conv); + return ret_conv; +} + jboolean CS_LDK_Packet_eq(int64_t a, int64_t b) { LDKPacket a_conv; a_conv.inner = untag_ptr(a); @@ -64755,6 +78481,65 @@ void CS_LDK_OnionMessageContents_free(int64_t this_ptr) { OnionMessageContents_free(this_ptr_conv); } +void CS_LDK_NextMessageHop_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKNextMessageHop this_ptr_conv = *(LDKNextMessageHop*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NextMessageHop_free(this_ptr_conv); +} + +static inline uint64_t NextMessageHop_clone_ptr(LDKNextMessageHop *NONNULL_PTR arg) { + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_NextMessageHop_clone_ptr(int64_t arg) { + LDKNextMessageHop* arg_conv = (LDKNextMessageHop*)untag_ptr(arg); + int64_t ret_conv = NextMessageHop_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_NextMessageHop_clone(int64_t orig) { + LDKNextMessageHop* orig_conv = (LDKNextMessageHop*)untag_ptr(orig); + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_NextMessageHop_node_id(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_node_id(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_NextMessageHop_short_channel_id(int64_t a) { + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_short_channel_id(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_NextMessageHop_hash(int64_t o) { + LDKNextMessageHop* o_conv = (LDKNextMessageHop*)untag_ptr(o); + int64_t ret_conv = NextMessageHop_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_NextMessageHop_eq(int64_t a, int64_t b) { + LDKNextMessageHop* a_conv = (LDKNextMessageHop*)untag_ptr(a); + LDKNextMessageHop* b_conv = (LDKNextMessageHop*)untag_ptr(b); + jboolean ret_conv = NextMessageHop_eq(a_conv, b_conv); + return ret_conv; +} + void CS_LDK_BlindedPath_free(int64_t this_obj) { LDKBlindedPath this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -64763,27 +78548,29 @@ void CS_LDK_BlindedPath_free(int64_t this_obj) { BlindedPath_free(this_obj_conv); } -int8_tArray CS_LDK_BlindedPath_get_introduction_node_id(int64_t this_ptr) { +int64_t CS_LDK_BlindedPath_get_introduction_node(int64_t this_ptr) { LDKBlindedPath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, BlindedPath_get_introduction_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = BlindedPath_get_introduction_node(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_BlindedPath_set_introduction_node_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_BlindedPath_set_introduction_node(int64_t this_ptr, int64_t val) { LDKBlindedPath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - BlindedPath_set_introduction_node_id(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKIntroductionNode val_conv = *(LDKIntroductionNode*)(val_ptr); + val_conv = IntroductionNode_clone((LDKIntroductionNode*)untag_ptr(val)); + BlindedPath_set_introduction_node(&this_ptr_conv, val_conv); } int8_tArray CS_LDK_BlindedPath_get_blinding_point(int64_t this_ptr) { @@ -64857,10 +78644,11 @@ void CS_LDK_BlindedPath_set_blinded_hops(int64_t this_ptr, int64_tArray val) { BlindedPath_set_blinded_hops(&this_ptr_conv, val_constr); } -int64_t CS_LDK_BlindedPath_new(int8_tArray introduction_node_id_arg, int8_tArray blinding_point_arg, int64_tArray blinded_hops_arg) { - LDKPublicKey introduction_node_id_arg_ref; - CHECK(introduction_node_id_arg->arr_len == 33); - memcpy(introduction_node_id_arg_ref.compressed_form, introduction_node_id_arg->elems, 33); FREE(introduction_node_id_arg); +int64_t CS_LDK_BlindedPath_new(int64_t introduction_node_arg, int8_tArray blinding_point_arg, int64_tArray blinded_hops_arg) { + void* introduction_node_arg_ptr = untag_ptr(introduction_node_arg); + CHECK_ACCESS(introduction_node_arg_ptr); + LDKIntroductionNode introduction_node_arg_conv = *(LDKIntroductionNode*)(introduction_node_arg_ptr); + introduction_node_arg_conv = IntroductionNode_clone((LDKIntroductionNode*)untag_ptr(introduction_node_arg)); LDKPublicKey blinding_point_arg_ref; CHECK(blinding_point_arg->arr_len == 33); memcpy(blinding_point_arg_ref.compressed_form, blinding_point_arg->elems, 33); FREE(blinding_point_arg); @@ -64881,7 +78669,7 @@ int64_t CS_LDK_BlindedPath_new(int8_tArray introduction_node_id_arg, int8_tArra blinded_hops_arg_constr.data[m] = blinded_hops_arg_conv_12_conv; } FREE(blinded_hops_arg); - LDKBlindedPath ret_var = BlindedPath_new(introduction_node_id_arg_ref, blinding_point_arg_ref, blinded_hops_arg_constr); + LDKBlindedPath ret_var = BlindedPath_new(introduction_node_arg_conv, blinding_point_arg_ref, blinded_hops_arg_constr); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -64943,6 +78731,131 @@ jboolean CS_LDK_BlindedPath_eq(int64_t a, int64_t b) { return ret_conv; } +void CS_LDK_IntroductionNode_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKIntroductionNode this_ptr_conv = *(LDKIntroductionNode*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + IntroductionNode_free(this_ptr_conv); +} + +static inline uint64_t IntroductionNode_clone_ptr(LDKIntroductionNode *NONNULL_PTR arg) { + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_IntroductionNode_clone_ptr(int64_t arg) { + LDKIntroductionNode* arg_conv = (LDKIntroductionNode*)untag_ptr(arg); + int64_t ret_conv = IntroductionNode_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_IntroductionNode_clone(int64_t orig) { + LDKIntroductionNode* orig_conv = (LDKIntroductionNode*)untag_ptr(orig); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_IntroductionNode_node_id(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_node_id(a_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_IntroductionNode_directed_short_channel_id(int32_t a, int64_t b) { + LDKDirection a_conv = LDKDirection_from_cs(a); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_directed_short_channel_id(a_conv, b); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_IntroductionNode_hash(int64_t o) { + LDKIntroductionNode* o_conv = (LDKIntroductionNode*)untag_ptr(o); + int64_t ret_conv = IntroductionNode_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_IntroductionNode_eq(int64_t a, int64_t b) { + LDKIntroductionNode* a_conv = (LDKIntroductionNode*)untag_ptr(a); + LDKIntroductionNode* b_conv = (LDKIntroductionNode*)untag_ptr(b); + jboolean ret_conv = IntroductionNode_eq(a_conv, b_conv); + return ret_conv; +} + +int32_t CS_LDK_Direction_clone(int64_t orig) { + LDKDirection* orig_conv = (LDKDirection*)untag_ptr(orig); + int32_t ret_conv = LDKDirection_to_cs(Direction_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_Direction_node_one() { + int32_t ret_conv = LDKDirection_to_cs(Direction_node_one()); + return ret_conv; +} + +int32_t CS_LDK_Direction_node_two() { + int32_t ret_conv = LDKDirection_to_cs(Direction_node_two()); + return ret_conv; +} + +int64_t CS_LDK_Direction_hash(int64_t o) { + LDKDirection* o_conv = (LDKDirection*)untag_ptr(o); + int64_t ret_conv = Direction_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_Direction_eq(int64_t a, int64_t b) { + LDKDirection* a_conv = (LDKDirection*)untag_ptr(a); + LDKDirection* b_conv = (LDKDirection*)untag_ptr(b); + jboolean ret_conv = Direction_eq(a_conv, b_conv); + return ret_conv; +} + +void CS_LDK_NodeIdLookUp_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKNodeIdLookUp this_ptr_conv = *(LDKNodeIdLookUp*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeIdLookUp_free(this_ptr_conv); +} + +void CS_LDK_EmptyNodeIdLookUp_free(int64_t this_obj) { + LDKEmptyNodeIdLookUp this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + EmptyNodeIdLookUp_free(this_obj_conv); +} + +int64_t CS_LDK_EmptyNodeIdLookUp_new() { + LDKEmptyNodeIdLookUp ret_var = EmptyNodeIdLookUp_new(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int64_t CS_LDK_EmptyNodeIdLookUp_as_NodeIdLookUp(int64_t this_arg) { + LDKEmptyNodeIdLookUp this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *ret_ret = EmptyNodeIdLookUp_as_NodeIdLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + void CS_LDK_BlindedHop_free(int64_t this_obj) { LDKBlindedHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -65075,8 +78988,12 @@ int64_t CS_LDK_BlindedPath_one_hop_for_message(int8_tArray recipient_node_id, i CHECK(recipient_node_id->arr_len == 33); memcpy(recipient_node_id_ref.compressed_form, recipient_node_id->elems, 33); FREE(recipient_node_id); void* entropy_source_ptr = untag_ptr(entropy_source); - if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } - LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); *ret_conv = BlindedPath_one_hop_for_message(recipient_node_id_ref, entropy_source_conv); return tag_ptr(ret_conv, true); @@ -65099,14 +79016,18 @@ int64_t CS_LDK_BlindedPath_new_for_message(ptrArray node_pks, int64_t entropy_s } FREE(node_pks); void* entropy_source_ptr = untag_ptr(entropy_source); - if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } - LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); *ret_conv = BlindedPath_new_for_message(node_pks_constr, entropy_source_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, int64_t payee_tlvs, int64_t entropy_source) { +int64_t CS_LDK_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, int64_t payee_tlvs, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { LDKPublicKey payee_node_id_ref; CHECK(payee_node_id->arr_len == 33); memcpy(payee_node_id_ref.compressed_form, payee_node_id->elems, 33); FREE(payee_node_id); @@ -65116,13 +79037,73 @@ int64_t CS_LDK_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, int64 CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); void* entropy_source_ptr = untag_ptr(entropy_source); - if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } - LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); + *ret_conv = BlindedPath_one_hop_for_payment(payee_node_id_ref, payee_tlvs_conv, min_final_cltv_expiry_delta, entropy_source_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_BlindedPath_new_for_payment(int64_tArray intermediate_nodes, int8_tArray payee_node_id, int64_t payee_tlvs, int64_t htlc_maximum_msat, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { + LDKCVec_ForwardNodeZ intermediate_nodes_constr; + intermediate_nodes_constr.datalen = intermediate_nodes->arr_len; + if (intermediate_nodes_constr.datalen > 0) + intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ Elements"); + else + intermediate_nodes_constr.data = NULL; + int64_t* intermediate_nodes_vals = intermediate_nodes->elems; + for (size_t n = 0; n < intermediate_nodes_constr.datalen; n++) { + int64_t intermediate_nodes_conv_13 = intermediate_nodes_vals[n]; + LDKForwardNode intermediate_nodes_conv_13_conv; + intermediate_nodes_conv_13_conv.inner = untag_ptr(intermediate_nodes_conv_13); + intermediate_nodes_conv_13_conv.is_owned = ptr_is_owned(intermediate_nodes_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(intermediate_nodes_conv_13_conv); + intermediate_nodes_conv_13_conv = ForwardNode_clone(&intermediate_nodes_conv_13_conv); + intermediate_nodes_constr.data[n] = intermediate_nodes_conv_13_conv; + } + FREE(intermediate_nodes); + LDKPublicKey payee_node_id_ref; + CHECK(payee_node_id->arr_len == 33); + memcpy(payee_node_id_ref.compressed_form, payee_node_id->elems, 33); FREE(payee_node_id); + LDKReceiveTlvs payee_tlvs_conv; + payee_tlvs_conv.inner = untag_ptr(payee_tlvs); + payee_tlvs_conv.is_owned = ptr_is_owned(payee_tlvs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); + payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = BlindedPath_one_hop_for_payment(payee_node_id_ref, payee_tlvs_conv, entropy_source_conv); + *ret_conv = BlindedPath_new_for_payment(intermediate_nodes_constr, payee_node_id_ref, payee_tlvs_conv, htlc_maximum_msat, min_final_cltv_expiry_delta, entropy_source_conv); return tag_ptr(ret_conv, true); } +int64_t CS_LDK_BlindedPath_public_introduction_node_id(int64_t this_arg, int64_t network_graph) { + LDKBlindedPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKReadOnlyNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + LDKNodeId ret_var = BlindedPath_public_introduction_node_id(&this_arg_conv, &network_graph_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + int8_tArray CS_LDK_BlindedPath_write(int64_t obj) { LDKBlindedPath obj_conv; obj_conv.inner = untag_ptr(obj); @@ -65511,7 +79492,32 @@ void CS_LDK_ReceiveTlvs_set_payment_constraints(int64_t this_ptr, int64_t val) ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ReceiveTlvs_new(int8_tArray payment_secret_arg, int64_t payment_constraints_arg) { +int64_t CS_LDK_ReceiveTlvs_get_payment_context(int64_t this_ptr) { + LDKReceiveTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = ReceiveTlvs_get_payment_context(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_ReceiveTlvs_set_payment_context(int64_t this_ptr, int64_t val) { + LDKReceiveTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKPaymentContext val_conv = *(LDKPaymentContext*)(val_ptr); + val_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(val)); + ReceiveTlvs_set_payment_context(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_ReceiveTlvs_new(int8_tArray payment_secret_arg, int64_t payment_constraints_arg, int64_t payment_context_arg) { LDKThirtyTwoBytes payment_secret_arg_ref; CHECK(payment_secret_arg->arr_len == 32); memcpy(payment_secret_arg_ref.data, payment_secret_arg->elems, 32); FREE(payment_secret_arg); @@ -65520,7 +79526,11 @@ int64_t CS_LDK_ReceiveTlvs_new(int8_tArray payment_secret_arg, int64_t payment_ payment_constraints_arg_conv.is_owned = ptr_is_owned(payment_constraints_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_constraints_arg_conv); payment_constraints_arg_conv = PaymentConstraints_clone(&payment_constraints_arg_conv); - LDKReceiveTlvs ret_var = ReceiveTlvs_new(payment_secret_arg_ref, payment_constraints_arg_conv); + void* payment_context_arg_ptr = untag_ptr(payment_context_arg); + CHECK_ACCESS(payment_context_arg_ptr); + LDKPaymentContext payment_context_arg_conv = *(LDKPaymentContext*)(payment_context_arg_ptr); + payment_context_arg_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(payment_context_arg)); + LDKReceiveTlvs ret_var = ReceiveTlvs_new(payment_secret_arg_ref, payment_constraints_arg_conv, payment_context_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -65744,6 +79754,317 @@ int64_t CS_LDK_PaymentConstraints_clone(int64_t orig) { return ret_ref; } +void CS_LDK_PaymentContext_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKPaymentContext this_ptr_conv = *(LDKPaymentContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentContext_free(this_ptr_conv); +} + +static inline uint64_t PaymentContext_clone_ptr(LDKPaymentContext *NONNULL_PTR arg) { + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_PaymentContext_clone_ptr(int64_t arg) { + LDKPaymentContext* arg_conv = (LDKPaymentContext*)untag_ptr(arg); + int64_t ret_conv = PaymentContext_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PaymentContext_clone(int64_t orig) { + LDKPaymentContext* orig_conv = (LDKPaymentContext*)untag_ptr(orig); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentContext_unknown(int64_t a) { + LDKUnknownPaymentContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = UnknownPaymentContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_unknown(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentContext_bolt12_offer(int64_t a) { + LDKBolt12OfferContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = Bolt12OfferContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_bolt12_offer(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentContext_bolt12_refund(int64_t a) { + LDKBolt12RefundContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = Bolt12RefundContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_bolt12_refund(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_PaymentContext_eq(int64_t a, int64_t b) { + LDKPaymentContext* a_conv = (LDKPaymentContext*)untag_ptr(a); + LDKPaymentContext* b_conv = (LDKPaymentContext*)untag_ptr(b); + jboolean ret_conv = PaymentContext_eq(a_conv, b_conv); + return ret_conv; +} + +void CS_LDK_UnknownPaymentContext_free(int64_t this_obj) { + LDKUnknownPaymentContext this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UnknownPaymentContext_free(this_obj_conv); +} + +static inline uint64_t UnknownPaymentContext_clone_ptr(LDKUnknownPaymentContext *NONNULL_PTR arg) { + LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_UnknownPaymentContext_clone_ptr(int64_t arg) { + LDKUnknownPaymentContext arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = UnknownPaymentContext_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_UnknownPaymentContext_clone(int64_t orig) { + LDKUnknownPaymentContext orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKUnknownPaymentContext ret_var = UnknownPaymentContext_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +jboolean CS_LDK_UnknownPaymentContext_eq(int64_t a, int64_t b) { + LDKUnknownPaymentContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKUnknownPaymentContext b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = UnknownPaymentContext_eq(&a_conv, &b_conv); + return ret_conv; +} + +void CS_LDK_Bolt12OfferContext_free(int64_t this_obj) { + LDKBolt12OfferContext this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12OfferContext_free(this_obj_conv); +} + +int64_t CS_LDK_Bolt12OfferContext_get_offer_id(int64_t this_ptr) { + LDKBolt12OfferContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId ret_var = Bolt12OfferContext_get_offer_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_Bolt12OfferContext_set_offer_id(int64_t this_ptr, int64_t val) { + LDKBolt12OfferContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OfferId_clone(&val_conv); + Bolt12OfferContext_set_offer_id(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_Bolt12OfferContext_get_invoice_request(int64_t this_ptr) { + LDKBolt12OfferContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInvoiceRequestFields ret_var = Bolt12OfferContext_get_invoice_request(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void CS_LDK_Bolt12OfferContext_set_invoice_request(int64_t this_ptr, int64_t val) { + LDKBolt12OfferContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInvoiceRequestFields val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = InvoiceRequestFields_clone(&val_conv); + Bolt12OfferContext_set_invoice_request(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_Bolt12OfferContext_new(int64_t offer_id_arg, int64_t invoice_request_arg) { + LDKOfferId offer_id_arg_conv; + offer_id_arg_conv.inner = untag_ptr(offer_id_arg); + offer_id_arg_conv.is_owned = ptr_is_owned(offer_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_id_arg_conv); + offer_id_arg_conv = OfferId_clone(&offer_id_arg_conv); + LDKInvoiceRequestFields invoice_request_arg_conv; + invoice_request_arg_conv.inner = untag_ptr(invoice_request_arg); + invoice_request_arg_conv.is_owned = ptr_is_owned(invoice_request_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_arg_conv); + invoice_request_arg_conv = InvoiceRequestFields_clone(&invoice_request_arg_conv); + LDKBolt12OfferContext ret_var = Bolt12OfferContext_new(offer_id_arg_conv, invoice_request_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t Bolt12OfferContext_clone_ptr(LDKBolt12OfferContext *NONNULL_PTR arg) { + LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_Bolt12OfferContext_clone_ptr(int64_t arg) { + LDKBolt12OfferContext arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12OfferContext_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_Bolt12OfferContext_clone(int64_t orig) { + LDKBolt12OfferContext orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12OfferContext ret_var = Bolt12OfferContext_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +jboolean CS_LDK_Bolt12OfferContext_eq(int64_t a, int64_t b) { + LDKBolt12OfferContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt12OfferContext b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt12OfferContext_eq(&a_conv, &b_conv); + return ret_conv; +} + +void CS_LDK_Bolt12RefundContext_free(int64_t this_obj) { + LDKBolt12RefundContext this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Bolt12RefundContext_free(this_obj_conv); +} + +int64_t CS_LDK_Bolt12RefundContext_new() { + LDKBolt12RefundContext ret_var = Bolt12RefundContext_new(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t Bolt12RefundContext_clone_ptr(LDKBolt12RefundContext *NONNULL_PTR arg) { + LDKBolt12RefundContext ret_var = Bolt12RefundContext_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +int64_t CS_LDK_Bolt12RefundContext_clone_ptr(int64_t arg) { + LDKBolt12RefundContext arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = Bolt12RefundContext_clone_ptr(&arg_conv); + return ret_conv; +} + +int64_t CS_LDK_Bolt12RefundContext_clone(int64_t orig) { + LDKBolt12RefundContext orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBolt12RefundContext ret_var = Bolt12RefundContext_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +jboolean CS_LDK_Bolt12RefundContext_eq(int64_t a, int64_t b) { + LDKBolt12RefundContext a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBolt12RefundContext b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Bolt12RefundContext_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray CS_LDK_ForwardTlvs_write(int64_t obj) { LDKForwardTlvs obj_conv; obj_conv.inner = untag_ptr(obj); @@ -65770,16 +80091,6 @@ int8_tArray CS_LDK_ReceiveTlvs_write(int64_t obj) { return ret_arr; } -int64_t CS_LDK_ReceiveTlvs_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ReceiveTlvsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReceiveTlvsDecodeErrorZ), "LDKCResult_ReceiveTlvsDecodeErrorZ"); - *ret_conv = ReceiveTlvs_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - int8_tArray CS_LDK_PaymentRelay_write(int64_t obj) { LDKPaymentRelay obj_conv; obj_conv.inner = untag_ptr(obj); @@ -65826,6 +80137,94 @@ int64_t CS_LDK_PaymentConstraints_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_PaymentContext_write(int64_t obj) { + LDKPaymentContext* obj_conv = (LDKPaymentContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentContext_write(obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_PaymentContext_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = PaymentContext_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_UnknownPaymentContext_write(int64_t obj) { + LDKUnknownPaymentContext obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = UnknownPaymentContext_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_UnknownPaymentContext_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = UnknownPaymentContext_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_Bolt12OfferContext_write(int64_t obj) { + LDKBolt12OfferContext obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt12OfferContext_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_Bolt12OfferContext_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = Bolt12OfferContext_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray CS_LDK_Bolt12RefundContext_write(int64_t obj) { + LDKBolt12RefundContext obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = Bolt12RefundContext_write(&obj_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +int64_t CS_LDK_Bolt12RefundContext_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = Bolt12RefundContext_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + void CS_LDK_PaymentPurpose_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -65855,7 +80254,21 @@ int64_t CS_LDK_PaymentPurpose_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_PaymentPurpose_invoice_payment(int64_t payment_preimage, int8_tArray payment_secret) { +int64_t CS_LDK_PaymentPurpose_bolt11_invoice_payment(int64_t payment_preimage, int8_tArray payment_secret) { + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKThirtyTwoBytes payment_secret_ref; + CHECK(payment_secret->arr_len == 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_bolt11_invoice_payment(payment_preimage_conv, payment_secret_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentPurpose_bolt12_offer_payment(int64_t payment_preimage, int8_tArray payment_secret, int64_t payment_context) { void* payment_preimage_ptr = untag_ptr(payment_preimage); CHECK_ACCESS(payment_preimage_ptr); LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); @@ -65863,8 +80276,32 @@ int64_t CS_LDK_PaymentPurpose_invoice_payment(int64_t payment_preimage, int8_tA LDKThirtyTwoBytes payment_secret_ref; CHECK(payment_secret->arr_len == 32); memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKBolt12OfferContext payment_context_conv; + payment_context_conv.inner = untag_ptr(payment_context); + payment_context_conv.is_owned = ptr_is_owned(payment_context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); + payment_context_conv = Bolt12OfferContext_clone(&payment_context_conv); LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_conv, payment_secret_ref); + *ret_copy = PaymentPurpose_bolt12_offer_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentPurpose_bolt12_refund_payment(int64_t payment_preimage, int8_tArray payment_secret, int64_t payment_context) { + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKThirtyTwoBytes payment_secret_ref; + CHECK(payment_secret->arr_len == 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKBolt12RefundContext payment_context_conv; + payment_context_conv.inner = untag_ptr(payment_context); + payment_context_conv.is_owned = ptr_is_owned(payment_context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); + payment_context_conv = Bolt12RefundContext_clone(&payment_context_conv); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_bolt12_refund_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -65886,6 +80323,14 @@ jboolean CS_LDK_PaymentPurpose_eq(int64_t a, int64_t b) { return ret_conv; } +int64_t CS_LDK_PaymentPurpose_preimage(int64_t this_arg) { + LDKPaymentPurpose* this_arg_conv = (LDKPaymentPurpose*)untag_ptr(this_arg); + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = PaymentPurpose_preimage(this_arg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int8_tArray CS_LDK_PaymentPurpose_write(int64_t obj) { LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj); LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); @@ -65913,27 +80358,31 @@ void CS_LDK_ClaimedHTLC_free(int64_t this_obj) { ClaimedHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_ClaimedHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ClaimedHTLC_get_channel_id(int64_t this_ptr) { LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ClaimedHTLC_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ClaimedHTLC_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void CS_LDK_ClaimedHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ClaimedHTLC_set_channel_id(int64_t this_ptr, int64_t val) { LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ClaimedHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId val_conv; + val_conv.inner = untag_ptr(val); + val_conv.is_owned = ptr_is_owned(val); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelId_clone(&val_conv); + ClaimedHTLC_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray CS_LDK_ClaimedHTLC_get_user_channel_id(int64_t this_ptr) { @@ -65997,14 +80446,35 @@ void CS_LDK_ClaimedHTLC_set_value_msat(int64_t this_ptr, int64_t val) { ClaimedHTLC_set_value_msat(&this_ptr_conv, val); } -int64_t CS_LDK_ClaimedHTLC_new(int8_tArray channel_id_arg, int8_tArray user_channel_id_arg, int32_t cltv_expiry_arg, int64_t value_msat_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); +int64_t CS_LDK_ClaimedHTLC_get_counterparty_skimmed_fee_msat(int64_t this_ptr) { + LDKClaimedHTLC this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ClaimedHTLC_get_counterparty_skimmed_fee_msat(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_ClaimedHTLC_set_counterparty_skimmed_fee_msat(int64_t this_ptr, int64_t val) { + LDKClaimedHTLC this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); +} + +int64_t CS_LDK_ClaimedHTLC_new(int64_t channel_id_arg, int8_tArray user_channel_id_arg, int32_t cltv_expiry_arg, int64_t value_msat_arg, int64_t counterparty_skimmed_fee_msat_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKU128 user_channel_id_arg_ref; CHECK(user_channel_id_arg->arr_len == 16); memcpy(user_channel_id_arg_ref.le_bytes, user_channel_id_arg->elems, 16); FREE(user_channel_id_arg); - LDKClaimedHTLC ret_var = ClaimedHTLC_new(channel_id_arg_ref, user_channel_id_arg_ref, cltv_expiry_arg, value_msat_arg); + LDKClaimedHTLC ret_var = ClaimedHTLC_new(channel_id_arg_conv, user_channel_id_arg_ref, cltv_expiry_arg, value_msat_arg, counterparty_skimmed_fee_msat_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -66204,9 +80674,23 @@ int64_t CS_LDK_ClosureReason_holder_force_closed() { return ret_ref; } -int64_t CS_LDK_ClosureReason_cooperative_closure() { +int64_t CS_LDK_ClosureReason_legacy_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_legacy_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ClosureReason_counterparty_initiated_cooperative_closure() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_cooperative_closure(); + *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ClosureReason_locally_initiated_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_locally_initiated_cooperative_closure(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -66261,6 +80745,13 @@ int64_t CS_LDK_ClosureReason_funding_batch_closure() { return ret_ref; } +int64_t CS_LDK_ClosureReason_htlcs_timed_out() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_htlcs_timed_out(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + jboolean CS_LDK_ClosureReason_eq(int64_t a, int64_t b) { LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); @@ -66268,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); @@ -66316,15 +80815,17 @@ int64_t CS_LDK_HTLCDestination_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) { +int64_t CS_LDK_HTLCDestination_next_hop_channel(int8_tArray node_id, int64_t channel_id) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKThirtyTwoBytes channel_id_ref; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref); + *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -66343,6 +80844,13 @@ int64_t CS_LDK_HTLCDestination_invalid_forward(int64_t requested_forward_scid) return ret_ref; } +int64_t CS_LDK_HTLCDestination_invalid_onion() { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_onion(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_HTLCDestination_failed_payment(int8_tArray payment_hash) { LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); @@ -66470,10 +80978,12 @@ int64_t CS_LDK_Event_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_Event_funding_generation_ready(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int8_tArray user_channel_id) { - LDKThirtyTwoBytes temporary_channel_id_ref; - CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id); +int64_t CS_LDK_Event_funding_generation_ready(int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int8_tArray user_channel_id) { + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); @@ -66485,7 +80995,7 @@ int64_t CS_LDK_Event_funding_generation_ready(int8_tArray temporary_channel_id, CHECK(user_channel_id->arr_len == 16); memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id_ref); + *ret_copy = Event_funding_generation_ready(temporary_channel_id_conv, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -66506,10 +81016,11 @@ int64_t CS_LDK_Event_payment_claimable(int8_tArray receiver_node_id, int8_tArra CHECK_ACCESS(purpose_ptr); LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); - void* via_channel_id_ptr = untag_ptr(via_channel_id); - CHECK_ACCESS(via_channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ via_channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(via_channel_id_ptr); - via_channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(via_channel_id)); + LDKChannelId via_channel_id_conv; + via_channel_id_conv.inner = untag_ptr(via_channel_id); + via_channel_id_conv.is_owned = ptr_is_owned(via_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(via_channel_id_conv); + via_channel_id_conv = ChannelId_clone(&via_channel_id_conv); void* via_user_channel_id_ptr = untag_ptr(via_user_channel_id); CHECK_ACCESS(via_user_channel_id_ptr); LDKCOption_U128Z via_user_channel_id_conv = *(LDKCOption_U128Z*)(via_user_channel_id_ptr); @@ -66562,6 +81073,31 @@ int64_t CS_LDK_Event_payment_claimed(int8_tArray receiver_node_id, int8_tArray return ret_ref; } +int64_t CS_LDK_Event_connection_needed(int8_tArray node_id, int64_tArray addresses) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKCVec_SocketAddressZ addresses_constr; + addresses_constr.datalen = addresses->arr_len; + if (addresses_constr.datalen > 0) + addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + addresses_constr.data = NULL; + int64_t* addresses_vals = addresses->elems; + for (size_t p = 0; p < addresses_constr.datalen; p++) { + int64_t addresses_conv_15 = addresses_vals[p]; + void* addresses_conv_15_ptr = untag_ptr(addresses_conv_15); + CHECK_ACCESS(addresses_conv_15_ptr); + LDKSocketAddress addresses_conv_15_conv = *(LDKSocketAddress*)(addresses_conv_15_ptr); + addresses_constr.data[p] = addresses_conv_15_conv; + } + FREE(addresses); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_connection_needed(node_id_ref, addresses_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_Event_invoice_request_failed(int8_tArray payment_id) { LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); @@ -66733,50 +81269,68 @@ int64_t CS_LDK_Event_spendable_outputs(int64_tArray outputs, int64_t channel_id outputs_constr.data[b] = outputs_conv_27_conv; } FREE(outputs); - void* channel_id_ptr = untag_ptr(channel_id); - CHECK_ACCESS(channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(channel_id_ptr); - channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(channel_id)); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_spendable_outputs(outputs_constr, channel_id_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_payment_forwarded(int64_t prev_channel_id, int64_t next_channel_id, int64_t fee_earned_msat, jboolean claim_from_onchain_tx, int64_t outbound_amount_forwarded_msat) { - void* prev_channel_id_ptr = untag_ptr(prev_channel_id); - CHECK_ACCESS(prev_channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ prev_channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(prev_channel_id_ptr); - prev_channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(prev_channel_id)); - void* next_channel_id_ptr = untag_ptr(next_channel_id); - CHECK_ACCESS(next_channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ next_channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(next_channel_id_ptr); - next_channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(next_channel_id)); - void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat); - CHECK_ACCESS(fee_earned_msat_ptr); - LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr); - fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat)); +int64_t CS_LDK_Event_payment_forwarded(int64_t prev_channel_id, int64_t next_channel_id, int64_t prev_user_channel_id, int64_t next_user_channel_id, int64_t total_fee_earned_msat, int64_t skimmed_fee_msat, jboolean claim_from_onchain_tx, int64_t outbound_amount_forwarded_msat) { + LDKChannelId prev_channel_id_conv; + prev_channel_id_conv.inner = untag_ptr(prev_channel_id); + prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); + prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); + LDKChannelId next_channel_id_conv; + next_channel_id_conv.inner = untag_ptr(next_channel_id); + next_channel_id_conv.is_owned = ptr_is_owned(next_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(next_channel_id_conv); + next_channel_id_conv = ChannelId_clone(&next_channel_id_conv); + void* prev_user_channel_id_ptr = untag_ptr(prev_user_channel_id); + CHECK_ACCESS(prev_user_channel_id_ptr); + LDKCOption_U128Z prev_user_channel_id_conv = *(LDKCOption_U128Z*)(prev_user_channel_id_ptr); + prev_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(prev_user_channel_id)); + void* next_user_channel_id_ptr = untag_ptr(next_user_channel_id); + CHECK_ACCESS(next_user_channel_id_ptr); + LDKCOption_U128Z next_user_channel_id_conv = *(LDKCOption_U128Z*)(next_user_channel_id_ptr); + next_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(next_user_channel_id)); + void* total_fee_earned_msat_ptr = untag_ptr(total_fee_earned_msat); + CHECK_ACCESS(total_fee_earned_msat_ptr); + LDKCOption_u64Z total_fee_earned_msat_conv = *(LDKCOption_u64Z*)(total_fee_earned_msat_ptr); + total_fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(total_fee_earned_msat)); + void* skimmed_fee_msat_ptr = untag_ptr(skimmed_fee_msat); + CHECK_ACCESS(skimmed_fee_msat_ptr); + LDKCOption_u64Z skimmed_fee_msat_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_ptr); + skimmed_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat)); void* outbound_amount_forwarded_msat_ptr = untag_ptr(outbound_amount_forwarded_msat); CHECK_ACCESS(outbound_amount_forwarded_msat_ptr); LDKCOption_u64Z outbound_amount_forwarded_msat_conv = *(LDKCOption_u64Z*)(outbound_amount_forwarded_msat_ptr); outbound_amount_forwarded_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_amount_forwarded_msat)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_forwarded(prev_channel_id_conv, next_channel_id_conv, fee_earned_msat_conv, claim_from_onchain_tx, outbound_amount_forwarded_msat_conv); + *ret_copy = Event_payment_forwarded(prev_channel_id_conv, next_channel_id_conv, prev_user_channel_id_conv, next_user_channel_id_conv, total_fee_earned_msat_conv, skimmed_fee_msat_conv, claim_from_onchain_tx, outbound_amount_forwarded_msat_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_channel_pending(int8_tArray channel_id, int8_tArray user_channel_id, int64_t former_temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_txo) { - LDKThirtyTwoBytes channel_id_ref; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); +int64_t CS_LDK_Event_channel_pending(int64_t channel_id, int8_tArray user_channel_id, int64_t former_temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_txo, int64_t channel_type) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); LDKU128 user_channel_id_ref; CHECK(user_channel_id->arr_len == 16); memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - void* former_temporary_channel_id_ptr = untag_ptr(former_temporary_channel_id); - CHECK_ACCESS(former_temporary_channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(former_temporary_channel_id_ptr); - former_temporary_channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(former_temporary_channel_id)); + LDKChannelId former_temporary_channel_id_conv; + former_temporary_channel_id_conv.inner = untag_ptr(former_temporary_channel_id); + former_temporary_channel_id_conv.is_owned = ptr_is_owned(former_temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_conv); + former_temporary_channel_id_conv = ChannelId_clone(&former_temporary_channel_id_conv); LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); @@ -66785,16 +81339,23 @@ int64_t CS_LDK_Event_channel_pending(int8_tArray channel_id, int8_tArray user_c funding_txo_conv.is_owned = ptr_is_owned(funding_txo); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_pending(channel_id_ref, user_channel_id_ref, former_temporary_channel_id_conv, counterparty_node_id_ref, funding_txo_conv); + *ret_copy = Event_channel_pending(channel_id_conv, user_channel_id_ref, former_temporary_channel_id_conv, counterparty_node_id_ref, funding_txo_conv, channel_type_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_channel_ready(int8_tArray channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_t channel_type) { - LDKThirtyTwoBytes channel_id_ref; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); +int64_t CS_LDK_Event_channel_ready(int64_t channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_t channel_type) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); LDKU128 user_channel_id_ref; CHECK(user_channel_id->arr_len == 16); memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); @@ -66807,15 +81368,17 @@ int64_t CS_LDK_Event_channel_ready(int8_tArray channel_id, int8_tArray user_cha CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_ready(channel_id_ref, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); + *ret_copy = Event_channel_ready(channel_id_conv, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_channel_closed(int8_tArray channel_id, int8_tArray user_channel_id, int64_t reason, int8_tArray counterparty_node_id, int64_t channel_capacity_sats) { - LDKThirtyTwoBytes channel_id_ref; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); +int64_t CS_LDK_Event_channel_closed(int64_t channel_id, int8_tArray user_channel_id, int64_t reason, int8_tArray counterparty_node_id, int64_t channel_capacity_sats, int64_t channel_funding_txo) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); LDKU128 user_channel_id_ref; CHECK(user_channel_id->arr_len == 16); memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); @@ -66830,31 +81393,40 @@ int64_t CS_LDK_Event_channel_closed(int8_tArray channel_id, int8_tArray user_ch CHECK_ACCESS(channel_capacity_sats_ptr); LDKCOption_u64Z channel_capacity_sats_conv = *(LDKCOption_u64Z*)(channel_capacity_sats_ptr); channel_capacity_sats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(channel_capacity_sats)); + LDKOutPoint channel_funding_txo_conv; + channel_funding_txo_conv.inner = untag_ptr(channel_funding_txo); + channel_funding_txo_conv.is_owned = ptr_is_owned(channel_funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_txo_conv); + channel_funding_txo_conv = OutPoint_clone(&channel_funding_txo_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id_ref, reason_conv, counterparty_node_id_ref, channel_capacity_sats_conv); + *ret_copy = Event_channel_closed(channel_id_conv, user_channel_id_ref, reason_conv, counterparty_node_id_ref, channel_capacity_sats_conv, channel_funding_txo_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_discard_funding(int8_tArray channel_id, int8_tArray transaction) { - LDKThirtyTwoBytes channel_id_ref; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); +int64_t CS_LDK_Event_discard_funding(int64_t channel_id, int8_tArray transaction) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); LDKTransaction transaction_ref; transaction_ref.datalen = transaction->arr_len; transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); transaction_ref.data_is_owned = true; LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref); + *ret_copy = Event_discard_funding(channel_id_conv, transaction_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_open_channel_request(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_t channel_type) { - LDKThirtyTwoBytes temporary_channel_id_ref; - CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id); +int64_t CS_LDK_Event_open_channel_request(int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_t channel_type) { + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); LDKPublicKey counterparty_node_id_ref; CHECK(counterparty_node_id->arr_len == 33); memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); @@ -66864,21 +81436,23 @@ int64_t CS_LDK_Event_open_channel_request(int8_tArray temporary_channel_id, int CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv); + *ret_copy = Event_open_channel_request(temporary_channel_id_conv, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_htlchandling_failed(int8_tArray prev_channel_id, int64_t failed_next_destination) { - LDKThirtyTwoBytes prev_channel_id_ref; - CHECK(prev_channel_id->arr_len == 32); - memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id); +int64_t CS_LDK_Event_htlchandling_failed(int64_t prev_channel_id, int64_t failed_next_destination) { + LDKChannelId prev_channel_id_conv; + prev_channel_id_conv.inner = untag_ptr(prev_channel_id); + prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); + prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); void* failed_next_destination_ptr = untag_ptr(failed_next_destination); CHECK_ACCESS(failed_next_destination_ptr); LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr); failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv); + *ret_copy = Event_htlchandling_failed(prev_channel_id_conv, failed_next_destination_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -67039,6 +81613,66 @@ int64_t CS_LDK_MessageSendEvent_send_funding_signed(int8_tArray node_id, int64_ return ret_ref; } +int64_t CS_LDK_MessageSendEvent_send_stfu(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKStfu msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = Stfu_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_stfu(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageSendEvent_send_splice(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKSplice msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = Splice_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageSendEvent_send_splice_ack(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKSpliceAck msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = SpliceAck_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_ack(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_MessageSendEvent_send_splice_locked(int8_tArray node_id, int64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKSpliceLocked msg_conv; + msg_conv.inner = untag_ptr(msg); + msg_conv.is_owned = ptr_is_owned(msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = SpliceLocked_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_splice_locked(node_id_ref, msg_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_MessageSendEvent_send_tx_add_input(int8_tArray node_id, int64_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); @@ -67675,7 +82309,15 @@ int64_t CS_LDK_BumpTransactionEvent_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_BumpTransactionEvent_channel_close(int8_tArray claim_id, int32_t package_target_feerate_sat_per_1000_weight, int8_tArray commitment_tx, int64_t commitment_tx_fee_satoshis, int64_t anchor_descriptor, int64_tArray pending_htlcs) { +int64_t CS_LDK_BumpTransactionEvent_channel_close(int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t package_target_feerate_sat_per_1000_weight, int8_tArray commitment_tx, int64_t commitment_tx_fee_satoshis, int64_t anchor_descriptor, int64_tArray pending_htlcs) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); LDKThirtyTwoBytes claim_id_ref; CHECK(claim_id->arr_len == 32); memcpy(claim_id_ref.data, claim_id->elems, 32); FREE(claim_id); @@ -67707,12 +82349,20 @@ int64_t CS_LDK_BumpTransactionEvent_channel_close(int8_tArray claim_id, int32_t } FREE(pending_htlcs); LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_channel_close(claim_id_ref, package_target_feerate_sat_per_1000_weight, commitment_tx_ref, commitment_tx_fee_satoshis, anchor_descriptor_conv, pending_htlcs_constr); + *ret_copy = BumpTransactionEvent_channel_close(channel_id_conv, counterparty_node_id_ref, claim_id_ref, package_target_feerate_sat_per_1000_weight, commitment_tx_ref, commitment_tx_fee_satoshis, anchor_descriptor_conv, pending_htlcs_constr); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_BumpTransactionEvent_htlcresolution(int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, int64_tArray htlc_descriptors, int32_t tx_lock_time) { +int64_t CS_LDK_BumpTransactionEvent_htlcresolution(int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, int64_tArray htlc_descriptors, int32_t tx_lock_time) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKPublicKey counterparty_node_id_ref; + CHECK(counterparty_node_id->arr_len == 33); + memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); LDKThirtyTwoBytes claim_id_ref; CHECK(claim_id->arr_len == 32); memcpy(claim_id_ref.data, claim_id->elems, 32); FREE(claim_id); @@ -67734,7 +82384,7 @@ int64_t CS_LDK_BumpTransactionEvent_htlcresolution(int8_tArray claim_id, int32_ } FREE(htlc_descriptors); LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_htlcresolution(claim_id_ref, target_feerate_sat_per_1000_weight, htlc_descriptors_constr, tx_lock_time); + *ret_copy = BumpTransactionEvent_htlcresolution(channel_id_conv, counterparty_node_id_ref, claim_id_ref, target_feerate_sat_per_1000_weight, htlc_descriptors_constr, tx_lock_time); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -70180,6 +84830,17 @@ int8_tArray CS_LDK_Bolt11Invoice_recover_payee_pub_key(int64_t this_arg) { return ret_arr; } +int8_tArray CS_LDK_Bolt11Invoice_get_payee_pub_key(int64_t this_arg) { + LDKBolt11Invoice this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Bolt11Invoice_get_payee_pub_key(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + int64_t CS_LDK_Bolt11Invoice_expires_at(int64_t this_arg) { LDKBolt11Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -70346,13 +85007,26 @@ int64_t CS_LDK_Description_new(jstring description) { return tag_ptr(ret_conv, true); } -jstring CS_LDK_Description_into_inner(int64_t this_arg) { +int64_t CS_LDK_Description_into_inner(int64_t this_arg) { LDKDescription this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Description_clone(&this_arg_conv); - LDKStr ret_str = Description_into_inner(this_arg_conv); + LDKUntrustedString ret_var = Description_into_inner(this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +jstring CS_LDK_Description_to_str(int64_t o) { + LDKDescription o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv.is_owned = false; + LDKStr ret_str = Description_to_str(&o_conv); jstring ret_conv = str_ref_to_cs(ret_str.chars, ret_str.len); Str_free(ret_str); return ret_conv; @@ -70599,239 +85273,28 @@ jstring CS_LDK_SignOrCreationError_to_str(int64_t o) { return ret_conv; } -int64_t CS_LDK_pay_invoice(int64_t invoice, int64_t retry_strategy, int64_t channelmanager) { +int64_t CS_LDK_payment_parameters_from_zero_amount_invoice(int64_t invoice, int64_t amount_msat) { LDKBolt11Invoice invoice_conv; invoice_conv.inner = untag_ptr(invoice); invoice_conv.is_owned = ptr_is_owned(invoice); CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); invoice_conv.is_owned = false; - 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)); - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - LDKCResult_ThirtyTwoBytesPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentErrorZ), "LDKCResult_ThirtyTwoBytesPaymentErrorZ"); - *ret_conv = pay_invoice(&invoice_conv, retry_strategy_conv, &channelmanager_conv); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = payment_parameters_from_zero_amount_invoice(&invoice_conv, amount_msat); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_pay_invoice_with_id(int64_t invoice, int8_tArray payment_id, int64_t retry_strategy, int64_t channelmanager) { +int64_t CS_LDK_payment_parameters_from_invoice(int64_t invoice) { LDKBolt11Invoice invoice_conv; invoice_conv.inner = untag_ptr(invoice); invoice_conv.is_owned = ptr_is_owned(invoice); CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); invoice_conv.is_owned = false; - 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)); - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); - *ret_conv = pay_invoice_with_id(&invoice_conv, payment_id_ref, retry_strategy_conv, &channelmanager_conv); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = payment_parameters_from_invoice(&invoice_conv); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_pay_zero_value_invoice(int64_t invoice, int64_t amount_msats, int64_t retry_strategy, int64_t channelmanager) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - 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)); - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - LDKCResult_ThirtyTwoBytesPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentErrorZ), "LDKCResult_ThirtyTwoBytesPaymentErrorZ"); - *ret_conv = pay_zero_value_invoice(&invoice_conv, amount_msats, retry_strategy_conv, &channelmanager_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_pay_zero_value_invoice_with_id(int64_t invoice, int64_t amount_msats, int8_tArray payment_id, int64_t retry_strategy, int64_t channelmanager) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - 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)); - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); - *ret_conv = pay_zero_value_invoice_with_id(&invoice_conv, amount_msats, payment_id_ref, retry_strategy_conv, &channelmanager_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_preflight_probe_invoice(int64_t invoice, int64_t channelmanager, int64_t liquidity_limit_multiplier) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* 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_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ"); - *ret_conv = preflight_probe_invoice(&invoice_conv, &channelmanager_conv, liquidity_limit_multiplier_conv); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_preflight_probe_zero_value_invoice(int64_t invoice, int64_t amount_msat, int64_t channelmanager, int64_t liquidity_limit_multiplier) { - LDKBolt11Invoice invoice_conv; - invoice_conv.inner = untag_ptr(invoice); - invoice_conv.is_owned = ptr_is_owned(invoice); - CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); - invoice_conv.is_owned = false; - LDKChannelManager channelmanager_conv; - channelmanager_conv.inner = untag_ptr(channelmanager); - channelmanager_conv.is_owned = ptr_is_owned(channelmanager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); - channelmanager_conv.is_owned = false; - void* 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_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ"); - *ret_conv = preflight_probe_zero_value_invoice(&invoice_conv, amount_msat, &channelmanager_conv, liquidity_limit_multiplier_conv); - return tag_ptr(ret_conv, true); -} - -void CS_LDK_PaymentError_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentError_free(this_ptr_conv); -} - -static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) { - LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); - *ret_copy = PaymentError_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_PaymentError_clone_ptr(int64_t arg) { - LDKPaymentError* arg_conv = (LDKPaymentError*)untag_ptr(arg); - int64_t ret_conv = PaymentError_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_PaymentError_clone(int64_t orig) { - LDKPaymentError* orig_conv = (LDKPaymentError*)untag_ptr(orig); - LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); - *ret_copy = PaymentError_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_PaymentError_invoice(jstring a) { - LDKStr a_conv = str_ref_to_owned_c(a); - LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); - *ret_copy = PaymentError_invoice(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_PaymentError_sending(int32_t a) { - LDKRetryableSendFailure a_conv = LDKRetryableSendFailure_from_cs(a); - LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); - *ret_copy = PaymentError_sending(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -jboolean CS_LDK_PaymentError_eq(int64_t a, int64_t b) { - LDKPaymentError* a_conv = (LDKPaymentError*)untag_ptr(a); - LDKPaymentError* b_conv = (LDKPaymentError*)untag_ptr(b); - jboolean ret_conv = PaymentError_eq(a_conv, b_conv); - return ret_conv; -} - -void CS_LDK_ProbingError_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKProbingError this_ptr_conv = *(LDKProbingError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ProbingError_free(this_ptr_conv); -} - -static inline uint64_t ProbingError_clone_ptr(LDKProbingError *NONNULL_PTR arg) { - LDKProbingError *ret_copy = MALLOC(sizeof(LDKProbingError), "LDKProbingError"); - *ret_copy = ProbingError_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_ProbingError_clone_ptr(int64_t arg) { - LDKProbingError* arg_conv = (LDKProbingError*)untag_ptr(arg); - int64_t ret_conv = ProbingError_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_ProbingError_clone(int64_t orig) { - LDKProbingError* orig_conv = (LDKProbingError*)untag_ptr(orig); - LDKProbingError *ret_copy = MALLOC(sizeof(LDKProbingError), "LDKProbingError"); - *ret_copy = ProbingError_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_ProbingError_invoice(jstring a) { - LDKStr a_conv = str_ref_to_owned_c(a); - LDKProbingError *ret_copy = MALLOC(sizeof(LDKProbingError), "LDKProbingError"); - *ret_copy = ProbingError_invoice(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_ProbingError_sending(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKProbeSendFailure a_conv = *(LDKProbeSendFailure*)(a_ptr); - a_conv = ProbeSendFailure_clone((LDKProbeSendFailure*)untag_ptr(a)); - LDKProbingError *ret_copy = MALLOC(sizeof(LDKProbingError), "LDKProbingError"); - *ret_copy = ProbingError_sending(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -jboolean CS_LDK_ProbingError_eq(int64_t a, int64_t b) { - LDKProbingError* a_conv = (LDKProbingError*)untag_ptr(a); - LDKProbingError* b_conv = (LDKProbingError*)untag_ptr(b); - jboolean ret_conv = ProbingError_eq(a_conv, b_conv); - return ret_conv; -} - int64_t CS_LDK_create_phantom_invoice(int64_t amt_msat, int64_t payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t entropy_source, int64_t node_signer, int64_t logger, int32_t network, int64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) { void* amt_msat_ptr = untag_ptr(amt_msat); CHECK_ACCESS(amt_msat_ptr); @@ -71215,6 +85678,58 @@ jstring CS_LDK_SiPrefix_to_str(int64_t o) { return ret_conv; } +void CS_LDK_GraphSyncError_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKGraphSyncError this_ptr_conv = *(LDKGraphSyncError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + GraphSyncError_free(this_ptr_conv); +} + +static inline uint64_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg) { + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_GraphSyncError_clone_ptr(int64_t arg) { + LDKGraphSyncError* arg_conv = (LDKGraphSyncError*)untag_ptr(arg); + int64_t ret_conv = GraphSyncError_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_GraphSyncError_clone(int64_t orig) { + LDKGraphSyncError* orig_conv = (LDKGraphSyncError*)untag_ptr(orig); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_GraphSyncError_decode_error(int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKDecodeError a_conv = *(LDKDecodeError*)(a_ptr); + a_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(a)); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_decode_error(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_GraphSyncError_lightning_error(int64_t a) { + LDKLightningError a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = LightningError_clone(&a_conv); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_lightning_error(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + void CS_LDK_RapidGossipSync_free(int64_t this_obj) { LDKRapidGossipSync this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -71299,55 +85814,3 @@ jboolean CS_LDK_RapidGossipSync_is_initial_sync_complete(int64_t this_arg) { return ret_conv; } -void CS_LDK_GraphSyncError_free(int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKGraphSyncError this_ptr_conv = *(LDKGraphSyncError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - GraphSyncError_free(this_ptr_conv); -} - -static inline uint64_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg) { - LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); - *ret_copy = GraphSyncError_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t CS_LDK_GraphSyncError_clone_ptr(int64_t arg) { - LDKGraphSyncError* arg_conv = (LDKGraphSyncError*)untag_ptr(arg); - int64_t ret_conv = GraphSyncError_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_GraphSyncError_clone(int64_t orig) { - LDKGraphSyncError* orig_conv = (LDKGraphSyncError*)untag_ptr(orig); - LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); - *ret_copy = GraphSyncError_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_GraphSyncError_decode_error(int64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKDecodeError a_conv = *(LDKDecodeError*)(a_ptr); - a_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(a)); - LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); - *ret_copy = GraphSyncError_decode_error(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_GraphSyncError_lightning_error(int64_t a) { - LDKLightningError a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = LightningError_clone(&a_conv); - LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); - *ret_copy = GraphSyncError_lightning_error(a_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -