From: Matt Corallo Date: Tue, 30 Mar 2021 01:58:56 +0000 (-0400) Subject: Update auto-generated bindings X-Git-Tag: v0.0.98~5^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-java;a=commitdiff_plain;h=c3ae2d6897e5a809459c8d9a72a4b3aa0052c8c8 Update auto-generated bindings --- diff --git a/liblightningjni_debug.so b/liblightningjni_debug.so index bedf57af..a4c9f01c 100755 Binary files a/liblightningjni_debug.so and b/liblightningjni_debug.so differ diff --git a/liblightningjni_release.so b/liblightningjni_release.so index 695e89d5..058c9895 100755 Binary files a/liblightningjni_release.so and b/liblightningjni_release.so differ diff --git a/src/main/java/org/ldk/enums/LDKNetwork.java b/src/main/java/org/ldk/enums/LDKNetwork.java index f764ed6b..8f78e11f 100644 --- a/src/main/java/org/ldk/enums/LDKNetwork.java +++ b/src/main/java/org/ldk/enums/LDKNetwork.java @@ -1,5 +1,8 @@ package org.ldk.enums; +/** + * An enum representing the possible Bitcoin or test networks which we can run on + */ public enum LDKNetwork { LDKNetwork_Bitcoin, LDKNetwork_Testnet, diff --git a/src/main/java/org/ldk/enums/LDKSecp256k1Error.java b/src/main/java/org/ldk/enums/LDKSecp256k1Error.java index 7bfe1415..5ca95793 100644 --- a/src/main/java/org/ldk/enums/LDKSecp256k1Error.java +++ b/src/main/java/org/ldk/enums/LDKSecp256k1Error.java @@ -1,5 +1,8 @@ package org.ldk.enums; +/** + * Represents an error returned from libsecp256k1 during validation of some secp256k1 data + */ public enum LDKSecp256k1Error { LDKSecp256k1Error_IncorrectSignature, LDKSecp256k1Error_InvalidMessage, diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index a414060c..47752cfb 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -52,6 +52,19 @@ public class bindings { public static native boolean LDKCResult_TxCreationKeysErrorZ_result_ok(long arg); public static native long LDKCResult_TxCreationKeysErrorZ_get_ok(long arg); public static native LDKSecp256k1Error LDKCResult_TxCreationKeysErrorZ_get_err(long arg); + public static class LDKCOption_u32Z { + private LDKCOption_u32Z() {} + public final static class Some extends LDKCOption_u32Z { + public int some; + Some(int some) { this.some = some; } + } + public final static class None extends LDKCOption_u32Z { + None() { } + } + static native void init(); + } + static { LDKCOption_u32Z.init(); } + public static native LDKCOption_u32Z LDKCOption_u32Z_ref_from_ptr(long ptr); public static native boolean LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(long arg); @@ -248,6 +261,19 @@ public class bindings { public static native boolean LDKCResult_ChannelConfigDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ChannelConfigDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ChannelConfigDecodeErrorZ_get_err(long arg); + public static class LDKCOption_u64Z { + private LDKCOption_u64Z() {} + public final static class Some extends LDKCOption_u64Z { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_u64Z { + None() { } + } + static native void init(); + } + static { LDKCOption_u64Z.init(); } + public static native LDKCOption_u64Z LDKCOption_u64Z_ref_from_ptr(long ptr); public static native boolean LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_err(long arg); @@ -306,10 +332,12 @@ public class bindings { public static class LDKMonitorEvent { private LDKMonitorEvent() {} public final static class HTLCEvent extends LDKMonitorEvent { - HTLCEvent() { } + public long htlc_event; + HTLCEvent(long htlc_event) { this.htlc_event = htlc_event; } } public final static class CommitmentTxBroadcasted extends LDKMonitorEvent { - CommitmentTxBroadcasted() { } + public long commitment_tx_broadcasted; + CommitmentTxBroadcasted(long commitment_tx_broadcasted) { this.commitment_tx_broadcasted = commitment_tx_broadcasted; } } static native void init(); } @@ -324,10 +352,12 @@ public class bindings { StaticOutput(long outpoint, long output) { this.outpoint = outpoint; this.output = output; } } public final static class DelayedPaymentOutput extends LDKSpendableOutputDescriptor { - DelayedPaymentOutput() { } + public long delayed_payment_output; + DelayedPaymentOutput(long delayed_payment_output) { this.delayed_payment_output = delayed_payment_output; } } public final static class StaticPaymentOutput extends LDKSpendableOutputDescriptor { - StaticPaymentOutput() { } + public long static_payment_output; + StaticPaymentOutput(long static_payment_output) { this.static_payment_output = static_payment_output; } } static native void init(); } @@ -463,6 +493,19 @@ public class bindings { public static native boolean LDKCResult_TxOutAccessErrorZ_result_ok(long arg); public static native long LDKCResult_TxOutAccessErrorZ_get_ok(long arg); public static native LDKAccessError LDKCResult_TxOutAccessErrorZ_get_err(long arg); + public static class LDKCOption_C2Tuple_usizeTransactionZZ { + private LDKCOption_C2Tuple_usizeTransactionZZ() {} + public final static class Some extends LDKCOption_C2Tuple_usizeTransactionZZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_C2Tuple_usizeTransactionZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_C2Tuple_usizeTransactionZZ.init(); } + public static native LDKCOption_C2Tuple_usizeTransactionZZ LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr(long ptr); public static class LDKAPIError { private LDKAPIError() {} public final static class APIMisuseError extends LDKAPIError { @@ -498,16 +541,20 @@ public class bindings { public static class LDKPaymentSendFailure { private LDKPaymentSendFailure() {} public final static class ParameterError extends LDKPaymentSendFailure { - ParameterError() { } + public long parameter_error; + ParameterError(long parameter_error) { this.parameter_error = parameter_error; } } public final static class PathParameterError extends LDKPaymentSendFailure { - PathParameterError() { } + public long[] path_parameter_error; + PathParameterError(long[] path_parameter_error) { this.path_parameter_error = path_parameter_error; } } public final static class AllFailedRetrySafe extends LDKPaymentSendFailure { - AllFailedRetrySafe() { } + public long[] all_failed_retry_safe; + AllFailedRetrySafe(long[] all_failed_retry_safe) { this.all_failed_retry_safe = all_failed_retry_safe; } } public final static class PartialFailure extends LDKPaymentSendFailure { - PartialFailure() { } + public long[] partial_failure; + PartialFailure(long[] partial_failure) { this.partial_failure = partial_failure; } } static native void init(); } @@ -728,13 +775,13 @@ public class bindings { public static native void Listen_block_disconnected(long this_arg, byte[] header, int height); public interface LDKFilter { void register_tx(byte[] txid, byte[] script_pubkey); - void register_output(long outpoint, byte[] script_pubkey); + long register_output(long output); } public static native long LDKFilter_new(LDKFilter impl); // void Filter_register_tx LDKFilter *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey public static native void Filter_register_tx(long this_arg, byte[] txid, byte[] script_pubkey); - // void Filter_register_output LDKFilter *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey - public static native void Filter_register_output(long this_arg, long outpoint, byte[] script_pubkey); + // LDKCOption_C2Tuple_usizeTransactionZZ Filter_register_output LDKFilter *NONNULL_PTR this_arg, struct LDKWatchedOutput output + public static native long Filter_register_output(long this_arg, long output); public interface LDKPersist { long persist_new_channel(long id, long data); long update_persisted_channel(long id, long update, long data); @@ -896,6 +943,14 @@ public class bindings { public static native long CResult_TxCreationKeysErrorZ_err(LDKSecp256k1Error e); // void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res); public static native void CResult_TxCreationKeysErrorZ_free(long _res); + // struct LDKCOption_u32Z COption_u32Z_some(uint32_t o); + public static native long COption_u32Z_some(int o); + // struct LDKCOption_u32Z COption_u32Z_none(void); + public static native long COption_u32Z_none(); + // void COption_u32Z_free(struct LDKCOption_u32Z _res); + public static native void COption_u32Z_free(long _res); + // struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig); + public static native long COption_u32Z_clone(long orig); // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o); public static native long CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(long o); // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e); @@ -1048,6 +1103,14 @@ public class bindings { public static native void CResult_ChannelConfigDecodeErrorZ_free(long _res); // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelConfigDecodeErrorZ_clone(long orig); + // struct LDKCOption_u64Z COption_u64Z_some(uint64_t o); + public static native long COption_u64Z_some(long o); + // struct LDKCOption_u64Z COption_u64Z_none(void); + public static native long COption_u64Z_none(); + // void COption_u64Z_free(struct LDKCOption_u64Z _res); + public static native void COption_u64Z_free(long _res); + // struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); + public static native long COption_u64Z_clone(long orig); // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o); public static native long CResult_DirectionalChannelInfoDecodeErrorZ_ok(long o); // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); @@ -1206,6 +1269,12 @@ public class bindings { public static native void CResult_TxOutAccessErrorZ_free(long _res); // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig); public static native long CResult_TxOutAccessErrorZ_clone(long orig); + // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o); + public static native long COption_C2Tuple_usizeTransactionZZ_some(long o); + // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void); + public static native long COption_C2Tuple_usizeTransactionZZ_none(); + // void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res); + public static native void COption_C2Tuple_usizeTransactionZZ_free(long _res); // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); public static native long CResult_NoneAPIErrorZ_ok(); // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); @@ -1748,6 +1817,22 @@ public class bindings { public static native void Watch_free(long this_ptr); // void Filter_free(struct LDKFilter this_ptr); public static native void Filter_free(long this_ptr); + // void WatchedOutput_free(struct LDKWatchedOutput this_obj); + public static native void WatchedOutput_free(long this_obj); + // struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); + public static native byte[] WatchedOutput_get_block_hash(long this_ptr); + // void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + public static native void WatchedOutput_set_block_hash(long this_ptr, byte[] val); + // struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); + public static native long WatchedOutput_get_outpoint(long this_ptr); + // void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val); + public static native void WatchedOutput_set_outpoint(long this_ptr, long val); + // struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); + public static native byte[] WatchedOutput_get_script_pubkey(long this_ptr); + // void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); + public static native void WatchedOutput_set_script_pubkey(long this_ptr, byte[] val); + // MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg); + public static native long WatchedOutput_new(byte[] block_hash_arg, long outpoint_arg, byte[] script_pubkey_arg); // void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr); public static native void BroadcasterInterface_free(long this_ptr); // enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig); @@ -1998,6 +2083,10 @@ public class bindings { public static native byte[] ChannelDetails_get_channel_id(long this_ptr); // void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void ChannelDetails_set_channel_id(long this_ptr, byte[] val); + // struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + public static native long ChannelDetails_get_short_channel_id(long this_ptr); + // void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void ChannelDetails_set_short_channel_id(long this_ptr, long val); // struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native byte[] ChannelDetails_get_remote_network_id(long this_ptr); // void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val); @@ -3124,6 +3213,12 @@ public class bindings { public static native byte[] HTLCOutputInCommitment_get_payment_hash(long this_ptr); // void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void HTLCOutputInCommitment_set_payment_hash(long this_ptr, byte[] val); + // struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); + public static native long HTLCOutputInCommitment_get_transaction_output_index(long this_ptr); + // void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + public static native void HTLCOutputInCommitment_set_transaction_output_index(long this_ptr, long val); + // MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg); + public static native long HTLCOutputInCommitment_new(boolean offered_arg, long amount_msat_arg, int cltv_expiry_arg, byte[] payment_hash_arg, long transaction_output_index_arg); // struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig); public static native long HTLCOutputInCommitment_clone(long orig); // struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj); @@ -3380,6 +3475,16 @@ public class bindings { public static native short RouteHint_get_cltv_expiry_delta(long this_ptr); // void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val); public static native void RouteHint_set_cltv_expiry_delta(long this_ptr, short val); + // struct LDKCOption_u64Z RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr); + public static native long RouteHint_get_htlc_minimum_msat(long this_ptr); + // void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void RouteHint_set_htlc_minimum_msat(long this_ptr, long val); + // struct LDKCOption_u64Z RouteHint_get_htlc_maximum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr); + public static native long RouteHint_get_htlc_maximum_msat(long this_ptr); + // void RouteHint_set_htlc_maximum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void RouteHint_set_htlc_maximum_msat(long this_ptr, long val); + // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg); + public static native long RouteHint_new(byte[] src_node_id_arg, long short_channel_id_arg, long fees_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg); // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); public static native long RouteHint_clone(long orig); // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger); @@ -3424,6 +3529,10 @@ public class bindings { public static native long DirectionalChannelInfo_get_htlc_minimum_msat(long this_ptr); // void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val); public static native void DirectionalChannelInfo_set_htlc_minimum_msat(long this_ptr, long val); + // struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); + public static native long DirectionalChannelInfo_get_htlc_maximum_msat(long this_ptr); + // void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void DirectionalChannelInfo_set_htlc_maximum_msat(long this_ptr, long val); // struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); public static native long DirectionalChannelInfo_get_fees(long this_ptr); // void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val); @@ -3432,6 +3541,8 @@ public class bindings { public static native long DirectionalChannelInfo_get_last_update_message(long this_ptr); // void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val); public static native void DirectionalChannelInfo_set_last_update_message(long this_ptr, long val); + // MUST_USE_RES struct LDKDirectionalChannelInfo DirectionalChannelInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg); + public static native long DirectionalChannelInfo_new(int last_update_arg, boolean enabled_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, long fees_arg, long last_update_message_arg); // struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig); public static native long DirectionalChannelInfo_clone(long orig); // struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj); @@ -3460,10 +3571,16 @@ public class bindings { public static native long ChannelInfo_get_two_to_one(long this_ptr); // void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val); public static native void ChannelInfo_set_two_to_one(long this_ptr, long val); + // struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr); + public static native long ChannelInfo_get_capacity_sats(long this_ptr); + // void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void ChannelInfo_set_capacity_sats(long this_ptr, long val); // struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr); public static native long ChannelInfo_get_announcement_message(long this_ptr); // void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val); public static native void ChannelInfo_set_announcement_message(long this_ptr, long val); + // MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKPublicKey node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKPublicKey node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg); + public static native long ChannelInfo_new(long features_arg, byte[] node_one_arg, long one_to_two_arg, byte[] node_two_arg, long two_to_one_arg, long capacity_sats_arg, long announcement_message_arg); // struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig); public static native long ChannelInfo_clone(long orig); // struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj); diff --git a/src/main/java/org/ldk/structs/APIError.java b/src/main/java/org/ldk/structs/APIError.java index 6e760fbb..37478865 100644 --- a/src/main/java/org/ldk/structs/APIError.java +++ b/src/main/java/org/ldk/structs/APIError.java @@ -73,4 +73,14 @@ public class APIError extends CommonBase { super(null, ptr); } } + /** + * Creates a copy of the APIError + */ + public APIError clone() { + long ret = bindings.APIError_clone(this.ptr); + APIError ret_hu_conv = APIError.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/ChannelDetails.java b/src/main/java/org/ldk/structs/ChannelDetails.java index 2f34454c..0a2fbb48 100644 --- a/src/main/java/org/ldk/structs/ChannelDetails.java +++ b/src/main/java/org/ldk/structs/ChannelDetails.java @@ -39,6 +39,25 @@ public class ChannelDetails extends CommonBase { bindings.ChannelDetails_set_channel_id(this.ptr, val); } + /** + * The position of the funding transaction in the chain. None if the funding transaction has + * not yet been confirmed and the channel fully opened. + */ + public Option_u64Z get_short_channel_id() { + long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The position of the funding transaction in the chain. None if the funding transaction has + * not yet been confirmed and the channel fully opened. + */ + public void set_short_channel_id(Option_u64Z val) { + bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr); + } + /** * The node_id of our counterparty */ diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index 8206d572..dc995e79 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -103,6 +103,23 @@ public class ChannelInfo extends CommonBase { this.ptrs_to.add(val); } + /** + * The channel capacity as seen on-chain, if chain lookup is available. + */ + public Option_u64Z get_capacity_sats() { + long ret = bindings.ChannelInfo_get_capacity_sats(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The channel capacity as seen on-chain, if chain lookup is available. + */ + public void set_capacity_sats(Option_u64Z val) { + bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr); + } + /** * An initial announcement of the channel * Mostly redundant with the data we store in fields explicitly. @@ -127,6 +144,20 @@ public class ChannelInfo extends CommonBase { this.ptrs_to.add(val); } + /** + * Constructs a new ChannelInfo given each field + */ + public static ChannelInfo constructor_new(ChannelFeatures features_arg, byte[] node_one_arg, DirectionalChannelInfo one_to_two_arg, byte[] node_two_arg, DirectionalChannelInfo two_to_one_arg, Option_u64Z capacity_sats_arg, ChannelAnnouncement announcement_message_arg) { + long ret = bindings.ChannelInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, node_one_arg, one_to_two_arg == null ? 0 : one_to_two_arg.ptr & ~1, node_two_arg, two_to_one_arg == null ? 0 : two_to_one_arg.ptr & ~1, capacity_sats_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1); + ChannelInfo ret_hu_conv = new ChannelInfo(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(features_arg); + ret_hu_conv.ptrs_to.add(one_to_two_arg); + ret_hu_conv.ptrs_to.add(two_to_one_arg); + ret_hu_conv.ptrs_to.add(announcement_message_arg); + return ret_hu_conv; + } + /** * Creates a copy of the ChannelInfo */ diff --git a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java index 5610a704..7352793e 100644 --- a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java +++ b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java @@ -81,6 +81,23 @@ public class DirectionalChannelInfo extends CommonBase { bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val); } + /** + * The maximum value which may be relayed to the next hop via the channel. + */ + public Option_u64Z get_htlc_maximum_msat() { + long ret = bindings.DirectionalChannelInfo_get_htlc_maximum_msat(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The maximum value which may be relayed to the next hop via the channel. + */ + public void set_htlc_maximum_msat(Option_u64Z val) { + bindings.DirectionalChannelInfo_set_htlc_maximum_msat(this.ptr, val.ptr); + } + /** * Fees charged when the channel is used for routing */ @@ -123,6 +140,18 @@ public class DirectionalChannelInfo extends CommonBase { this.ptrs_to.add(val); } + /** + * Constructs a new DirectionalChannelInfo given each field + */ + public static DirectionalChannelInfo constructor_new(int last_update_arg, boolean enabled_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg, RoutingFees fees_arg, ChannelUpdate last_update_message_arg) { + long ret = bindings.DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg.ptr, fees_arg == null ? 0 : fees_arg.ptr & ~1, last_update_message_arg == null ? 0 : last_update_message_arg.ptr & ~1); + DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(fees_arg); + ret_hu_conv.ptrs_to.add(last_update_message_arg); + return ret_hu_conv; + } + /** * Creates a copy of the DirectionalChannelInfo */ diff --git a/src/main/java/org/ldk/structs/ErrorAction.java b/src/main/java/org/ldk/structs/ErrorAction.java index 08f79d46..e553c269 100644 --- a/src/main/java/org/ldk/structs/ErrorAction.java +++ b/src/main/java/org/ldk/structs/ErrorAction.java @@ -56,4 +56,14 @@ public class ErrorAction extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Creates a copy of the ErrorAction + */ + public ErrorAction clone() { + long ret = bindings.ErrorAction_clone(this.ptr); + ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Event.java b/src/main/java/org/ldk/structs/Event.java index 163c7a97..edfa67cd 100644 --- a/src/main/java/org/ldk/structs/Event.java +++ b/src/main/java/org/ldk/structs/Event.java @@ -121,4 +121,22 @@ public class Event extends CommonBase { this.outputs = outputs_conv_27_arr; } } + /** + * Creates a copy of the Event + */ + public Event clone() { + long ret = bindings.Event_clone(this.ptr); + Event ret_hu_conv = Event.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Serialize the Event object into a byte array which can be read by Event_read + */ + public byte[] write() { + byte[] ret = bindings.Event_write(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Filter.java b/src/main/java/org/ldk/structs/Filter.java index 776d95ed..9200d9a1 100644 --- a/src/main/java/org/ldk/structs/Filter.java +++ b/src/main/java/org/ldk/structs/Filter.java @@ -48,10 +48,17 @@ public class Filter extends CommonBase { */ void register_tx(byte[] txid, byte[] script_pubkey); /** - * Registers interest in spends of a transaction output identified by `outpoint` having - * `script_pubkey` as the spending condition. + * Registers interest in spends of a transaction output. + * + * Optionally, when `output.block_hash` is set, should return any transaction spending the + * output that is found in the corresponding block along with its index. + * + * This return value is useful for Electrum clients in order to supply in-block descendant + * transactions which otherwise were not included. This is not necessary for other clients if + * such descendant transactions were already included (e.g., when a BIP 157 client provides the + * full block). */ - void register_output(OutPoint outpoint, byte[] script_pubkey); + Option_C2Tuple_usizeTransactionZZ register_output(WatchedOutput output); } private static class LDKFilterHolder { Filter held; } public static Filter new_impl(FilterInterface arg) { @@ -60,9 +67,12 @@ public class Filter extends CommonBase { @Override public void register_tx(byte[] txid, byte[] script_pubkey) { arg.register_tx(txid, script_pubkey); } - @Override public void register_output(long outpoint, byte[] script_pubkey) { - OutPoint outpoint_hu_conv = new OutPoint(null, outpoint); - arg.register_output(outpoint_hu_conv, script_pubkey); + @Override public long register_output(long output) { + WatchedOutput output_hu_conv = new WatchedOutput(null, output); + output_hu_conv.ptrs_to.add(this); + Option_C2Tuple_usizeTransactionZZ ret = arg.register_output(output_hu_conv); + long result = ret.ptr; + return result; } }); return impl_holder.held; @@ -76,12 +86,22 @@ public class Filter extends CommonBase { } /** - * Registers interest in spends of a transaction output identified by `outpoint` having - * `script_pubkey` as the spending condition. + * Registers interest in spends of a transaction output. + * + * Optionally, when `output.block_hash` is set, should return any transaction spending the + * output that is found in the corresponding block along with its index. + * + * This return value is useful for Electrum clients in order to supply in-block descendant + * transactions which otherwise were not included. This is not necessary for other clients if + * such descendant transactions were already included (e.g., when a BIP 157 client provides the + * full block). */ - public void register_output(OutPoint outpoint, byte[] script_pubkey) { - bindings.Filter_register_output(this.ptr, outpoint == null ? 0 : outpoint.ptr & ~1, script_pubkey); - this.ptrs_to.add(outpoint); + public Option_C2Tuple_usizeTransactionZZ register_output(byte[] output_block_hash_arg, OutPoint output_outpoint_arg, byte[] output_script_pubkey_arg) { + long ret = bindings.Filter_register_output(this.ptr, bindings.WatchedOutput_new(output_block_hash_arg, output_outpoint_arg == null ? 0 : output_outpoint_arg.ptr & ~1, output_script_pubkey_arg)); + Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + ret_hu_conv.ptrs_to.add(output_outpoint_arg); + return ret_hu_conv; } } diff --git a/src/main/java/org/ldk/structs/HTLCFailChannelUpdate.java b/src/main/java/org/ldk/structs/HTLCFailChannelUpdate.java index 86388930..7ce939f9 100644 --- a/src/main/java/org/ldk/structs/HTLCFailChannelUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCFailChannelUpdate.java @@ -61,4 +61,14 @@ public class HTLCFailChannelUpdate extends CommonBase { this.is_permanent = obj.is_permanent; } } + /** + * Creates a copy of the HTLCFailChannelUpdate + */ + public HTLCFailChannelUpdate clone() { + long ret = bindings.HTLCFailChannelUpdate_clone(this.ptr); + HTLCFailChannelUpdate ret_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java index 0f47affa..52dd0cae 100644 --- a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java +++ b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java @@ -86,6 +86,37 @@ public class HTLCOutputInCommitment extends CommonBase { bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val); } + /** + * The position within the commitment transactions' outputs. This may be None if the value is + * below the dust limit (in which case no output appears in the commitment transaction and the + * value is spent to additional transaction fees). + */ + public Option_u32Z get_transaction_output_index() { + long ret = bindings.HTLCOutputInCommitment_get_transaction_output_index(this.ptr); + Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The position within the commitment transactions' outputs. This may be None if the value is + * below the dust limit (in which case no output appears in the commitment transaction and the + * value is spent to additional transaction fees). + */ + public void set_transaction_output_index(Option_u32Z val) { + bindings.HTLCOutputInCommitment_set_transaction_output_index(this.ptr, val.ptr); + } + + /** + * Constructs a new HTLCOutputInCommitment given each field + */ + public static HTLCOutputInCommitment constructor_new(boolean offered_arg, long amount_msat_arg, int cltv_expiry_arg, byte[] payment_hash_arg, Option_u32Z transaction_output_index_arg) { + long ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg, transaction_output_index_arg.ptr); + HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + /** * Creates a copy of the HTLCOutputInCommitment */ diff --git a/src/main/java/org/ldk/structs/MessageSendEvent.java b/src/main/java/org/ldk/structs/MessageSendEvent.java index 36e816f8..e1a703df 100644 --- a/src/main/java/org/ldk/structs/MessageSendEvent.java +++ b/src/main/java/org/ldk/structs/MessageSendEvent.java @@ -306,4 +306,14 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Creates a copy of the MessageSendEvent + */ + public MessageSendEvent clone() { + long ret = bindings.MessageSendEvent_clone(this.ptr); + MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/MonitorEvent.java b/src/main/java/org/ldk/structs/MonitorEvent.java index e3af020d..68421e71 100644 --- a/src/main/java/org/ldk/structs/MonitorEvent.java +++ b/src/main/java/org/ldk/structs/MonitorEvent.java @@ -29,13 +29,33 @@ public class MonitorEvent extends CommonBase { } public final static class HTLCEvent extends MonitorEvent { + public final HTLCUpdate htlc_event; private HTLCEvent(long ptr, bindings.LDKMonitorEvent.HTLCEvent obj) { super(null, ptr); + long htlc_event = obj.htlc_event; + HTLCUpdate htlc_event_hu_conv = new HTLCUpdate(null, htlc_event); + htlc_event_hu_conv.ptrs_to.add(this); + this.htlc_event = htlc_event_hu_conv; } } public final static class CommitmentTxBroadcasted extends MonitorEvent { + public final OutPoint commitment_tx_broadcasted; private CommitmentTxBroadcasted(long ptr, bindings.LDKMonitorEvent.CommitmentTxBroadcasted obj) { super(null, ptr); + long commitment_tx_broadcasted = obj.commitment_tx_broadcasted; + OutPoint commitment_tx_broadcasted_hu_conv = new OutPoint(null, commitment_tx_broadcasted); + commitment_tx_broadcasted_hu_conv.ptrs_to.add(this); + this.commitment_tx_broadcasted = commitment_tx_broadcasted_hu_conv; } } + /** + * Creates a copy of the MonitorEvent + */ + public MonitorEvent clone() { + long ret = bindings.MonitorEvent_clone(this.ptr); + MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/NetAddress.java b/src/main/java/org/ldk/structs/NetAddress.java index 2cde093a..646489eb 100644 --- a/src/main/java/org/ldk/structs/NetAddress.java +++ b/src/main/java/org/ldk/structs/NetAddress.java @@ -74,4 +74,22 @@ public class NetAddress extends CommonBase { this.port = obj.port; } } + /** + * Creates a copy of the NetAddress + */ + public NetAddress clone() { + long ret = bindings.NetAddress_clone(this.ptr); + NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Serialize the NetAddress object into a byte array which can be read by NetAddress_read + */ + public byte[] write() { + byte[] ret = bindings.NetAddress_write(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java new file mode 100644 index 00000000..64379719 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java @@ -0,0 +1,69 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + + +/** + * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_C2Tuple_usizeTransactionZZ extends CommonBase { + private Option_C2Tuple_usizeTransactionZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_C2Tuple_usizeTransactionZZ_free(ptr); } + } + static Option_C2Tuple_usizeTransactionZZ constr_from_ptr(long ptr) { + bindings.LDKCOption_C2Tuple_usizeTransactionZZ raw_val = bindings.LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_usizeTransactionZZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_C2Tuple_usizeTransactionZZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_C2Tuple_usizeTransactionZZ.None.class) { + return new None(ptr, (bindings.LDKCOption_C2Tuple_usizeTransactionZZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + public final static class Some extends Option_C2Tuple_usizeTransactionZZ { + public final TwoTuple some; + private Some(long ptr, bindings.LDKCOption_C2Tuple_usizeTransactionZZ.Some obj) { + super(null, ptr); + long some = obj.some; + long some_a = bindings.LDKC2Tuple_usizeTransactionZ_get_a(some); + byte[] some_b = bindings.LDKC2Tuple_usizeTransactionZ_get_b(some); + TwoTuple some_conv = new TwoTuple(some_a, some_b, () -> { + bindings.C2Tuple_usizeTransactionZ_free(some); + }); + this.some = some_conv; + } + } + public final static class None extends Option_C2Tuple_usizeTransactionZZ { + private None(long ptr, bindings.LDKCOption_C2Tuple_usizeTransactionZZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ + */ + public static Option_C2Tuple_usizeTransactionZZ constructor_some(TwoTuple o) { + long ret = bindings.COption_C2Tuple_usizeTransactionZZ_some(bindings.C2Tuple_usizeTransactionZ_new(o.a, o.b)); + Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing + */ + public static Option_C2Tuple_usizeTransactionZZ constructor_none() { + long ret = bindings.COption_C2Tuple_usizeTransactionZZ_none(); + Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_u32Z.java b/src/main/java/org/ldk/structs/Option_u32Z.java new file mode 100644 index 00000000..f507498f --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_u32Z.java @@ -0,0 +1,74 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + + +/** + * An enum which can either contain a u32 or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_u32Z extends CommonBase { + private Option_u32Z(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_u32Z_free(ptr); } + } + static Option_u32Z constr_from_ptr(long ptr) { + bindings.LDKCOption_u32Z raw_val = bindings.LDKCOption_u32Z_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_u32Z.Some.class) { + return new Some(ptr, (bindings.LDKCOption_u32Z.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_u32Z.None.class) { + return new None(ptr, (bindings.LDKCOption_u32Z.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + public final static class Some extends Option_u32Z { + public final int some; + private Some(long ptr, bindings.LDKCOption_u32Z.Some obj) { + super(null, ptr); + this.some = obj.some; + } + } + public final static class None extends Option_u32Z { + private None(long ptr, bindings.LDKCOption_u32Z.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_u32Z containing a u32 + */ + public static Option_u32Z constructor_some(int o) { + long ret = bindings.COption_u32Z_some(o); + Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Constructs a new COption_u32Z containing nothing + */ + public static Option_u32Z constructor_none() { + long ret = bindings.COption_u32Z_none(); + Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Creates a new COption_u32Z which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_u32Z clone() { + long ret = bindings.COption_u32Z_clone(this.ptr); + Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_u64Z.java b/src/main/java/org/ldk/structs/Option_u64Z.java new file mode 100644 index 00000000..5bc5b6c3 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_u64Z.java @@ -0,0 +1,74 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + + +/** + * An enum which can either contain a u64 or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_u64Z extends CommonBase { + private Option_u64Z(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_u64Z_free(ptr); } + } + static Option_u64Z constr_from_ptr(long ptr) { + bindings.LDKCOption_u64Z raw_val = bindings.LDKCOption_u64Z_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_u64Z.Some.class) { + return new Some(ptr, (bindings.LDKCOption_u64Z.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_u64Z.None.class) { + return new None(ptr, (bindings.LDKCOption_u64Z.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + public final static class Some extends Option_u64Z { + public final long some; + private Some(long ptr, bindings.LDKCOption_u64Z.Some obj) { + super(null, ptr); + this.some = obj.some; + } + } + public final static class None extends Option_u64Z { + private None(long ptr, bindings.LDKCOption_u64Z.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_u64Z containing a u64 + */ + public static Option_u64Z constructor_some(long o) { + long ret = bindings.COption_u64Z_some(o); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Constructs a new COption_u64Z containing nothing + */ + public static Option_u64Z constructor_none() { + long ret = bindings.COption_u64Z_none(); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Creates a new COption_u64Z which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_u64Z clone() { + long ret = bindings.COption_u64Z_clone(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/PaymentSendFailure.java b/src/main/java/org/ldk/structs/PaymentSendFailure.java index b329a413..4e9bb149 100644 --- a/src/main/java/org/ldk/structs/PaymentSendFailure.java +++ b/src/main/java/org/ldk/structs/PaymentSendFailure.java @@ -37,23 +37,66 @@ public class PaymentSendFailure extends CommonBase { } public final static class ParameterError extends PaymentSendFailure { + public final APIError parameter_error; private ParameterError(long ptr, bindings.LDKPaymentSendFailure.ParameterError obj) { super(null, ptr); + long parameter_error = obj.parameter_error; + APIError parameter_error_hu_conv = APIError.constr_from_ptr(parameter_error); + parameter_error_hu_conv.ptrs_to.add(this); + this.parameter_error = parameter_error_hu_conv; } } public final static class PathParameterError extends PaymentSendFailure { + public final Result_NoneAPIErrorZ[] path_parameter_error; private PathParameterError(long ptr, bindings.LDKPaymentSendFailure.PathParameterError obj) { super(null, ptr); + long[] path_parameter_error = obj.path_parameter_error; + Result_NoneAPIErrorZ[] path_parameter_error_conv_22_arr = new Result_NoneAPIErrorZ[path_parameter_error.length]; + for (int w = 0; w < path_parameter_error.length; w++) { + long path_parameter_error_conv_22 = path_parameter_error[w]; + Result_NoneAPIErrorZ path_parameter_error_conv_22_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(path_parameter_error_conv_22); + path_parameter_error_conv_22_arr[w] = path_parameter_error_conv_22_hu_conv; + } + this.path_parameter_error = path_parameter_error_conv_22_arr; } } public final static class AllFailedRetrySafe extends PaymentSendFailure { + public final APIError[] all_failed_retry_safe; private AllFailedRetrySafe(long ptr, bindings.LDKPaymentSendFailure.AllFailedRetrySafe obj) { super(null, ptr); + long[] all_failed_retry_safe = obj.all_failed_retry_safe; + APIError[] all_failed_retry_safe_conv_10_arr = new APIError[all_failed_retry_safe.length]; + for (int k = 0; k < all_failed_retry_safe.length; k++) { + long all_failed_retry_safe_conv_10 = all_failed_retry_safe[k]; + APIError all_failed_retry_safe_conv_10_hu_conv = APIError.constr_from_ptr(all_failed_retry_safe_conv_10); + all_failed_retry_safe_conv_10_hu_conv.ptrs_to.add(this); + all_failed_retry_safe_conv_10_arr[k] = all_failed_retry_safe_conv_10_hu_conv; + } + this.all_failed_retry_safe = all_failed_retry_safe_conv_10_arr; } } public final static class PartialFailure extends PaymentSendFailure { + public final Result_NoneAPIErrorZ[] partial_failure; private PartialFailure(long ptr, bindings.LDKPaymentSendFailure.PartialFailure obj) { super(null, ptr); + long[] partial_failure = obj.partial_failure; + Result_NoneAPIErrorZ[] partial_failure_conv_22_arr = new Result_NoneAPIErrorZ[partial_failure.length]; + for (int w = 0; w < partial_failure.length; w++) { + long partial_failure_conv_22 = partial_failure[w]; + Result_NoneAPIErrorZ partial_failure_conv_22_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(partial_failure_conv_22); + partial_failure_conv_22_arr[w] = partial_failure_conv_22_hu_conv; + } + this.partial_failure = partial_failure_conv_22_arr; } } + /** + * Creates a copy of the PaymentSendFailure + */ + public PaymentSendFailure clone() { + long ret = bindings.PaymentSendFailure_clone(this.ptr); + PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java index 88b43652..e8350c1a 100644 --- a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_AcceptChannelDecodeErrorZ_OK(AcceptChannel res) { - this(null, bindings.CResult_AcceptChannelDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_AcceptChannelDecodeErrorZ_Err extends Result_AcceptChannelDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_AcceptChannelDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_AcceptChannelDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state. + */ + public static Result_AcceptChannelDecodeErrorZ constructor_ok(AcceptChannel o) { + long ret = bindings.CResult_AcceptChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state. + */ + public static Result_AcceptChannelDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_AcceptChannelDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_AcceptChannelDecodeErrorZ clone() { + long ret = bindings.CResult_AcceptChannelDecodeErrorZ_clone(this.ptr); + Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java index ade276c5..005d78f5 100644 --- a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_AnnouncementSignaturesDecodeErrorZ_OK(AnnouncementSignatures res) { - this(null, bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_AnnouncementSignaturesDecodeErrorZ_Err extends Result_AnnouncementSignaturesDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_AnnouncementSignaturesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state. + */ + public static Result_AnnouncementSignaturesDecodeErrorZ constructor_ok(AnnouncementSignatures o) { + long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state. + */ + public static Result_AnnouncementSignaturesDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_AnnouncementSignaturesDecodeErrorZ clone() { + long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_clone(this.ptr); + Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java index 67492b6e..12f9ec7f 100644 --- a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_BuiltCommitmentTransactionDecodeErrorZ_OK(BuiltCommitmentTransaction res) { - this(null, bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_BuiltCommitmentTransactionDecodeErrorZ_Err extends Result_BuiltCommitmentTransactionDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_BuiltCommitmentTransactionDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state. + */ + public static Result_BuiltCommitmentTransactionDecodeErrorZ constructor_ok(BuiltCommitmentTransaction o) { + long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state. + */ + public static Result_BuiltCommitmentTransactionDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BuiltCommitmentTransactionDecodeErrorZ clone() { + long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(this.ptr); + Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java index 7f680d63..9bf23f7c 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java @@ -33,18 +33,6 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB res_b_hu_conv.ptrs_to.add(res_conv); this.res = res_conv; } - public Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(TwoTuple res) { - this(null, bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelManagerZ_new(res.a, res.b == null ? 0 : res.b.ptr & ~1))); - this.ptrs_to.add(res.b); - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid this being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after this call, res.b is reset to null and is now a dummy object. - res.b.ptr = 0; - } } public static final class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err extends Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { @@ -56,9 +44,34 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state. + */ + public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constructor_ok(TwoTuple o) { + long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelManagerZ_new(o.a, o.b == null ? 0 : o.b.ptr & ~1)); + Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o.b); + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o.b is reset to null and is now a dummy object. + o.b.ptr = 0; + return ret_hu_conv; + } + + /** + * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state. + */ + public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java index 957c031f..21a80826 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java @@ -33,10 +33,6 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB res_b_hu_conv.ptrs_to.add(res_conv); this.res = res_conv; } - public Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(TwoTuple res) { - this(null, bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelMonitorZ_new(res.a, res.b == null ? 0 : res.b.ptr & ~1))); - this.ptrs_to.add(res.b); - } } public static final class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err extends Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { @@ -48,9 +44,26 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state. + */ + public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constructor_ok(TwoTuple o) { + long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelMonitorZ_new(o.a, o.b == null ? 0 : o.b.ptr & ~1)); + Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o.b); + return ret_hu_conv; + } + + /** + * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state. + */ + public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java index 36b1f356..3a328ffd 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java @@ -30,17 +30,40 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { }); this.res = res_conv; } - public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_OK(TwoTuple res) { - this(null, bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(bindings.C2Tuple_SignatureCVec_SignatureZZ_new(res.a, res.b))); - } } public static final class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err extends Result_C2Tuple_SignatureCVec_SignatureZZNoneZ { private Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err() { - this(null, bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err()); - } } + + /** + * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state. + */ + public static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ constructor_ok(TwoTuple o) { + long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(bindings.C2Tuple_SignatureCVec_SignatureZZ_new(o.a, o.b)); + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state. + */ + public static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ constructor_err() { + long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ clone() { + long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(this.ptr); + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java index 8d9cee24..45e9b3e5 100644 --- a/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java @@ -26,9 +26,6 @@ public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase { Result_NetAddressu8Z res_hu_conv = Result_NetAddressu8Z.constr_from_ptr(res); this.res = res_hu_conv; } - public Result_CResult_NetAddressu8ZDecodeErrorZ_OK(Result_NetAddressu8Z res) { - this(null, bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(res != null ? res.ptr : 0)); - } } public static final class Result_CResult_NetAddressu8ZDecodeErrorZ_Err extends Result_CResult_NetAddressu8ZDecodeErrorZ { @@ -40,9 +37,35 @@ public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CResult_NetAddressu8ZDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state. + */ + public static Result_CResult_NetAddressu8ZDecodeErrorZ constructor_ok(Result_NetAddressu8Z o) { + long ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o != null ? o.ptr : 0); + Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state. + */ + public static Result_CResult_NetAddressu8ZDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CResult_NetAddressu8ZDecodeErrorZ clone() { + long ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(this.ptr); + Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java b/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java index 768260be..c76b6396 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java @@ -24,17 +24,40 @@ public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(ptr); } - public Result_CVec_CVec_u8ZZNoneZ_OK(byte[][] res) { - this(null, bindings.CResult_CVec_CVec_u8ZZNoneZ_ok(res)); - } } public static final class Result_CVec_CVec_u8ZZNoneZ_Err extends Result_CVec_CVec_u8ZZNoneZ { private Result_CVec_CVec_u8ZZNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_CVec_CVec_u8ZZNoneZ_Err() { - this(null, bindings.CResult_CVec_CVec_u8ZZNoneZ_err()); - } } + + /** + * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state. + */ + public static Result_CVec_CVec_u8ZZNoneZ constructor_ok(byte[][] o) { + long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_ok(o); + Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state. + */ + public static Result_CVec_CVec_u8ZZNoneZ constructor_err() { + long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_err(); + Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CVec_CVec_u8ZZNoneZ clone() { + long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_clone(this.ptr); + Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java b/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java index b0b5b5b2..abd6c189 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java @@ -24,17 +24,40 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_CVec_SignatureZNoneZ_get_ok(ptr); } - public Result_CVec_SignatureZNoneZ_OK(byte[][] res) { - this(null, bindings.CResult_CVec_SignatureZNoneZ_ok(res)); - } } public static final class Result_CVec_SignatureZNoneZ_Err extends Result_CVec_SignatureZNoneZ { private Result_CVec_SignatureZNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_CVec_SignatureZNoneZ_Err() { - this(null, bindings.CResult_CVec_SignatureZNoneZ_err()); - } } + + /** + * Creates a new CResult_CVec_SignatureZNoneZ in the success state. + */ + public static Result_CVec_SignatureZNoneZ constructor_ok(byte[][] o) { + long ret = bindings.CResult_CVec_SignatureZNoneZ_ok(o); + Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_SignatureZNoneZ in the error state. + */ + public static Result_CVec_SignatureZNoneZ constructor_err() { + long ret = bindings.CResult_CVec_SignatureZNoneZ_err(); + Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CVec_SignatureZNoneZ clone() { + long ret = bindings.CResult_CVec_SignatureZNoneZ_clone(this.ptr); + Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java index f63dc357..e99cccb6 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java @@ -24,9 +24,6 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(ptr); } - public Result_CVec_u8ZPeerHandleErrorZ_OK(byte[] res) { - this(null, bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(res)); - } } public static final class Result_CVec_u8ZPeerHandleErrorZ_Err extends Result_CVec_u8ZPeerHandleErrorZ { @@ -38,9 +35,35 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CVec_u8ZPeerHandleErrorZ_Err(PeerHandleError err) { - this(null, bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state. + */ + public static Result_CVec_u8ZPeerHandleErrorZ constructor_ok(byte[] o) { + long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(o); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state. + */ + public static Result_CVec_u8ZPeerHandleErrorZ constructor_err(PeerHandleError e) { + long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CVec_u8ZPeerHandleErrorZ clone() { + long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone(this.ptr); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java index 696d2ab9..2ad97283 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelAnnouncementDecodeErrorZ_OK(ChannelAnnouncement res) { - this(null, bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelAnnouncementDecodeErrorZ_Err extends Result_ChannelAnnouncementDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelAnnouncementDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state. + */ + public static Result_ChannelAnnouncementDecodeErrorZ constructor_ok(ChannelAnnouncement o) { + long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state. + */ + public static Result_ChannelAnnouncementDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelAnnouncementDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_clone(this.ptr); + Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java index d60374a9..344753d6 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelConfigDecodeErrorZ_OK(ChannelConfig res) { - this(null, bindings.CResult_ChannelConfigDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelConfigDecodeErrorZ_Err extends Result_ChannelConfigDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelConfigDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelConfigDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state. + */ + public static Result_ChannelConfigDecodeErrorZ constructor_ok(ChannelConfig o) { + long ret = bindings.CResult_ChannelConfigDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state. + */ + public static Result_ChannelConfigDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ChannelConfigDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelConfigDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelConfigDecodeErrorZ_clone(this.ptr); + Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java index 27c90ecb..5b28e953 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelFeaturesDecodeErrorZ_OK(ChannelFeatures res) { - this(null, bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelFeaturesDecodeErrorZ_Err extends Result_ChannelFeaturesDecodeErrorZ { @@ -42,9 +38,26 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelFeaturesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state. + */ + public static Result_ChannelFeaturesDecodeErrorZ constructor_ok(ChannelFeatures o) { + long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state. + */ + public static Result_ChannelFeaturesDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java index ad262d11..185fed3d 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelInfoDecodeErrorZ_OK(ChannelInfo res) { - this(null, bindings.CResult_ChannelInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelInfoDecodeErrorZ_Err extends Result_ChannelInfoDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelInfoDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state. + */ + public static Result_ChannelInfoDecodeErrorZ constructor_ok(ChannelInfo o) { + long ret = bindings.CResult_ChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state. + */ + public static Result_ChannelInfoDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ChannelInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelInfoDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelInfoDecodeErrorZ_clone(this.ptr); + Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java index 3b7b6799..ae5990ef 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelMonitorUpdateDecodeErrorZ_OK(ChannelMonitorUpdate res) { - this(null, bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelMonitorUpdateDecodeErrorZ_Err extends Result_ChannelMonitorUpdateDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelMonitorUpdateDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state. + */ + public static Result_ChannelMonitorUpdateDecodeErrorZ constructor_ok(ChannelMonitorUpdate o) { + long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state. + */ + public static Result_ChannelMonitorUpdateDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelMonitorUpdateDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_clone(this.ptr); + Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java index 09020f0d..a237bc89 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelPublicKeysDecodeErrorZ_OK(ChannelPublicKeys res) { - this(null, bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelPublicKeysDecodeErrorZ_Err extends Result_ChannelPublicKeysDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelPublicKeysDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state. + */ + public static Result_ChannelPublicKeysDecodeErrorZ constructor_ok(ChannelPublicKeys o) { + long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state. + */ + public static Result_ChannelPublicKeysDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelPublicKeysDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_clone(this.ptr); + Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java index 3b3101da..2cd99993 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelReestablishDecodeErrorZ_OK(ChannelReestablish res) { - this(null, bindings.CResult_ChannelReestablishDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelReestablishDecodeErrorZ_Err extends Result_ChannelReestablishDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelReestablishDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelReestablishDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state. + */ + public static Result_ChannelReestablishDecodeErrorZ constructor_ok(ChannelReestablish o) { + long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state. + */ + public static Result_ChannelReestablishDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelReestablishDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_clone(this.ptr); + Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java index c37b5862..d61fb39f 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelTransactionParametersDecodeErrorZ_OK(ChannelTransactionParameters res) { - this(null, bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelTransactionParametersDecodeErrorZ_Err extends Result_ChannelTransactionParametersDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelTransactionParametersDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state. + */ + public static Result_ChannelTransactionParametersDecodeErrorZ constructor_ok(ChannelTransactionParameters o) { + long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state. + */ + public static Result_ChannelTransactionParametersDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelTransactionParametersDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_clone(this.ptr); + Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java index 1a793687..c9a36447 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelUpdateDecodeErrorZ_OK(ChannelUpdate res) { - this(null, bindings.CResult_ChannelUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelUpdateDecodeErrorZ_Err extends Result_ChannelUpdateDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelUpdateDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state. + */ + public static Result_ChannelUpdateDecodeErrorZ constructor_ok(ChannelUpdate o) { + long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state. + */ + public static Result_ChannelUpdateDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelUpdateDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_clone(this.ptr); + Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java index 1487c9f1..83d1b291 100644 --- a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ClosingSignedDecodeErrorZ_OK(ClosingSigned res) { - this(null, bindings.CResult_ClosingSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ClosingSignedDecodeErrorZ_Err extends Result_ClosingSignedDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ClosingSignedDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ClosingSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state. + */ + public static Result_ClosingSignedDecodeErrorZ constructor_ok(ClosingSigned o) { + long ret = bindings.CResult_ClosingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state. + */ + public static Result_ClosingSignedDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ClosingSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ClosingSignedDecodeErrorZ clone() { + long ret = bindings.CResult_ClosingSignedDecodeErrorZ_clone(this.ptr); + Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java index 1bb9e9dd..e1c773c1 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_CommitmentSignedDecodeErrorZ_OK(CommitmentSigned res) { - this(null, bindings.CResult_CommitmentSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_CommitmentSignedDecodeErrorZ_Err extends Result_CommitmentSignedDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CommitmentSignedDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_CommitmentSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state. + */ + public static Result_CommitmentSignedDecodeErrorZ constructor_ok(CommitmentSigned o) { + long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state. + */ + public static Result_CommitmentSignedDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CommitmentSignedDecodeErrorZ clone() { + long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_clone(this.ptr); + Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java index 7243885f..16bf650d 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_CommitmentTransactionDecodeErrorZ_OK(CommitmentTransaction res) { - this(null, bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_CommitmentTransactionDecodeErrorZ_Err extends Result_CommitmentTransactionDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CommitmentTransactionDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_CommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state. + */ + public static Result_CommitmentTransactionDecodeErrorZ constructor_ok(CommitmentTransaction o) { + long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state. + */ + public static Result_CommitmentTransactionDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CommitmentTransactionDecodeErrorZ clone() { + long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_clone(this.ptr); + Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java index 02c8d680..54ec438a 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(CounterpartyChannelTransactionParameters res) { - this(null, bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err extends Result_CounterpartyChannelTransactionParametersDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state. + */ + public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ constructor_ok(CounterpartyChannelTransactionParameters o) { + long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state. + */ + public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_CounterpartyChannelTransactionParametersDecodeErrorZ clone() { + long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(this.ptr); + Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java index 72ec37c7..46ef11fa 100644 --- a/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_DirectionalChannelInfoDecodeErrorZ_OK(DirectionalChannelInfo res) { - this(null, bindings.CResult_DirectionalChannelInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_DirectionalChannelInfoDecodeErrorZ_Err extends Result_DirectionalChannelInfoDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_DirectionalChannelInfoDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_DirectionalChannelInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state. + */ + public static Result_DirectionalChannelInfoDecodeErrorZ constructor_ok(DirectionalChannelInfo o) { + long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state. + */ + public static Result_DirectionalChannelInfoDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_DirectionalChannelInfoDecodeErrorZ clone() { + long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_clone(this.ptr); + Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java index 71efe0fc..a9241b73 100644 --- a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ErrorMessageDecodeErrorZ_OK(ErrorMessage res) { - this(null, bindings.CResult_ErrorMessageDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ErrorMessageDecodeErrorZ_Err extends Result_ErrorMessageDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ErrorMessageDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ErrorMessageDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state. + */ + public static Result_ErrorMessageDecodeErrorZ constructor_ok(ErrorMessage o) { + long ret = bindings.CResult_ErrorMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state. + */ + public static Result_ErrorMessageDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ErrorMessageDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ErrorMessageDecodeErrorZ clone() { + long ret = bindings.CResult_ErrorMessageDecodeErrorZ_clone(this.ptr); + Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java index 9c39d4cc..6704ba06 100644 --- a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_FundingCreatedDecodeErrorZ_OK(FundingCreated res) { - this(null, bindings.CResult_FundingCreatedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_FundingCreatedDecodeErrorZ_Err extends Result_FundingCreatedDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_FundingCreatedDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_FundingCreatedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state. + */ + public static Result_FundingCreatedDecodeErrorZ constructor_ok(FundingCreated o) { + long ret = bindings.CResult_FundingCreatedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state. + */ + public static Result_FundingCreatedDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_FundingCreatedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_FundingCreatedDecodeErrorZ clone() { + long ret = bindings.CResult_FundingCreatedDecodeErrorZ_clone(this.ptr); + Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java index 7db0a540..43a4eede 100644 --- a/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_FundingLockedDecodeErrorZ_OK(FundingLocked res) { - this(null, bindings.CResult_FundingLockedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_FundingLockedDecodeErrorZ_Err extends Result_FundingLockedDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_FundingLockedDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_FundingLockedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_FundingLockedDecodeErrorZ in the success state. + */ + public static Result_FundingLockedDecodeErrorZ constructor_ok(FundingLocked o) { + long ret = bindings.CResult_FundingLockedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_FundingLockedDecodeErrorZ in the error state. + */ + public static Result_FundingLockedDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_FundingLockedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_FundingLockedDecodeErrorZ clone() { + long ret = bindings.CResult_FundingLockedDecodeErrorZ_clone(this.ptr); + Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java index ec53a85c..78e2e99d 100644 --- a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_FundingSignedDecodeErrorZ_OK(FundingSigned res) { - this(null, bindings.CResult_FundingSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_FundingSignedDecodeErrorZ_Err extends Result_FundingSignedDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_FundingSignedDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_FundingSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_FundingSignedDecodeErrorZ in the success state. + */ + public static Result_FundingSignedDecodeErrorZ constructor_ok(FundingSigned o) { + long ret = bindings.CResult_FundingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_FundingSignedDecodeErrorZ in the error state. + */ + public static Result_FundingSignedDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_FundingSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_FundingSignedDecodeErrorZ clone() { + long ret = bindings.CResult_FundingSignedDecodeErrorZ_clone(this.ptr); + Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java index 0e59d061..e67c8163 100644 --- a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_GossipTimestampFilterDecodeErrorZ_OK(GossipTimestampFilter res) { - this(null, bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_GossipTimestampFilterDecodeErrorZ_Err extends Result_GossipTimestampFilterDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_GossipTimestampFilterDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_GossipTimestampFilterDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state. + */ + public static Result_GossipTimestampFilterDecodeErrorZ constructor_ok(GossipTimestampFilter o) { + long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state. + */ + public static Result_GossipTimestampFilterDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_GossipTimestampFilterDecodeErrorZ clone() { + long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_clone(this.ptr); + Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java index 4e64e1f7..f4920d20 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_HTLCOutputInCommitmentDecodeErrorZ_OK(HTLCOutputInCommitment res) { - this(null, bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_HTLCOutputInCommitmentDecodeErrorZ_Err extends Result_HTLCOutputInCommitmentDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_HTLCOutputInCommitmentDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state. + */ + public static Result_HTLCOutputInCommitmentDecodeErrorZ constructor_ok(HTLCOutputInCommitment o) { + long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state. + */ + public static Result_HTLCOutputInCommitmentDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_HTLCOutputInCommitmentDecodeErrorZ clone() { + long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(this.ptr); + Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java index 05b4f2a3..1a5cc8cf 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_HTLCUpdateDecodeErrorZ_OK(HTLCUpdate res) { - this(null, bindings.CResult_HTLCUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_HTLCUpdateDecodeErrorZ_Err extends Result_HTLCUpdateDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_HTLCUpdateDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_HTLCUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state. + */ + public static Result_HTLCUpdateDecodeErrorZ constructor_ok(HTLCUpdate o) { + long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state. + */ + public static Result_HTLCUpdateDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_HTLCUpdateDecodeErrorZ clone() { + long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_clone(this.ptr); + Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java index 7794fb95..b84829e3 100644 --- a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_HolderCommitmentTransactionDecodeErrorZ_OK(HolderCommitmentTransaction res) { - this(null, bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_HolderCommitmentTransactionDecodeErrorZ_Err extends Result_HolderCommitmentTransactionDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_HolderCommitmentTransactionDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state. + */ + public static Result_HolderCommitmentTransactionDecodeErrorZ constructor_ok(HolderCommitmentTransaction o) { + long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state. + */ + public static Result_HolderCommitmentTransactionDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_HolderCommitmentTransactionDecodeErrorZ clone() { + long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_clone(this.ptr); + Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java index 98246464..4c984b0a 100644 --- a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_InMemorySignerDecodeErrorZ_OK(InMemorySigner res) { - this(null, bindings.CResult_InMemorySignerDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_InMemorySignerDecodeErrorZ_Err extends Result_InMemorySignerDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_InMemorySignerDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_InMemorySignerDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state. + */ + public static Result_InMemorySignerDecodeErrorZ constructor_ok(InMemorySigner o) { + long ret = bindings.CResult_InMemorySignerDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state. + */ + public static Result_InMemorySignerDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_InMemorySignerDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InMemorySignerDecodeErrorZ clone() { + long ret = bindings.CResult_InMemorySignerDecodeErrorZ_clone(this.ptr); + Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java index 77275658..dce2cced 100644 --- a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_InitDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_InitDecodeErrorZ_OK(Init res) { - this(null, bindings.CResult_InitDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_InitDecodeErrorZ_Err extends Result_InitDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_InitDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_InitDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_InitDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_InitDecodeErrorZ in the success state. + */ + public static Result_InitDecodeErrorZ constructor_ok(Init o) { + long ret = bindings.CResult_InitDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_InitDecodeErrorZ in the error state. + */ + public static Result_InitDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_InitDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InitDecodeErrorZ clone() { + long ret = bindings.CResult_InitDecodeErrorZ_clone(this.ptr); + Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java index cee609a3..b5b353e4 100644 --- a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_InitFeaturesDecodeErrorZ_OK(InitFeatures res) { - this(null, bindings.CResult_InitFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_InitFeaturesDecodeErrorZ_Err extends Result_InitFeaturesDecodeErrorZ { @@ -42,9 +38,26 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_InitFeaturesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_InitFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state. + */ + public static Result_InitFeaturesDecodeErrorZ constructor_ok(InitFeatures o) { + long ret = bindings.CResult_InitFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state. + */ + public static Result_InitFeaturesDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_InitFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java index 0ea07879..76e7994b 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_InvoiceFeaturesDecodeErrorZ_OK(InvoiceFeatures res) { - this(null, bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_InvoiceFeaturesDecodeErrorZ_Err extends Result_InvoiceFeaturesDecodeErrorZ { @@ -42,9 +38,26 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_InvoiceFeaturesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state. + */ + public static Result_InvoiceFeaturesDecodeErrorZ constructor_ok(InvoiceFeatures o) { + long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state. + */ + public static Result_InvoiceFeaturesDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java b/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java index 1149eb98..64fe7612 100644 --- a/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java +++ b/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java @@ -27,9 +27,6 @@ public class Result_NetAddressu8Z extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NetAddressu8Z_OK(NetAddress res) { - this(null, bindings.CResult_NetAddressu8Z_ok(res.ptr)); - } } public static final class Result_NetAddressu8Z_Err extends Result_NetAddressu8Z { @@ -38,8 +35,34 @@ public class Result_NetAddressu8Z extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_NetAddressu8Z_get_err(ptr); } - public Result_NetAddressu8Z_Err(byte err) { - this(null, bindings.CResult_NetAddressu8Z_err(err)); - } } + + /** + * Creates a new CResult_NetAddressu8Z in the success state. + */ + public static Result_NetAddressu8Z constructor_ok(NetAddress o) { + long ret = bindings.CResult_NetAddressu8Z_ok(o.ptr); + Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NetAddressu8Z in the error state. + */ + public static Result_NetAddressu8Z constructor_err(byte e) { + long ret = bindings.CResult_NetAddressu8Z_err(e); + Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NetAddressu8Z which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NetAddressu8Z clone() { + long ret = bindings.CResult_NetAddressu8Z_clone(this.ptr); + Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java index da4e3b6d..a2dd03c4 100644 --- a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NetworkGraphDecodeErrorZ_OK(NetworkGraph res) { - this(null, bindings.CResult_NetworkGraphDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_NetworkGraphDecodeErrorZ_Err extends Result_NetworkGraphDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NetworkGraphDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_NetworkGraphDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state. + */ + public static Result_NetworkGraphDecodeErrorZ constructor_ok(NetworkGraph o) { + long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state. + */ + public static Result_NetworkGraphDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_NetworkGraphDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NetworkGraphDecodeErrorZ clone() { + long ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone(this.ptr); + Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java index 9fb06a72..9293a311 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NodeAnnouncementDecodeErrorZ_OK(NodeAnnouncement res) { - this(null, bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_NodeAnnouncementDecodeErrorZ_Err extends Result_NodeAnnouncementDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NodeAnnouncementDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_NodeAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state. + */ + public static Result_NodeAnnouncementDecodeErrorZ constructor_ok(NodeAnnouncement o) { + long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state. + */ + public static Result_NodeAnnouncementDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NodeAnnouncementDecodeErrorZ clone() { + long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_clone(this.ptr); + Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java index 611d7056..967d6bde 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NodeAnnouncementInfoDecodeErrorZ_OK(NodeAnnouncementInfo res) { - this(null, bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_NodeAnnouncementInfoDecodeErrorZ_Err extends Result_NodeAnnouncementInfoDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NodeAnnouncementInfoDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state. + */ + public static Result_NodeAnnouncementInfoDecodeErrorZ constructor_ok(NodeAnnouncementInfo o) { + long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state. + */ + public static Result_NodeAnnouncementInfoDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NodeAnnouncementInfoDecodeErrorZ clone() { + long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone(this.ptr); + Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java index ed1d3a27..74718355 100644 --- a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NodeFeaturesDecodeErrorZ_OK(NodeFeatures res) { - this(null, bindings.CResult_NodeFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_NodeFeaturesDecodeErrorZ_Err extends Result_NodeFeaturesDecodeErrorZ { @@ -42,9 +38,26 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NodeFeaturesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_NodeFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state. + */ + public static Result_NodeFeaturesDecodeErrorZ constructor_ok(NodeFeatures o) { + long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state. + */ + public static Result_NodeFeaturesDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java index a6f8fcb9..737d1383 100644 --- a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NodeInfoDecodeErrorZ_OK(NodeInfo res) { - this(null, bindings.CResult_NodeInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_NodeInfoDecodeErrorZ_Err extends Result_NodeInfoDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NodeInfoDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_NodeInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_NodeInfoDecodeErrorZ in the success state. + */ + public static Result_NodeInfoDecodeErrorZ constructor_ok(NodeInfo o) { + long ret = bindings.CResult_NodeInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NodeInfoDecodeErrorZ in the error state. + */ + public static Result_NodeInfoDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_NodeInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NodeInfoDecodeErrorZ clone() { + long ret = bindings.CResult_NodeInfoDecodeErrorZ_clone(this.ptr); + Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java index a296d091..f0ed5da0 100644 --- a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java @@ -22,9 +22,6 @@ public class Result_NoneAPIErrorZ extends CommonBase { private Result_NoneAPIErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NoneAPIErrorZ_OK() { - this(null, bindings.CResult_NoneAPIErrorZ_ok()); - } } public static final class Result_NoneAPIErrorZ_Err extends Result_NoneAPIErrorZ { @@ -36,8 +33,34 @@ public class Result_NoneAPIErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NoneAPIErrorZ_Err(APIError err) { - this(null, bindings.CResult_NoneAPIErrorZ_err(err.ptr)); - } } + + /** + * Creates a new CResult_NoneAPIErrorZ in the success state. + */ + public static Result_NoneAPIErrorZ constructor_ok() { + long ret = bindings.CResult_NoneAPIErrorZ_ok(); + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneAPIErrorZ in the error state. + */ + public static Result_NoneAPIErrorZ constructor_err(APIError e) { + long ret = bindings.CResult_NoneAPIErrorZ_err(e.ptr); + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneAPIErrorZ clone() { + long ret = bindings.CResult_NoneAPIErrorZ_clone(this.ptr); + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java b/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java index 3e9f075b..44685702 100644 --- a/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java @@ -22,9 +22,6 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { private Result_NoneChannelMonitorUpdateErrZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NoneChannelMonitorUpdateErrZ_OK() { - this(null, bindings.CResult_NoneChannelMonitorUpdateErrZ_ok()); - } } public static final class Result_NoneChannelMonitorUpdateErrZ_Err extends Result_NoneChannelMonitorUpdateErrZ { @@ -33,8 +30,34 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(ptr); } - public Result_NoneChannelMonitorUpdateErrZ_Err(LDKChannelMonitorUpdateErr err) { - this(null, bindings.CResult_NoneChannelMonitorUpdateErrZ_err(err)); - } } + + /** + * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state. + */ + public static Result_NoneChannelMonitorUpdateErrZ constructor_ok() { + long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_ok(); + Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state. + */ + public static Result_NoneChannelMonitorUpdateErrZ constructor_err(LDKChannelMonitorUpdateErr e) { + long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_err(e); + Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneChannelMonitorUpdateErrZ clone() { + long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone(this.ptr); + Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java index 292df093..7f150a19 100644 --- a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java @@ -22,9 +22,6 @@ public class Result_NoneLightningErrorZ extends CommonBase { private Result_NoneLightningErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NoneLightningErrorZ_OK() { - this(null, bindings.CResult_NoneLightningErrorZ_ok()); - } } public static final class Result_NoneLightningErrorZ_Err extends Result_NoneLightningErrorZ { @@ -36,9 +33,35 @@ public class Result_NoneLightningErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NoneLightningErrorZ_Err(LightningError err) { - this(null, bindings.CResult_NoneLightningErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_NoneLightningErrorZ in the success state. + */ + public static Result_NoneLightningErrorZ constructor_ok() { + long ret = bindings.CResult_NoneLightningErrorZ_ok(); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneLightningErrorZ in the error state. + */ + public static Result_NoneLightningErrorZ constructor_err(LightningError e) { + long ret = bindings.CResult_NoneLightningErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneLightningErrorZ clone() { + long ret = bindings.CResult_NoneLightningErrorZ_clone(this.ptr); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java index 89dce235..c63e7569 100644 --- a/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java @@ -22,9 +22,6 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase { private Result_NoneMonitorUpdateErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NoneMonitorUpdateErrorZ_OK() { - this(null, bindings.CResult_NoneMonitorUpdateErrorZ_ok()); - } } public static final class Result_NoneMonitorUpdateErrorZ_Err extends Result_NoneMonitorUpdateErrorZ { @@ -36,9 +33,35 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NoneMonitorUpdateErrorZ_Err(MonitorUpdateError err) { - this(null, bindings.CResult_NoneMonitorUpdateErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state. + */ + public static Result_NoneMonitorUpdateErrorZ constructor_ok() { + long ret = bindings.CResult_NoneMonitorUpdateErrorZ_ok(); + Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state. + */ + public static Result_NoneMonitorUpdateErrorZ constructor_err(MonitorUpdateError e) { + long ret = bindings.CResult_NoneMonitorUpdateErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NoneMonitorUpdateErrorZ clone() { + long ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone(this.ptr); + Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java index 8f9e933d..1b9b3f80 100644 --- a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java @@ -22,9 +22,6 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { private Result_NonePaymentSendFailureZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NonePaymentSendFailureZ_OK() { - this(null, bindings.CResult_NonePaymentSendFailureZ_ok()); - } } public static final class Result_NonePaymentSendFailureZ_Err extends Result_NonePaymentSendFailureZ { @@ -36,8 +33,34 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NonePaymentSendFailureZ_Err(PaymentSendFailure err) { - this(null, bindings.CResult_NonePaymentSendFailureZ_err(err.ptr)); - } } + + /** + * Creates a new CResult_NonePaymentSendFailureZ in the success state. + */ + public static Result_NonePaymentSendFailureZ constructor_ok() { + long ret = bindings.CResult_NonePaymentSendFailureZ_ok(); + Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NonePaymentSendFailureZ in the error state. + */ + public static Result_NonePaymentSendFailureZ constructor_err(PaymentSendFailure e) { + long ret = bindings.CResult_NonePaymentSendFailureZ_err(e.ptr); + Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NonePaymentSendFailureZ clone() { + long ret = bindings.CResult_NonePaymentSendFailureZ_clone(this.ptr); + Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java index 3377e161..ec7ade26 100644 --- a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java @@ -22,9 +22,6 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { private Result_NonePeerHandleErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NonePeerHandleErrorZ_OK() { - this(null, bindings.CResult_NonePeerHandleErrorZ_ok()); - } } public static final class Result_NonePeerHandleErrorZ_Err extends Result_NonePeerHandleErrorZ { @@ -36,9 +33,35 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NonePeerHandleErrorZ_Err(PeerHandleError err) { - this(null, bindings.CResult_NonePeerHandleErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_NonePeerHandleErrorZ in the success state. + */ + public static Result_NonePeerHandleErrorZ constructor_ok() { + long ret = bindings.CResult_NonePeerHandleErrorZ_ok(); + Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NonePeerHandleErrorZ in the error state. + */ + public static Result_NonePeerHandleErrorZ constructor_err(PeerHandleError e) { + long ret = bindings.CResult_NonePeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NonePeerHandleErrorZ clone() { + long ret = bindings.CResult_NonePeerHandleErrorZ_clone(this.ptr); + Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java index 5c602126..f6bad11f 100644 --- a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_OpenChannelDecodeErrorZ_OK(OpenChannel res) { - this(null, bindings.CResult_OpenChannelDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_OpenChannelDecodeErrorZ_Err extends Result_OpenChannelDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_OpenChannelDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_OpenChannelDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_OpenChannelDecodeErrorZ in the success state. + */ + public static Result_OpenChannelDecodeErrorZ constructor_ok(OpenChannel o) { + long ret = bindings.CResult_OpenChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_OpenChannelDecodeErrorZ in the error state. + */ + public static Result_OpenChannelDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_OpenChannelDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OpenChannelDecodeErrorZ clone() { + long ret = bindings.CResult_OpenChannelDecodeErrorZ_clone(this.ptr); + Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java index 5eb6d70c..1aceb04c 100644 --- a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_OutPointDecodeErrorZ_OK(OutPoint res) { - this(null, bindings.CResult_OutPointDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_OutPointDecodeErrorZ_Err extends Result_OutPointDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_OutPointDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_OutPointDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_OutPointDecodeErrorZ in the success state. + */ + public static Result_OutPointDecodeErrorZ constructor_ok(OutPoint o) { + long ret = bindings.CResult_OutPointDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_OutPointDecodeErrorZ in the error state. + */ + public static Result_OutPointDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_OutPointDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OutPointDecodeErrorZ clone() { + long ret = bindings.CResult_OutPointDecodeErrorZ_clone(this.ptr); + Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java index df3b1456..c91054d5 100644 --- a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_PingDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_PingDecodeErrorZ_OK(Ping res) { - this(null, bindings.CResult_PingDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_PingDecodeErrorZ_Err extends Result_PingDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_PingDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_PingDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_PingDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_PingDecodeErrorZ in the success state. + */ + public static Result_PingDecodeErrorZ constructor_ok(Ping o) { + long ret = bindings.CResult_PingDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_PingDecodeErrorZ in the error state. + */ + public static Result_PingDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_PingDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_PingDecodeErrorZ clone() { + long ret = bindings.CResult_PingDecodeErrorZ_clone(this.ptr); + Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java index 2d33ea87..0850f388 100644 --- a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_PongDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_PongDecodeErrorZ_OK(Pong res) { - this(null, bindings.CResult_PongDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_PongDecodeErrorZ_Err extends Result_PongDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_PongDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_PongDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_PongDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_PongDecodeErrorZ in the success state. + */ + public static Result_PongDecodeErrorZ constructor_ok(Pong o) { + long ret = bindings.CResult_PongDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_PongDecodeErrorZ in the error state. + */ + public static Result_PongDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_PongDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_PongDecodeErrorZ clone() { + long ret = bindings.CResult_PongDecodeErrorZ_clone(this.ptr); + Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java b/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java index 3a9df4d2..60dbc03e 100644 --- a/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java @@ -24,9 +24,6 @@ public class Result_PublicKeyErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_PublicKeyErrorZ_get_ok(ptr); } - public Result_PublicKeyErrorZ_OK(byte[] res) { - this(null, bindings.CResult_PublicKeyErrorZ_ok(res)); - } } public static final class Result_PublicKeyErrorZ_Err extends Result_PublicKeyErrorZ { @@ -35,8 +32,24 @@ public class Result_PublicKeyErrorZ extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_PublicKeyErrorZ_get_err(ptr); } - public Result_PublicKeyErrorZ_Err(LDKSecp256k1Error err) { - this(null, bindings.CResult_PublicKeyErrorZ_err(err)); - } } + + /** + * Creates a new CResult_PublicKeyErrorZ in the success state. + */ + public static Result_PublicKeyErrorZ constructor_ok(byte[] o) { + long ret = bindings.CResult_PublicKeyErrorZ_ok(o); + Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_PublicKeyErrorZ in the error state. + */ + public static Result_PublicKeyErrorZ constructor_err(LDKSecp256k1Error e) { + long ret = bindings.CResult_PublicKeyErrorZ_err(e); + Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java index ee14d952..c2de785d 100644 --- a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_QueryChannelRangeDecodeErrorZ_OK(QueryChannelRange res) { - this(null, bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_QueryChannelRangeDecodeErrorZ_Err extends Result_QueryChannelRangeDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_QueryChannelRangeDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_QueryChannelRangeDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state. + */ + public static Result_QueryChannelRangeDecodeErrorZ constructor_ok(QueryChannelRange o) { + long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state. + */ + public static Result_QueryChannelRangeDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_QueryChannelRangeDecodeErrorZ clone() { + long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_clone(this.ptr); + Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java index 4219737f..3cfeff03 100644 --- a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_QueryShortChannelIdsDecodeErrorZ_OK(QueryShortChannelIds res) { - this(null, bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_QueryShortChannelIdsDecodeErrorZ_Err extends Result_QueryShortChannelIdsDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_QueryShortChannelIdsDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state. + */ + public static Result_QueryShortChannelIdsDecodeErrorZ constructor_ok(QueryShortChannelIds o) { + long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state. + */ + public static Result_QueryShortChannelIdsDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_QueryShortChannelIdsDecodeErrorZ clone() { + long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_clone(this.ptr); + Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java index 1130bb0d..df73e8b5 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ReplyChannelRangeDecodeErrorZ_OK(ReplyChannelRange res) { - this(null, bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ReplyChannelRangeDecodeErrorZ_Err extends Result_ReplyChannelRangeDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ReplyChannelRangeDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ReplyChannelRangeDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state. + */ + public static Result_ReplyChannelRangeDecodeErrorZ constructor_ok(ReplyChannelRange o) { + long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state. + */ + public static Result_ReplyChannelRangeDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ReplyChannelRangeDecodeErrorZ clone() { + long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_clone(this.ptr); + Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java index baf5aab7..90fd1252 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ReplyShortChannelIdsEndDecodeErrorZ_OK(ReplyShortChannelIdsEnd res) { - this(null, bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ReplyShortChannelIdsEndDecodeErrorZ_Err extends Result_ReplyShortChannelIdsEndDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state. + */ + public static Result_ReplyShortChannelIdsEndDecodeErrorZ constructor_ok(ReplyShortChannelIdsEnd o) { + long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state. + */ + public static Result_ReplyShortChannelIdsEndDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ReplyShortChannelIdsEndDecodeErrorZ clone() { + long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(this.ptr); + Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java index fd9181c1..ed0763a0 100644 --- a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_RevokeAndACKDecodeErrorZ_OK(RevokeAndACK res) { - this(null, bindings.CResult_RevokeAndACKDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_RevokeAndACKDecodeErrorZ_Err extends Result_RevokeAndACKDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_RevokeAndACKDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_RevokeAndACKDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state. + */ + public static Result_RevokeAndACKDecodeErrorZ constructor_ok(RevokeAndACK o) { + long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state. + */ + public static Result_RevokeAndACKDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_RevokeAndACKDecodeErrorZ clone() { + long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_clone(this.ptr); + Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java index d716f532..9d07eab0 100644 --- a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_RouteDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_RouteDecodeErrorZ_OK(Route res) { - this(null, bindings.CResult_RouteDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_RouteDecodeErrorZ_Err extends Result_RouteDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_RouteDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_RouteDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_RouteDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_RouteDecodeErrorZ in the success state. + */ + public static Result_RouteDecodeErrorZ constructor_ok(Route o) { + long ret = bindings.CResult_RouteDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_RouteDecodeErrorZ in the error state. + */ + public static Result_RouteDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_RouteDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_RouteDecodeErrorZ clone() { + long ret = bindings.CResult_RouteDecodeErrorZ_clone(this.ptr); + Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java index fa9ab976..7348c731 100644 --- a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java @@ -27,10 +27,6 @@ public class Result_RouteLightningErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_RouteLightningErrorZ_OK(Route res) { - this(null, bindings.CResult_RouteLightningErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_RouteLightningErrorZ_Err extends Result_RouteLightningErrorZ { @@ -42,9 +38,36 @@ public class Result_RouteLightningErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_RouteLightningErrorZ_Err(LightningError err) { - this(null, bindings.CResult_RouteLightningErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_RouteLightningErrorZ in the success state. + */ + public static Result_RouteLightningErrorZ constructor_ok(Route o) { + long ret = bindings.CResult_RouteLightningErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_RouteLightningErrorZ in the error state. + */ + public static Result_RouteLightningErrorZ constructor_err(LightningError e) { + long ret = bindings.CResult_RouteLightningErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_RouteLightningErrorZ clone() { + long ret = bindings.CResult_RouteLightningErrorZ_clone(this.ptr); + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java index f58be065..01186822 100644 --- a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_RoutingFeesDecodeErrorZ_OK(RoutingFees res) { - this(null, bindings.CResult_RoutingFeesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_RoutingFeesDecodeErrorZ_Err extends Result_RoutingFeesDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_RoutingFeesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_RoutingFeesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state. + */ + public static Result_RoutingFeesDecodeErrorZ constructor_ok(RoutingFees o) { + long ret = bindings.CResult_RoutingFeesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state. + */ + public static Result_RoutingFeesDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_RoutingFeesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_RoutingFeesDecodeErrorZ clone() { + long ret = bindings.CResult_RoutingFeesDecodeErrorZ_clone(this.ptr); + Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java b/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java index f643ad9a..48f2ae1d 100644 --- a/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java @@ -24,9 +24,6 @@ public class Result_SecretKeyErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_SecretKeyErrorZ_get_ok(ptr); } - public Result_SecretKeyErrorZ_OK(byte[] res) { - this(null, bindings.CResult_SecretKeyErrorZ_ok(res)); - } } public static final class Result_SecretKeyErrorZ_Err extends Result_SecretKeyErrorZ { @@ -35,8 +32,24 @@ public class Result_SecretKeyErrorZ extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_SecretKeyErrorZ_get_err(ptr); } - public Result_SecretKeyErrorZ_Err(LDKSecp256k1Error err) { - this(null, bindings.CResult_SecretKeyErrorZ_err(err)); - } } + + /** + * Creates a new CResult_SecretKeyErrorZ in the success state. + */ + public static Result_SecretKeyErrorZ constructor_ok(byte[] o) { + long ret = bindings.CResult_SecretKeyErrorZ_ok(o); + Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_SecretKeyErrorZ in the error state. + */ + public static Result_SecretKeyErrorZ constructor_err(LDKSecp256k1Error e) { + long ret = bindings.CResult_SecretKeyErrorZ_err(e); + Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java index c71735d6..7a2e6baf 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ShutdownDecodeErrorZ_OK(Shutdown res) { - this(null, bindings.CResult_ShutdownDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ShutdownDecodeErrorZ_Err extends Result_ShutdownDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ShutdownDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ShutdownDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_ShutdownDecodeErrorZ in the success state. + */ + public static Result_ShutdownDecodeErrorZ constructor_ok(Shutdown o) { + long ret = bindings.CResult_ShutdownDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ShutdownDecodeErrorZ in the error state. + */ + public static Result_ShutdownDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_ShutdownDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ShutdownDecodeErrorZ clone() { + long ret = bindings.CResult_ShutdownDecodeErrorZ_clone(this.ptr); + Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java index 652daf48..4aa27cf5 100644 --- a/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_SignDecodeErrorZ extends CommonBase { ret_hu_conv.ptrs_to.add(this); this.res = ret_hu_conv; } - public Result_SignDecodeErrorZ_OK(Sign res) { - this(null, bindings.CResult_SignDecodeErrorZ_ok(res == null ? 0 : res.ptr)); - this.ptrs_to.add(res); - } } public static final class Result_SignDecodeErrorZ_Err extends Result_SignDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_SignDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_SignDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_SignDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_SignDecodeErrorZ in the success state. + */ + public static Result_SignDecodeErrorZ constructor_ok(Sign o) { + long ret = bindings.CResult_SignDecodeErrorZ_ok(o == null ? 0 : o.ptr); + Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_SignDecodeErrorZ in the error state. + */ + public static Result_SignDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_SignDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_SignDecodeErrorZ clone() { + long ret = bindings.CResult_SignDecodeErrorZ_clone(this.ptr); + Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java b/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java index 8e7bb2e0..1ccfcac6 100644 --- a/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java @@ -24,17 +24,40 @@ public class Result_SignatureNoneZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_SignatureNoneZ_get_ok(ptr); } - public Result_SignatureNoneZ_OK(byte[] res) { - this(null, bindings.CResult_SignatureNoneZ_ok(res)); - } } public static final class Result_SignatureNoneZ_Err extends Result_SignatureNoneZ { private Result_SignatureNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_SignatureNoneZ_Err() { - this(null, bindings.CResult_SignatureNoneZ_err()); - } } + + /** + * Creates a new CResult_SignatureNoneZ in the success state. + */ + public static Result_SignatureNoneZ constructor_ok(byte[] o) { + long ret = bindings.CResult_SignatureNoneZ_ok(o); + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_SignatureNoneZ in the error state. + */ + public static Result_SignatureNoneZ constructor_err() { + long ret = bindings.CResult_SignatureNoneZ_err(); + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_SignatureNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_SignatureNoneZ clone() { + long ret = bindings.CResult_SignatureNoneZ_clone(this.ptr); + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java index 3fd3ca6f..99aff28b 100644 --- a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java @@ -27,9 +27,6 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_SpendableOutputDescriptorDecodeErrorZ_OK(SpendableOutputDescriptor res) { - this(null, bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(res.ptr)); - } } public static final class Result_SpendableOutputDescriptorDecodeErrorZ_Err extends Result_SpendableOutputDescriptorDecodeErrorZ { @@ -41,9 +38,35 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_SpendableOutputDescriptorDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state. + */ + public static Result_SpendableOutputDescriptorDecodeErrorZ constructor_ok(SpendableOutputDescriptor o) { + long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o.ptr); + Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state. + */ + public static Result_SpendableOutputDescriptorDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_SpendableOutputDescriptorDecodeErrorZ clone() { + long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone(this.ptr); + Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java index c70799b2..fe70d4a3 100644 --- a/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java @@ -24,17 +24,30 @@ public class Result_TransactionNoneZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_TransactionNoneZ_get_ok(ptr); } - public Result_TransactionNoneZ_OK(byte[] res) { - this(null, bindings.CResult_TransactionNoneZ_ok(res)); - } } public static final class Result_TransactionNoneZ_Err extends Result_TransactionNoneZ { private Result_TransactionNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_TransactionNoneZ_Err() { - this(null, bindings.CResult_TransactionNoneZ_err()); - } } + + /** + * Creates a new CResult_TransactionNoneZ in the success state. + */ + public static Result_TransactionNoneZ constructor_ok(byte[] o) { + long ret = bindings.CResult_TransactionNoneZ_ok(o); + Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_TransactionNoneZ in the error state. + */ + public static Result_TransactionNoneZ constructor_err() { + long ret = bindings.CResult_TransactionNoneZ_err(); + Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java index 54375f1a..c34404fb 100644 --- a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java @@ -27,26 +27,39 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_TrustedCommitmentTransactionNoneZ_OK(TrustedCommitmentTransaction res) { - this(null, bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid this being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after this call, res is reset to null and is now a dummy object. - res.ptr = 0; - } } public static final class Result_TrustedCommitmentTransactionNoneZ_Err extends Result_TrustedCommitmentTransactionNoneZ { private Result_TrustedCommitmentTransactionNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_TrustedCommitmentTransactionNoneZ_Err() { - this(null, bindings.CResult_TrustedCommitmentTransactionNoneZ_err()); - } } + + /** + * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state. + */ + public static Result_TrustedCommitmentTransactionNoneZ constructor_ok(TrustedCommitmentTransaction o) { + long ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(o == null ? 0 : o.ptr & ~1); + Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. + o.ptr = 0; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state. + */ + public static Result_TrustedCommitmentTransactionNoneZ constructor_err() { + long ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_err(); + Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java index 5f181b45..b23757e5 100644 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_TxCreationKeysDecodeErrorZ_OK(TxCreationKeys res) { - this(null, bindings.CResult_TxCreationKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_TxCreationKeysDecodeErrorZ_Err extends Result_TxCreationKeysDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_TxCreationKeysDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_TxCreationKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state. + */ + public static Result_TxCreationKeysDecodeErrorZ constructor_ok(TxCreationKeys o) { + long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state. + */ + public static Result_TxCreationKeysDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxCreationKeysDecodeErrorZ clone() { + long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_clone(this.ptr); + Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java index 3c33cd42..f0f46ff8 100644 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java @@ -27,10 +27,6 @@ public class Result_TxCreationKeysErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_TxCreationKeysErrorZ_OK(TxCreationKeys res) { - this(null, bindings.CResult_TxCreationKeysErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_TxCreationKeysErrorZ_Err extends Result_TxCreationKeysErrorZ { @@ -39,8 +35,25 @@ public class Result_TxCreationKeysErrorZ extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_TxCreationKeysErrorZ_get_err(ptr); } - public Result_TxCreationKeysErrorZ_Err(LDKSecp256k1Error err) { - this(null, bindings.CResult_TxCreationKeysErrorZ_err(err)); - } } + + /** + * Creates a new CResult_TxCreationKeysErrorZ in the success state. + */ + public static Result_TxCreationKeysErrorZ constructor_ok(TxCreationKeys o) { + long ret = bindings.CResult_TxCreationKeysErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxCreationKeysErrorZ in the error state. + */ + public static Result_TxCreationKeysErrorZ constructor_err(LDKSecp256k1Error e) { + long ret = bindings.CResult_TxCreationKeysErrorZ_err(e); + Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java b/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java index 84965342..42f88334 100644 --- a/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java @@ -26,9 +26,6 @@ public class Result_TxOutAccessErrorZ extends CommonBase { TxOut res_conv = new TxOut(null, res); this.res = res_conv; } - public Result_TxOutAccessErrorZ_OK(TxOut res) { - this(null, bindings.CResult_TxOutAccessErrorZ_ok(res.ptr)); - } } public static final class Result_TxOutAccessErrorZ_Err extends Result_TxOutAccessErrorZ { @@ -37,8 +34,34 @@ public class Result_TxOutAccessErrorZ extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_TxOutAccessErrorZ_get_err(ptr); } - public Result_TxOutAccessErrorZ_Err(LDKAccessError err) { - this(null, bindings.CResult_TxOutAccessErrorZ_err(err)); - } } + + /** + * Creates a new CResult_TxOutAccessErrorZ in the success state. + */ + public static Result_TxOutAccessErrorZ constructor_ok(TxOut o) { + long ret = bindings.CResult_TxOutAccessErrorZ_ok(o.ptr); + Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxOutAccessErrorZ in the error state. + */ + public static Result_TxOutAccessErrorZ constructor_err(LDKAccessError e) { + long ret = bindings.CResult_TxOutAccessErrorZ_err(e); + Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TxOutAccessErrorZ clone() { + long ret = bindings.CResult_TxOutAccessErrorZ_clone(this.ptr); + Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java index a8b2d9f8..f6f59dbc 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(UnsignedChannelAnnouncement res) { - this(null, bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UnsignedChannelAnnouncementDecodeErrorZ_Err extends Result_UnsignedChannelAnnouncementDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state. + */ + public static Result_UnsignedChannelAnnouncementDecodeErrorZ constructor_ok(UnsignedChannelAnnouncement o) { + long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state. + */ + public static Result_UnsignedChannelAnnouncementDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UnsignedChannelAnnouncementDecodeErrorZ clone() { + long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(this.ptr); + Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java index 23a6f102..9b3a7e2f 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UnsignedChannelUpdateDecodeErrorZ_OK(UnsignedChannelUpdate res) { - this(null, bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UnsignedChannelUpdateDecodeErrorZ_Err extends Result_UnsignedChannelUpdateDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UnsignedChannelUpdateDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state. + */ + public static Result_UnsignedChannelUpdateDecodeErrorZ constructor_ok(UnsignedChannelUpdate o) { + long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state. + */ + public static Result_UnsignedChannelUpdateDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UnsignedChannelUpdateDecodeErrorZ clone() { + long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_clone(this.ptr); + Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java index 9512afc7..67f69dfc 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UnsignedNodeAnnouncementDecodeErrorZ_OK(UnsignedNodeAnnouncement res) { - this(null, bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UnsignedNodeAnnouncementDecodeErrorZ_Err extends Result_UnsignedNodeAnnouncementDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state. + */ + public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor_ok(UnsignedNodeAnnouncement o) { + long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state. + */ + public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UnsignedNodeAnnouncementDecodeErrorZ clone() { + long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(this.ptr); + Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java index 8fb56e96..d2ba04f6 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateAddHTLCDecodeErrorZ_OK(UpdateAddHTLC res) { - this(null, bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateAddHTLCDecodeErrorZ_Err extends Result_UpdateAddHTLCDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateAddHTLCDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state. + */ + public static Result_UpdateAddHTLCDecodeErrorZ constructor_ok(UpdateAddHTLC o) { + long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state. + */ + public static Result_UpdateAddHTLCDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UpdateAddHTLCDecodeErrorZ clone() { + long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_clone(this.ptr); + Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java index 42d39389..2bd574d1 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateFailHTLCDecodeErrorZ_OK(UpdateFailHTLC res) { - this(null, bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateFailHTLCDecodeErrorZ_Err extends Result_UpdateFailHTLCDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateFailHTLCDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state. + */ + public static Result_UpdateFailHTLCDecodeErrorZ constructor_ok(UpdateFailHTLC o) { + long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state. + */ + public static Result_UpdateFailHTLCDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UpdateFailHTLCDecodeErrorZ clone() { + long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_clone(this.ptr); + Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java index b1194604..e379e399 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(UpdateFailMalformedHTLC res) { - this(null, bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateFailMalformedHTLCDecodeErrorZ_Err extends Result_UpdateFailMalformedHTLCDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state. + */ + public static Result_UpdateFailMalformedHTLCDecodeErrorZ constructor_ok(UpdateFailMalformedHTLC o) { + long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state. + */ + public static Result_UpdateFailMalformedHTLCDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UpdateFailMalformedHTLCDecodeErrorZ clone() { + long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(this.ptr); + Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java index c023933b..e3663d28 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateFeeDecodeErrorZ_OK(UpdateFee res) { - this(null, bindings.CResult_UpdateFeeDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateFeeDecodeErrorZ_Err extends Result_UpdateFeeDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateFeeDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateFeeDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state. + */ + public static Result_UpdateFeeDecodeErrorZ constructor_ok(UpdateFee o) { + long ret = bindings.CResult_UpdateFeeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state. + */ + public static Result_UpdateFeeDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_UpdateFeeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UpdateFeeDecodeErrorZ clone() { + long ret = bindings.CResult_UpdateFeeDecodeErrorZ_clone(this.ptr); + Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java index 364d732e..8525cfa3 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java @@ -27,10 +27,6 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateFulfillHTLCDecodeErrorZ_OK(UpdateFulfillHTLC res) { - this(null, bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateFulfillHTLCDecodeErrorZ_Err extends Result_UpdateFulfillHTLCDecodeErrorZ { @@ -42,9 +38,36 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateFulfillHTLCDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state. + */ + public static Result_UpdateFulfillHTLCDecodeErrorZ constructor_ok(UpdateFulfillHTLC o) { + long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state. + */ + public static Result_UpdateFulfillHTLCDecodeErrorZ constructor_err(DecodeError e) { + long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UpdateFulfillHTLCDecodeErrorZ clone() { + long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone(this.ptr); + Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java index c3aab0c6..c41c37b2 100644 --- a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java @@ -24,9 +24,6 @@ public class Result_boolLightningErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_boolLightningErrorZ_get_ok(ptr); } - public Result_boolLightningErrorZ_OK(boolean res) { - this(null, bindings.CResult_boolLightningErrorZ_ok(res)); - } } public static final class Result_boolLightningErrorZ_Err extends Result_boolLightningErrorZ { @@ -38,9 +35,35 @@ public class Result_boolLightningErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_boolLightningErrorZ_Err(LightningError err) { - this(null, bindings.CResult_boolLightningErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_boolLightningErrorZ in the success state. + */ + public static Result_boolLightningErrorZ constructor_ok(boolean o) { + long ret = bindings.CResult_boolLightningErrorZ_ok(o); + Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_boolLightningErrorZ in the error state. + */ + public static Result_boolLightningErrorZ constructor_err(LightningError e) { + long ret = bindings.CResult_boolLightningErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_boolLightningErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_boolLightningErrorZ clone() { + long ret = bindings.CResult_boolLightningErrorZ_clone(this.ptr); + Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java index 461cbad7..e1049774 100644 --- a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java @@ -24,9 +24,6 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_boolPeerHandleErrorZ_get_ok(ptr); } - public Result_boolPeerHandleErrorZ_OK(boolean res) { - this(null, bindings.CResult_boolPeerHandleErrorZ_ok(res)); - } } public static final class Result_boolPeerHandleErrorZ_Err extends Result_boolPeerHandleErrorZ { @@ -38,9 +35,35 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_boolPeerHandleErrorZ_Err(PeerHandleError err) { - this(null, bindings.CResult_boolPeerHandleErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + /** + * Creates a new CResult_boolPeerHandleErrorZ in the success state. + */ + public static Result_boolPeerHandleErrorZ constructor_ok(boolean o) { + long ret = bindings.CResult_boolPeerHandleErrorZ_ok(o); + Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_boolPeerHandleErrorZ in the error state. + */ + public static Result_boolPeerHandleErrorZ constructor_err(PeerHandleError e) { + long ret = bindings.CResult_boolPeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + /** + * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_boolPeerHandleErrorZ clone() { + long ret = bindings.CResult_boolPeerHandleErrorZ_clone(this.ptr); + Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/RouteHint.java b/src/main/java/org/ldk/structs/RouteHint.java index d2bc2616..02c9758c 100644 --- a/src/main/java/org/ldk/structs/RouteHint.java +++ b/src/main/java/org/ldk/structs/RouteHint.java @@ -81,6 +81,51 @@ public class RouteHint extends CommonBase { bindings.RouteHint_set_cltv_expiry_delta(this.ptr, val); } + /** + * The minimum value, in msat, which must be relayed to the next hop. + */ + public Option_u64Z get_htlc_minimum_msat() { + long ret = bindings.RouteHint_get_htlc_minimum_msat(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The minimum value, in msat, which must be relayed to the next hop. + */ + public void set_htlc_minimum_msat(Option_u64Z val) { + bindings.RouteHint_set_htlc_minimum_msat(this.ptr, val.ptr); + } + + /** + * The maximum value in msat available for routing with a single HTLC. + */ + public Option_u64Z get_htlc_maximum_msat() { + long ret = bindings.RouteHint_get_htlc_maximum_msat(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The maximum value in msat available for routing with a single HTLC. + */ + public void set_htlc_maximum_msat(Option_u64Z val) { + bindings.RouteHint_set_htlc_maximum_msat(this.ptr, val.ptr); + } + + /** + * Constructs a new RouteHint given each field + */ + public static RouteHint constructor_new(byte[] src_node_id_arg, long short_channel_id_arg, RoutingFees fees_arg, short cltv_expiry_delta_arg, Option_u64Z htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg) { + long ret = bindings.RouteHint_new(src_node_id_arg, short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr); + RouteHint ret_hu_conv = new RouteHint(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(fees_arg); + return ret_hu_conv; + } + /** * Creates a copy of the RouteHint */ diff --git a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java index a02d2379..5d6c5ae8 100644 --- a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java @@ -50,13 +50,50 @@ public class SpendableOutputDescriptor extends CommonBase { } } public final static class DelayedPaymentOutput extends SpendableOutputDescriptor { + public final DelayedPaymentOutputDescriptor delayed_payment_output; private DelayedPaymentOutput(long ptr, bindings.LDKSpendableOutputDescriptor.DelayedPaymentOutput obj) { super(null, ptr); + long delayed_payment_output = obj.delayed_payment_output; + DelayedPaymentOutputDescriptor delayed_payment_output_hu_conv = new DelayedPaymentOutputDescriptor(null, delayed_payment_output); + delayed_payment_output_hu_conv.ptrs_to.add(this); + this.delayed_payment_output = delayed_payment_output_hu_conv; } } public final static class StaticPaymentOutput extends SpendableOutputDescriptor { + public final StaticPaymentOutputDescriptor static_payment_output; private StaticPaymentOutput(long ptr, bindings.LDKSpendableOutputDescriptor.StaticPaymentOutput obj) { super(null, ptr); + long static_payment_output = obj.static_payment_output; + StaticPaymentOutputDescriptor static_payment_output_hu_conv = new StaticPaymentOutputDescriptor(null, static_payment_output); + static_payment_output_hu_conv.ptrs_to.add(this); + this.static_payment_output = static_payment_output_hu_conv; } } + /** + * Creates a copy of the SpendableOutputDescriptor + */ + public SpendableOutputDescriptor clone() { + long ret = bindings.SpendableOutputDescriptor_clone(this.ptr); + SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read + */ + public byte[] write() { + byte[] ret = bindings.SpendableOutputDescriptor_write(this.ptr); + return ret; + } + + /** + * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write + */ + public static Result_SpendableOutputDescriptorDecodeErrorZ constructor_read(byte[] ser) { + long ret = bindings.SpendableOutputDescriptor_read(ser); + Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/WatchedOutput.java b/src/main/java/org/ldk/structs/WatchedOutput.java new file mode 100644 index 00000000..e8c4f865 --- /dev/null +++ b/src/main/java/org/ldk/structs/WatchedOutput.java @@ -0,0 +1,90 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + + +/** + * A transaction output watched by a [`ChannelMonitor`] for spends on-chain. + * + * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction + * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via + * the return value of [`Filter::register_output`]. + * + * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and + * may have been spent there. See [`Filter::register_output`] for details. + * + * [`ChannelMonitor`]: channelmonitor::ChannelMonitor + * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class WatchedOutput extends CommonBase { + WatchedOutput(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.WatchedOutput_free(ptr); } + } + + /** + * First block where the transaction output may have been spent. + */ + public byte[] get_block_hash() { + byte[] ret = bindings.WatchedOutput_get_block_hash(this.ptr); + return ret; + } + + /** + * First block where the transaction output may have been spent. + */ + public void set_block_hash(byte[] val) { + bindings.WatchedOutput_set_block_hash(this.ptr, val); + } + + /** + * Outpoint identifying the transaction output. + */ + public OutPoint get_outpoint() { + long ret = bindings.WatchedOutput_get_outpoint(this.ptr); + OutPoint ret_hu_conv = new OutPoint(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Outpoint identifying the transaction output. + */ + public void set_outpoint(OutPoint val) { + bindings.WatchedOutput_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + + /** + * Spending condition of the transaction output. + */ + public byte[] get_script_pubkey() { + byte[] ret = bindings.WatchedOutput_get_script_pubkey(this.ptr); + return ret; + } + + /** + * Spending condition of the transaction output. + */ + public void set_script_pubkey(byte[] val) { + bindings.WatchedOutput_set_script_pubkey(this.ptr, val); + } + + /** + * Constructs a new WatchedOutput given each field + */ + public static WatchedOutput constructor_new(byte[] block_hash_arg, OutPoint outpoint_arg, byte[] script_pubkey_arg) { + long ret = bindings.WatchedOutput_new(block_hash_arg, outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg); + WatchedOutput ret_hu_conv = new WatchedOutput(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(outpoint_arg); + return ret_hu_conv; + } + +} diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 0e201da0..38f4fa54 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -487,6 +487,34 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysEr jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } +static jclass LDKCOption_u32Z_Some_class = NULL; +static jmethodID LDKCOption_u32Z_Some_meth = NULL; +static jclass LDKCOption_u32Z_None_class = NULL; +static jmethodID LDKCOption_u32Z_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u32Z_init (JNIEnv *env, jclass clz) { + LDKCOption_u32Z_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u32Z$Some;")); + CHECK(LDKCOption_u32Z_Some_class != NULL); + LDKCOption_u32Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_Some_class, "", "(I)V"); + CHECK(LDKCOption_u32Z_Some_meth != NULL); + LDKCOption_u32Z_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u32Z$None;")); + CHECK(LDKCOption_u32Z_None_class != NULL); + LDKCOption_u32Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_None_class, "", "()V"); + CHECK(LDKCOption_u32Z_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_u32Z *obj = (LDKCOption_u32Z*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_u32Z_Some: { + return (*env)->NewObject(env, LDKCOption_u32Z_Some_class, LDKCOption_u32Z_Some_meth, obj->some); + } + case LDKCOption_u32Z_None: { + return (*env)->NewObject(env, LDKCOption_u32Z_None_class, LDKCOption_u32Z_None_meth); + } + default: abort(); + } +} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { return ((LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)arg)->result_ok; } @@ -675,7 +703,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIE CHECK(LDKErrorAction_SendErrorMessage_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKErrorAction *obj = (LDKErrorAction*)ptr; + LDKErrorAction *obj = (LDKErrorAction*)(ptr & ~1); switch(obj->tag) { case LDKErrorAction_DisconnectPeer: { LDKErrorMessage msg_var = obj->disconnect_peer.msg; @@ -721,7 +749,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCFailChannelUpdate_ CHECK(LDKHTLCFailChannelUpdate_NodeFailure_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKHTLCFailChannelUpdate *obj = (LDKHTLCFailChannelUpdate*)ptr; + LDKHTLCFailChannelUpdate *obj = (LDKHTLCFailChannelUpdate*)(ptr & ~1); switch(obj->tag) { case LDKHTLCFailChannelUpdate_ChannelUpdateMessage: { LDKChannelUpdate msg_var = obj->channel_update_message.msg; @@ -877,7 +905,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init CHECK(LDKMessageSendEvent_SendReplyChannelRange_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKMessageSendEvent *obj = (LDKMessageSendEvent*)ptr; + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); switch(obj->tag) { case LDKMessageSendEvent_SendAcceptChannel: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -1356,6 +1384,34 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDe long err_ref = (long)err_var.inner & ~1; return err_ref; } +static jclass LDKCOption_u64Z_Some_class = NULL; +static jmethodID LDKCOption_u64Z_Some_meth = NULL; +static jclass LDKCOption_u64Z_None_class = NULL; +static jmethodID LDKCOption_u64Z_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u64Z_init (JNIEnv *env, jclass clz) { + LDKCOption_u64Z_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u64Z$Some;")); + CHECK(LDKCOption_u64Z_Some_class != NULL); + LDKCOption_u64Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_Some_class, "", "(J)V"); + CHECK(LDKCOption_u64Z_Some_meth != NULL); + LDKCOption_u64Z_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u64Z$None;")); + CHECK(LDKCOption_u64Z_None_class != NULL); + LDKCOption_u64Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_None_class, "", "()V"); + CHECK(LDKCOption_u64Z_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_u64Z *obj = (LDKCOption_u64Z*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_u64Z_Some: { + return (*env)->NewObject(env, LDKCOption_u64Z_Some_class, LDKCOption_u64Z_Some_meth, obj->some); + } + case LDKCOption_u64Z_None: { + return (*env)->NewObject(env, LDKCOption_u64Z_None_class, LDKCOption_u64Z_None_meth); + } + default: abort(); + } +} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { return ((LDKCResult_DirectionalChannelInfoDecodeErrorZ*)arg)->result_ok; } @@ -1450,7 +1506,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEn CHECK(LDKNetAddress_OnionV3_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKNetAddress *obj = (LDKNetAddress*)ptr; + LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); switch(obj->tag) { case LDKNetAddress_IPv4: { int8_tArray addr_arr = (*env)->NewByteArray(env, 4); @@ -1645,22 +1701,30 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNI LDKMonitorEvent_HTLCEvent_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent;")); CHECK(LDKMonitorEvent_HTLCEvent_class != NULL); - LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "", "()V"); + LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "", "(J)V"); CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL); LDKMonitorEvent_CommitmentTxBroadcasted_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxBroadcasted;")); CHECK(LDKMonitorEvent_CommitmentTxBroadcasted_class != NULL); - LDKMonitorEvent_CommitmentTxBroadcasted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxBroadcasted_class, "", "()V"); + LDKMonitorEvent_CommitmentTxBroadcasted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxBroadcasted_class, "", "(J)V"); CHECK(LDKMonitorEvent_CommitmentTxBroadcasted_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKMonitorEvent *obj = (LDKMonitorEvent*)ptr; + LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); switch(obj->tag) { case LDKMonitorEvent_HTLCEvent: { - return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth); + LDKHTLCUpdate htlc_event_var = obj->htlc_event; + CHECK((((long)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long htlc_event_ref = (long)htlc_event_var.inner & ~1; + return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref); } case LDKMonitorEvent_CommitmentTxBroadcasted: { - return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxBroadcasted_class, LDKMonitorEvent_CommitmentTxBroadcasted_meth); + LDKOutPoint commitment_tx_broadcasted_var = obj->commitment_tx_broadcasted; + CHECK((((long)commitment_tx_broadcasted_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&commitment_tx_broadcasted_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long commitment_tx_broadcasted_ref = (long)commitment_tx_broadcasted_var.inner & ~1; + return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxBroadcasted_class, LDKMonitorEvent_CommitmentTxBroadcasted_meth, commitment_tx_broadcasted_ref); } default: abort(); } @@ -1705,16 +1769,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescrip LDKSpendableOutputDescriptor_DelayedPaymentOutput_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$DelayedPaymentOutput;")); CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_class != NULL); - LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, "", "()V"); + LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, "", "(J)V"); CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth != NULL); LDKSpendableOutputDescriptor_StaticPaymentOutput_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticPaymentOutput;")); CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_class != NULL); - LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, "", "()V"); + LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, "", "(J)V"); CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)ptr; + LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)(ptr & ~1); switch(obj->tag) { case LDKSpendableOutputDescriptor_StaticOutput: { LDKOutPoint outpoint_var = obj->static_output.outpoint; @@ -1725,10 +1789,18 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, (long)output_ref); } case LDKSpendableOutputDescriptor_DelayedPaymentOutput: { - return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth); + LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output; + CHECK((((long)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long delayed_payment_output_ref = (long)delayed_payment_output_var.inner & ~1; + return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref); } case LDKSpendableOutputDescriptor_StaticPaymentOutput: { - return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth); + LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output; + CHECK((((long)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long static_payment_output_ref = (long)static_payment_output_var.inner & ~1; + return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref); } default: abort(); } @@ -1810,7 +1882,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en CHECK(LDKEvent_SpendableOutputs_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKEvent *obj = (LDKEvent*)ptr; + LDKEvent *obj = (LDKEvent*)(ptr & ~1); switch(obj->tag) { case LDKEvent_FundingGenerationReady: { int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); @@ -2741,6 +2813,35 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessError jclass err_conv = LDKAccessError_to_java(env, (*val->contents.err)); return err_conv; } +static jclass LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_usizeTransactionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1usizeTransactionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$Some;")); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_class != NULL); + LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_usizeTransactionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$None;")); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_class != NULL); + LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeTransactionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_C2Tuple_usizeTransactionZZ_Some: { + long some_ref = (long)(&obj->some) | 1; + return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth, some_ref); + } + case LDKCOption_C2Tuple_usizeTransactionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, LDKCOption_C2Tuple_usizeTransactionZZ_None_meth); + } + default: abort(); + } +} static jclass LDKAPIError_APIMisuseError_class = NULL; static jmethodID LDKAPIError_APIMisuseError_meth = NULL; static jclass LDKAPIError_FeeRateTooHigh_class = NULL; @@ -2779,7 +2880,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv CHECK(LDKAPIError_MonitorUpdateFailed_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKAPIError *obj = (LDKAPIError*)ptr; + LDKAPIError *obj = (LDKAPIError*)(ptr & ~1); switch(obj->tag) { case LDKAPIError_APIMisuseError: { LDKCVec_u8Z err_var = obj->api_misuse_error.err; @@ -2913,38 +3014,67 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_ini LDKPaymentSendFailure_ParameterError_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError;")); CHECK(LDKPaymentSendFailure_ParameterError_class != NULL); - LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "", "()V"); + LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "", "(J)V"); CHECK(LDKPaymentSendFailure_ParameterError_meth != NULL); LDKPaymentSendFailure_PathParameterError_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError;")); CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL); - LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "", "()V"); + LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "", "([J)V"); CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL); LDKPaymentSendFailure_AllFailedRetrySafe_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedRetrySafe;")); CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_class != NULL); - LDKPaymentSendFailure_AllFailedRetrySafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, "", "()V"); + LDKPaymentSendFailure_AllFailedRetrySafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, "", "([J)V"); CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_meth != NULL); LDKPaymentSendFailure_PartialFailure_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure;")); CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL); - LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "", "()V"); + LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "", "([J)V"); CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)ptr; + LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)(ptr & ~1); switch(obj->tag) { case LDKPaymentSendFailure_ParameterError: { - return (*env)->NewObject(env, LDKPaymentSendFailure_ParameterError_class, LDKPaymentSendFailure_ParameterError_meth); + long parameter_error_ref = ((long)&obj->parameter_error) | 1; + return (*env)->NewObject(env, LDKPaymentSendFailure_ParameterError_class, LDKPaymentSendFailure_ParameterError_meth, parameter_error_ref); } case LDKPaymentSendFailure_PathParameterError: { - return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth); + LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error; + int64_tArray path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen); + int64_t *path_parameter_error_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_parameter_error_arr, NULL); + for (size_t w = 0; w < path_parameter_error_var.datalen; w++) { + LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w]; + *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv); + path_parameter_error_arr_ptr[w] = (long)path_parameter_error_conv_22_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, path_parameter_error_arr, path_parameter_error_arr_ptr, 0); + return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth, path_parameter_error_arr); } case LDKPaymentSendFailure_AllFailedRetrySafe: { - return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, LDKPaymentSendFailure_AllFailedRetrySafe_meth); + LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe; + int64_tArray all_failed_retry_safe_arr = (*env)->NewLongArray(env, all_failed_retry_safe_var.datalen); + int64_t *all_failed_retry_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_retry_safe_arr, NULL); + for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) { + long all_failed_retry_safe_conv_10_ref = ((long)&all_failed_retry_safe_var.data[k]) | 1; + all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, all_failed_retry_safe_arr, all_failed_retry_safe_arr_ptr, 0); + return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, LDKPaymentSendFailure_AllFailedRetrySafe_meth, all_failed_retry_safe_arr); } case LDKPaymentSendFailure_PartialFailure: { - return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth); + LDKCVec_CResult_NoneAPIErrorZZ partial_failure_var = obj->partial_failure; + int64_tArray partial_failure_arr = (*env)->NewLongArray(env, partial_failure_var.datalen); + int64_t *partial_failure_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, partial_failure_arr, NULL); + for (size_t w = 0; w < partial_failure_var.datalen; w++) { + LDKCResult_NoneAPIErrorZ* partial_failure_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *partial_failure_conv_22_conv = partial_failure_var.data[w]; + *partial_failure_conv_22_conv = CResult_NoneAPIErrorZ_clone(partial_failure_conv_22_conv); + partial_failure_arr_ptr[w] = (long)partial_failure_conv_22_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, partial_failure_arr, partial_failure_arr_ptr, 0); + return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, partial_failure_arr); } default: abort(); } @@ -4928,24 +5058,23 @@ void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32 CHECK(obj != NULL); return (*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr); } -void register_output_LDKFilter_jcall(const void* this_arg, const LDKOutPoint * outpoint, LDKu8slice script_pubkey) { +LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; JNIEnv *env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK); - LDKOutPoint outpoint_var = *outpoint; - outpoint_var = OutPoint_clone(outpoint); - CHECK((((long)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long outpoint_ref = (long)outpoint_var.inner; - if (outpoint_var.is_owned) { - outpoint_ref |= 1; + LDKWatchedOutput output_var = output; + CHECK((((long)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long output_ref = (long)output_var.inner; + if (output_var.is_owned) { + output_ref |= 1; } - LDKu8slice script_pubkey_var = script_pubkey; - int8_tArray script_pubkey_arr = (*env)->NewByteArray(env, script_pubkey_var.datalen); - (*env)->SetByteArrayRegion(env, script_pubkey_arr, 0, script_pubkey_var.datalen, script_pubkey_var.data); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - return (*env)->CallVoidMethod(env, obj, j_calls->register_output_meth, outpoint_ref, script_pubkey_arr); + LDKCOption_C2Tuple_usizeTransactionZZ* ret = (LDKCOption_C2Tuple_usizeTransactionZZ*)(*env)->CallLongMethod(env, obj, j_calls->register_output_meth, output_ref); + LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1); + // Warning: we may need a move here but no clone is available for LDKCOption_C2Tuple_usizeTransactionZZ + return ret_conv; } static void* LDKFilter_JCalls_clone(const void* this_arg) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; @@ -4961,7 +5090,7 @@ static inline LDKFilter LDKFilter_init (JNIEnv *env, jclass clz, jobject o) { calls->o = (*env)->NewWeakGlobalRef(env, o); calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([B[B)V"); CHECK(calls->register_tx_meth != NULL); - calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(J[B)V"); + calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(J)J"); CHECK(calls->register_output_meth != NULL); LDKFilter ret = { @@ -4990,16 +5119,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx(JNIEnv *e (*env)->ReleaseByteArrayElements(env, script_pubkey, (int8_t*)script_pubkey_ref.data, 0); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEnv *env, jclass clz, int64_t this_arg, int64_t outpoint, int8_tArray script_pubkey) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEnv *env, jclass clz, int64_t this_arg, int64_t output) { LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1); - LDKOutPoint outpoint_conv; - outpoint_conv.inner = (void*)(outpoint & (~1)); - outpoint_conv.is_owned = false; - LDKu8slice script_pubkey_ref; - script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey); - script_pubkey_ref.data = (*env)->GetByteArrayElements (env, script_pubkey, NULL); - (this_arg_conv->register_output)(this_arg_conv->this_arg, &outpoint_conv, script_pubkey_ref); - (*env)->ReleaseByteArrayElements(env, script_pubkey, (int8_t*)script_pubkey_ref.data, 0); + LDKWatchedOutput output_conv; + output_conv.inner = (void*)(output & (~1)); + output_conv.is_owned = (output & 1) || (output == 0); + // Warning: we need a move here but no clone is available for LDKWatchedOutput + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv); + long ret_ref = (long)ret_copy; + return ret_ref; } typedef struct LDKPersist_JCalls { @@ -6578,6 +6707,35 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_ CResult_TxCreationKeysErrorZ_free(_res_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1some(JNIEnv *env, jclass clz, int32_t o) { + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_some(o); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1none(JNIEnv *env, jclass clz) { + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_none(); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + COption_u32Z_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)orig; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_clone(orig_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKHTLCOutputInCommitment o_conv; o_conv.inner = (void*)(o & (~1)); @@ -7269,6 +7427,35 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecod return (long)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_some(o); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_none(); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + COption_u64Z_free(_res_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(orig_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKDirectionalChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); @@ -8055,6 +8242,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_ return (long)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1); + FREE((void*)o); + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_none(); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + COption_C2Tuple_usizeTransactionZZ_free(_res_conv); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv *env, jclass clz) { LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_ok(); @@ -10504,6 +10714,100 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jcla Filter_free(this_ptr_conv); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKWatchedOutput this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + WatchedOutput_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + WatchedOutput_set_block_hash(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKOutPoint val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + val_conv = OutPoint_clone(&val_conv); + WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv *env, jclass clz, int8_tArray block_hash_arg, int64_t outpoint_arg, int8_tArray script_pubkey_arg) { + LDKThirtyTwoBytes block_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, block_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, block_hash_arg, 0, 32, block_hash_arg_ref.data); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); + outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKCVec_u8Z script_pubkey_arg_ref; + script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg); + script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data); + LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(((uint64_t)this_ptr) & ~1); @@ -11929,6 +12233,25 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + 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); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); +} + JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -17881,6 +18204,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1p HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new(JNIEnv *env, jclass clz, jboolean offered_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, int64_t transaction_output_index_arg) { + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data); + LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1); + FREE((void*)transaction_output_index_arg); + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKHTLCOutputInCommitment orig_conv; orig_conv.inner = (void*)(orig & (~1)); @@ -19367,6 +19725,66 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1 RouteHint_set_cltv_expiry_delta(&this_ptr_conv, val); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHint this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHint_get_htlc_minimum_msat(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHint this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + RouteHint_set_htlc_minimum_msat(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRouteHint this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHint_get_htlc_maximum_msat(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKRouteHint this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + RouteHint_set_htlc_maximum_msat(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg) { + LDKPublicKey src_node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, src_node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, src_node_id_arg, 0, 33, src_node_id_arg_ref.compressed_form); + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = (void*)(fees_arg & (~1)); + fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1); + FREE((void*)htlc_minimum_msat_arg); + LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1); + FREE((void*)htlc_maximum_msat_arg); + LDKRouteHint ret_var = RouteHint_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteHint orig_conv; orig_conv.inner = (void*)(orig & (~1)); @@ -19664,6 +20082,25 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1h DirectionalChannelInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDirectionalChannelInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = DirectionalChannelInfo_get_htlc_maximum_msat(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDirectionalChannelInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + DirectionalChannelInfo_set_htlc_maximum_msat(&this_ptr_conv, val_conv); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -19714,6 +20151,27 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l DirectionalChannelInfo_set_last_update_message(&this_ptr_conv, val_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new(JNIEnv *env, jclass clz, int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int64_t last_update_message_arg) { + LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1); + FREE((void*)htlc_maximum_msat_arg); + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = (void*)(fees_arg & (~1)); + fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + LDKChannelUpdate last_update_message_arg_conv; + last_update_message_arg_conv.inner = (void*)(last_update_message_arg & (~1)); + last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0); + last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); + LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_message_arg_conv); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDirectionalChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); @@ -19869,6 +20327,25 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -19894,6 +20371,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *env, jclass clz, int64_t features_arg, int8_tArray node_one_arg, int64_t one_to_two_arg, int8_tArray node_two_arg, int64_t two_to_one_arg, int64_t capacity_sats_arg, int64_t announcement_message_arg) { + LDKChannelFeatures features_arg_conv; + features_arg_conv.inner = (void*)(features_arg & (~1)); + features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + features_arg_conv = ChannelFeatures_clone(&features_arg_conv); + LDKPublicKey node_one_arg_ref; + CHECK((*env)->GetArrayLength(env, node_one_arg) == 33); + (*env)->GetByteArrayRegion(env, node_one_arg, 0, 33, node_one_arg_ref.compressed_form); + LDKDirectionalChannelInfo one_to_two_arg_conv; + one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1)); + one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0); + one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv); + LDKPublicKey node_two_arg_ref; + CHECK((*env)->GetArrayLength(env, node_two_arg) == 33); + (*env)->GetByteArrayRegion(env, node_two_arg, 0, 33, node_two_arg_ref.compressed_form); + LDKDirectionalChannelInfo two_to_one_arg_conv; + two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1)); + two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0); + two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv); + LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1); + FREE((void*)capacity_sats_arg); + LDKChannelAnnouncement announcement_message_arg_conv; + announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); + announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv); + LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_ref, one_to_two_arg_conv, node_two_arg_ref, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index cb791791..7ae607ba 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -239,6 +239,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErr JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_u32Z_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_u32Z; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok @@ -751,6 +759,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDeco JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_u64Z_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_u64Z; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok @@ -1519,6 +1535,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_C2Tuple_usizeTransactionZZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeTransactionZZ_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKAPIError_ref_from_ptr @@ -2898,10 +2922,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx /* * Class: org_ldk_impl_bindings * Method: Filter_register_output - * Signature: (JJ[B)V + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output - (JNIEnv *, jclass, jlong, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -3383,6 +3407,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_u32Z_some + * Signature: (I)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1some + (JNIEnv *, jclass, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_u32Z_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_u32Z_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_u32Z_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_HTLCOutputInCommitmentDecodeErrorZ_ok @@ -3991,6 +4047,38 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeEr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_u64Z_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_u64Z_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_u64Z_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_u64Z_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_DirectionalChannelInfoDecodeErrorZ_ok @@ -4623,6 +4711,30 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1fr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_usizeTransactionZZ_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_usizeTransactionZZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_usizeTransactionZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneAPIErrorZ_ok @@ -6791,6 +6903,70 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: WatchedOutput_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: WatchedOutput_get_block_hash + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1block_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: WatchedOutput_set_block_hash + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1hash + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: WatchedOutput_get_outpoint + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoint + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: WatchedOutput_set_outpoint + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: WatchedOutput_get_script_pubkey + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1script_1pubkey + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: WatchedOutput_set_script_pubkey + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pubkey + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: WatchedOutput_new + * Signature: ([BJ[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new + (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: BroadcasterInterface_free @@ -7791,6 +7967,22 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1cha JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_get_short_channel_id + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1channel_1id + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_set_short_channel_id + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_get_remote_network_id @@ -12295,6 +12487,30 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash (JNIEnv *, jclass, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: HTLCOutputInCommitment_get_transaction_output_index + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1transaction_1output_1index + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCOutputInCommitment_set_transaction_output_index + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1transaction_1output_1index + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCOutputInCommitment_new + * Signature: (ZJI[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new + (JNIEnv *, jclass, jboolean, jlong, jint, jbyteArray, jlong); + /* * Class: org_ldk_impl_bindings * Method: HTLCOutputInCommitment_clone @@ -13319,6 +13535,46 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta (JNIEnv *, jclass, jlong, jshort); +/* + * Class: org_ldk_impl_bindings + * Method: RouteHint_get_htlc_minimum_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RouteHint_set_htlc_minimum_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RouteHint_get_htlc_maximum_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RouteHint_set_htlc_maximum_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RouteHint_new + * Signature: ([BJJSJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1new + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jshort, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: RouteHint_clone @@ -13495,6 +13751,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: DirectionalChannelInfo_get_htlc_maximum_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DirectionalChannelInfo_set_htlc_maximum_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: DirectionalChannelInfo_get_fees @@ -13527,6 +13799,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update_1message (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: DirectionalChannelInfo_new + * Signature: (IZSJJJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new + (JNIEnv *, jclass, jint, jboolean, jshort, jlong, jlong, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: DirectionalChannelInfo_clone @@ -13639,6 +13919,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1on JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelInfo_get_capacity_sats + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelInfo_set_capacity_sats + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelInfo_get_announcement_message @@ -13655,6 +13951,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcemen JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelInfo_new + * Signature: (J[BJ[BJJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlong, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelInfo_clone diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_usizeTransactionZZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_usizeTransactionZZ.h new file mode 100644 index 00000000..53ef8b36 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_C2Tuple_usizeTransactionZZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_C2Tuple_usizeTransactionZZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_usizeTransactionZZ +#define _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_usizeTransactionZZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_C2Tuple_usizeTransactionZZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1usizeTransactionZZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_u32Z.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_u32Z.h new file mode 100644 index 00000000..7962c41f --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_u32Z.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_u32Z */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_u32Z +#define _Included_org_ldk_impl_bindings_LDKCOption_u32Z +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_u32Z + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u32Z_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_u64Z.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_u64Z.h new file mode 100644 index 00000000..cc608806 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_u64Z.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_u64Z */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_u64Z +#define _Included_org_ldk_impl_bindings_LDKCOption_u64Z +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_u64Z + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u64Z_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/ts/bindings.c b/ts/bindings.c index 91bffd57..2c59d200 100644 --- a/ts/bindings.c +++ b/ts/bindings.c @@ -279,6 +279,18 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErr uint32_t err_conv = LDKSecp256k1Error_to_js((*val->contents.err)); return err_conv; } +uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u32Z_ref_from_ptr(uint32_t ptr) { + LDKCOption_u32Z *obj = (LDKCOption_u32Z*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_u32Z_Some: { + return 0 /* LDKCOption_u32Z - Some */; (void) obj->some; + } + case LDKCOption_u32Z_None: { + return 0 /* LDKCOption_u32Z - None */; + } + default: abort(); + } +} jboolean __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(uint32_t arg) { return ((LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)arg)->result_ok; } @@ -444,7 +456,7 @@ void __attribute__((visibility("default"))) TS_LDKCResult_CVec_SignatureZNoneZ_ return *val->contents.err; } uint32_t __attribute__((visibility("default"))) TS_LDKErrorAction_ref_from_ptr(uint32_t ptr) { - LDKErrorAction *obj = (LDKErrorAction*)ptr; + LDKErrorAction *obj = (LDKErrorAction*)(ptr & ~1); switch(obj->tag) { case LDKErrorAction_DisconnectPeer: { LDKErrorMessage msg_var = obj->disconnect_peer.msg; @@ -467,7 +479,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKErrorAction_ref_from_ptr(u } } uint32_t __attribute__((visibility("default"))) TS_LDKHTLCFailChannelUpdate_ref_from_ptr(uint32_t ptr) { - LDKHTLCFailChannelUpdate *obj = (LDKHTLCFailChannelUpdate*)ptr; + LDKHTLCFailChannelUpdate *obj = (LDKHTLCFailChannelUpdate*)(ptr & ~1); switch(obj->tag) { case LDKHTLCFailChannelUpdate_ChannelUpdateMessage: { LDKChannelUpdate msg_var = obj->channel_update_message.msg; @@ -488,7 +500,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKHTLCFailChannelUpdate_ref_ } } uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ptr(uint32_t ptr) { - LDKMessageSendEvent *obj = (LDKMessageSendEvent*)ptr; + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); switch(obj->tag) { case LDKMessageSendEvent_SendAcceptChannel: { int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); @@ -964,6 +976,18 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDeco long err_ref = (long)err_var.inner & ~1; return err_ref; } +uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u64Z_ref_from_ptr(uint32_t ptr) { + LDKCOption_u64Z *obj = (LDKCOption_u64Z*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_u64Z_Some: { + return 0 /* LDKCOption_u64Z - Some */; (void) obj->some; + } + case LDKCOption_u64Z_None: { + return 0 /* LDKCOption_u64Z - None */; + } + default: abort(); + } +} jboolean __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(uint32_t arg) { return ((LDKCResult_DirectionalChannelInfoDecodeErrorZ*)arg)->result_ok; } @@ -1028,7 +1052,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecode return err_ref; } uint32_t __attribute__((visibility("default"))) TS_LDKNetAddress_ref_from_ptr(uint32_t ptr) { - LDKNetAddress *obj = (LDKNetAddress*)ptr; + LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); switch(obj->tag) { case LDKNetAddress_IPv4: { int8_tArray addr_arr = init_arr(4, sizeof(uint8_t), "Native int8_tArray Bytes"); @@ -1213,13 +1237,21 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneChannelMonito return err_conv; } uint32_t __attribute__((visibility("default"))) TS_LDKMonitorEvent_ref_from_ptr(uint32_t ptr) { - LDKMonitorEvent *obj = (LDKMonitorEvent*)ptr; + LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); switch(obj->tag) { case LDKMonitorEvent_HTLCEvent: { - return 0 /* LDKMonitorEvent - HTLCEvent */; + LDKHTLCUpdate htlc_event_var = obj->htlc_event; + CHECK((((long)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long htlc_event_ref = (long)htlc_event_var.inner & ~1; + return 0 /* LDKMonitorEvent - HTLCEvent */; (void) htlc_event_ref; } case LDKMonitorEvent_CommitmentTxBroadcasted: { - return 0 /* LDKMonitorEvent - CommitmentTxBroadcasted */; + LDKOutPoint commitment_tx_broadcasted_var = obj->commitment_tx_broadcasted; + CHECK((((long)commitment_tx_broadcasted_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&commitment_tx_broadcasted_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long commitment_tx_broadcasted_ref = (long)commitment_tx_broadcasted_var.inner & ~1; + return 0 /* LDKMonitorEvent - CommitmentTxBroadcasted */; (void) commitment_tx_broadcasted_ref; } default: abort(); } @@ -1249,7 +1281,7 @@ static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_Monit return ret; } uint32_t __attribute__((visibility("default"))) TS_LDKSpendableOutputDescriptor_ref_from_ptr(uint32_t ptr) { - LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)ptr; + LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)(ptr & ~1); switch(obj->tag) { case LDKSpendableOutputDescriptor_StaticOutput: { LDKOutPoint outpoint_var = obj->static_output.outpoint; @@ -1260,10 +1292,18 @@ uint32_t __attribute__((visibility("default"))) TS_LDKSpendableOutputDescriptor_ return 0 /* LDKSpendableOutputDescriptor - StaticOutput */; (void) outpoint_ref; (void) (long)output_ref; } case LDKSpendableOutputDescriptor_DelayedPaymentOutput: { - return 0 /* LDKSpendableOutputDescriptor - DelayedPaymentOutput */; + LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output; + CHECK((((long)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long delayed_payment_output_ref = (long)delayed_payment_output_var.inner & ~1; + return 0 /* LDKSpendableOutputDescriptor - DelayedPaymentOutput */; (void) delayed_payment_output_ref; } case LDKSpendableOutputDescriptor_StaticPaymentOutput: { - return 0 /* LDKSpendableOutputDescriptor - StaticPaymentOutput */; + LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output; + CHECK((((long)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long static_payment_output_ref = (long)static_payment_output_var.inner & ~1; + return 0 /* LDKSpendableOutputDescriptor - StaticPaymentOutput */; (void) static_payment_output_ref; } default: abort(); } @@ -1293,7 +1333,7 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ return ret; } uint32_t __attribute__((visibility("default"))) TS_LDKEvent_ref_from_ptr(uint32_t ptr) { - LDKEvent *obj = (LDKEvent*)ptr; + LDKEvent *obj = (LDKEvent*)(ptr & ~1); switch(obj->tag) { case LDKEvent_FundingGenerationReady: { int8_tArray temporary_channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); @@ -2152,8 +2192,21 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxOutAccessErrorZ uint32_t err_conv = LDKAccessError_to_js((*val->contents.err)); return err_conv; } +uint32_t __attribute__((visibility("default"))) TS_LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr(uint32_t ptr) { + LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_C2Tuple_usizeTransactionZZ_Some: { + long some_ref = (long)(&obj->some) | 1; + return 0 /* LDKCOption_C2Tuple_usizeTransactionZZ - Some */; (void) some_ref; + } + case LDKCOption_C2Tuple_usizeTransactionZZ_None: { + return 0 /* LDKCOption_C2Tuple_usizeTransactionZZ - None */; + } + default: abort(); + } +} uint32_t __attribute__((visibility("default"))) TS_LDKAPIError_ref_from_ptr(uint32_t ptr) { - LDKAPIError *obj = (LDKAPIError*)ptr; + LDKAPIError *obj = (LDKAPIError*)(ptr & ~1); switch(obj->tag) { case LDKAPIError_APIMisuseError: { LDKCVec_u8Z err_var = obj->api_misuse_error.err; @@ -2273,19 +2326,45 @@ static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_C return ret; } uint32_t __attribute__((visibility("default"))) TS_LDKPaymentSendFailure_ref_from_ptr(uint32_t ptr) { - LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)ptr; + LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)(ptr & ~1); switch(obj->tag) { case LDKPaymentSendFailure_ParameterError: { - return 0 /* LDKPaymentSendFailure - ParameterError */; + long parameter_error_ref = ((long)&obj->parameter_error) | 1; + return 0 /* LDKPaymentSendFailure - ParameterError */; (void) parameter_error_ref; } case LDKPaymentSendFailure_PathParameterError: { - return 0 /* LDKPaymentSendFailure - PathParameterError */; + LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error; + uint32_tArray path_parameter_error_arr = init_arr(path_parameter_error_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); + uint32_t *path_parameter_error_arr_ptr = (uint32_t*)(path_parameter_error_arr + 4); + for (size_t w = 0; w < path_parameter_error_var.datalen; w++) { + LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w]; + *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv); + path_parameter_error_arr_ptr[w] = (long)path_parameter_error_conv_22_conv; + } + return 0 /* LDKPaymentSendFailure - PathParameterError */; (void) path_parameter_error_arr; } case LDKPaymentSendFailure_AllFailedRetrySafe: { - return 0 /* LDKPaymentSendFailure - AllFailedRetrySafe */; + LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe; + uint32_tArray all_failed_retry_safe_arr = init_arr(all_failed_retry_safe_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); + uint32_t *all_failed_retry_safe_arr_ptr = (uint32_t*)(all_failed_retry_safe_arr + 4); + for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) { + long all_failed_retry_safe_conv_10_ref = ((long)&all_failed_retry_safe_var.data[k]) | 1; + all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref; + } + return 0 /* LDKPaymentSendFailure - AllFailedRetrySafe */; (void) all_failed_retry_safe_arr; } case LDKPaymentSendFailure_PartialFailure: { - return 0 /* LDKPaymentSendFailure - PartialFailure */; + LDKCVec_CResult_NoneAPIErrorZZ partial_failure_var = obj->partial_failure; + uint32_tArray partial_failure_arr = init_arr(partial_failure_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); + uint32_t *partial_failure_arr_ptr = (uint32_t*)(partial_failure_arr + 4); + for (size_t w = 0; w < partial_failure_var.datalen; w++) { + LDKCResult_NoneAPIErrorZ* partial_failure_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *partial_failure_conv_22_conv = partial_failure_var.data[w]; + *partial_failure_conv_22_conv = CResult_NoneAPIErrorZ_clone(partial_failure_conv_22_conv); + partial_failure_arr_ptr[w] = (long)partial_failure_conv_22_conv; + } + return 0 /* LDKPaymentSendFailure - PartialFailure */; (void) partial_failure_arr; } default: abort(); } @@ -4089,20 +4168,19 @@ void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32 memcpy((uint8_t*)(script_pubkey_arr + 4), script_pubkey_var.data, script_pubkey_var.datalen); js_invoke_function_2(j_calls->register_tx_meth, txid_arr, script_pubkey_arr); } -void register_output_LDKFilter_jcall(const void* this_arg, const LDKOutPoint * outpoint, LDKu8slice script_pubkey) { +LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; - LDKOutPoint outpoint_var = *outpoint; - outpoint_var = OutPoint_clone(outpoint); - CHECK((((long)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long outpoint_ref = (long)outpoint_var.inner; - if (outpoint_var.is_owned) { - outpoint_ref |= 1; - } - LDKu8slice script_pubkey_var = script_pubkey; - int8_tArray script_pubkey_arr = init_arr(script_pubkey_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(script_pubkey_arr + 4), script_pubkey_var.data, script_pubkey_var.datalen); - js_invoke_function_2(j_calls->register_output_meth, outpoint_ref, script_pubkey_arr); + LDKWatchedOutput output_var = output; + CHECK((((long)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long output_ref = (long)output_var.inner; + if (output_var.is_owned) { + output_ref |= 1; + } + LDKCOption_C2Tuple_usizeTransactionZZ* ret = (LDKCOption_C2Tuple_usizeTransactionZZ*)js_invoke_function_1(j_calls->register_output_meth, output_ref); + LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1); + // Warning: we may need a move here but no clone is available for LDKCOption_C2Tuple_usizeTransactionZZ + return ret_conv; } static void* LDKFilter_JCalls_clone(const void* this_arg) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; @@ -4139,15 +4217,16 @@ void __attribute__((visibility("default"))) TS_Filter_register_tx(uint32_t this (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref); } -void __attribute__((visibility("default"))) TS_Filter_register_output(uint32_t this_arg, uint32_t outpoint, int8_tArray script_pubkey) { +uint32_t __attribute__((visibility("default"))) TS_Filter_register_output(uint32_t this_arg, uint32_t output) { LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1); - LDKOutPoint outpoint_conv; - outpoint_conv.inner = (void*)(outpoint & (~1)); - outpoint_conv.is_owned = false; - LDKu8slice script_pubkey_ref; - script_pubkey_ref.datalen = *((uint32_t*)script_pubkey); - script_pubkey_ref.data = (int8_t*)(script_pubkey + 4); - (this_arg_conv->register_output)(this_arg_conv->this_arg, &outpoint_conv, script_pubkey_ref); + LDKWatchedOutput output_conv; + output_conv.inner = (void*)(output & (~1)); + output_conv.is_owned = (output & 1) || (output == 0); + // Warning: we need a move here but no clone is available for LDKWatchedOutput + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv); + long ret_ref = (long)ret_copy; + return ret_ref; } typedef struct LDKPersist_JCalls { @@ -5504,6 +5583,35 @@ void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_fre CResult_TxCreationKeysErrorZ_free(_res_conv); } +uint32_t __attribute__((visibility("default"))) TS_COption_u32Z_some(int32_t o) { + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_some(o); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_u32Z_none() { + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_none(); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_COption_u32Z_free(uint32_t _res) { + if ((_res & 1) != 0) return; + LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + COption_u32Z_free(_res_conv); +} + +uint32_t __attribute__((visibility("default"))) TS_COption_u32Z_clone(uint32_t orig) { + LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)orig; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_clone(orig_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(uint32_t o) { LDKHTLCOutputInCommitment o_conv; o_conv.inner = (void*)(o & (~1)); @@ -6195,6 +6303,35 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeE return (long)ret_conv; } +uint32_t __attribute__((visibility("default"))) TS_COption_u64Z_some(int64_t o) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_some(o); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_u64Z_none() { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_none(); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_COption_u64Z_free(uint32_t _res) { + if ((_res & 1) != 0) return; + LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + COption_u64Z_free(_res_conv); +} + +uint32_t __attribute__((visibility("default"))) TS_COption_u64Z_clone(uint32_t orig) { + LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(orig_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_ok(uint32_t o) { LDKDirectionalChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); @@ -6970,6 +7107,29 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_cl return (long)ret_conv; } +uint32_t __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_some(uint32_t o) { + LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1); + FREE((void*)o); + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_none() { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_none(); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + COption_C2Tuple_usizeTransactionZZ_free(_res_conv); +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_ok() { LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_ok(); @@ -9406,6 +9566,100 @@ void __attribute__((visibility("default"))) TS_Filter_free(uint32_t this_ptr) { Filter_free(this_ptr_conv); } +void __attribute__((visibility("default"))) TS_WatchedOutput_free(uint32_t this_obj) { + LDKWatchedOutput this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + WatchedOutput_free(this_obj_conv); +} + +int8_tArray __attribute__((visibility("default"))) TS_WatchedOutput_get_block_hash(uint32_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(ret_arr + 4), WatchedOutput_get_block_hash(&this_ptr_conv).data, 32); + return ret_arr; +} + +void __attribute__((visibility("default"))) TS_WatchedOutput_set_block_hash(uint32_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKThirtyTwoBytes val_ref; + CHECK(*((uint32_t*)val) == 32); + memcpy(val_ref.data, (uint8_t*)(val + 4), 32); + WatchedOutput_set_block_hash(&this_ptr_conv, val_ref); +} + +uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_get_outpoint(uint32_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_WatchedOutput_set_outpoint(uint32_t this_ptr, uint32_t val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKOutPoint val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + val_conv = OutPoint_clone(&val_conv); + WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); +} + +int8_tArray __attribute__((visibility("default"))) TS_WatchedOutput_get_script_pubkey(uint32_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); + int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); + return ret_arr; +} + +void __attribute__((visibility("default"))) TS_WatchedOutput_set_script_pubkey(uint32_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCVec_u8Z val_ref; + val_ref.datalen = *((uint32_t*)val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, (uint8_t*)(val + 4), val_ref.datalen); + WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); +} + +uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_new(int8_tArray block_hash_arg, uint32_t outpoint_arg, int8_tArray script_pubkey_arg) { + LDKThirtyTwoBytes block_hash_arg_ref; + CHECK(*((uint32_t*)block_hash_arg) == 32); + memcpy(block_hash_arg_ref.data, (uint8_t*)(block_hash_arg + 4), 32); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); + outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKCVec_u8Z script_pubkey_arg_ref; + script_pubkey_arg_ref.datalen = *((uint32_t*)script_pubkey_arg); + script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(script_pubkey_arg_ref.data, (uint8_t*)(script_pubkey_arg + 4), script_pubkey_arg_ref.datalen); + LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + void __attribute__((visibility("default"))) TS_BroadcasterInterface_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(((uint64_t)this_ptr) & ~1); @@ -10773,6 +11027,25 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_channel_id(ui ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); } +uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_short_channel_id(uint32_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + 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); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_ChannelDetails_set_short_channel_id(uint32_t this_ptr, uint32_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); +} + int8_tArray __attribute__((visibility("default"))) TS_ChannelDetails_get_remote_network_id(uint32_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -16585,6 +16858,41 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_payme HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); } +uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_get_transaction_output_index(uint32_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_transaction_output_index(uint32_t this_ptr, uint32_t val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv); +} + +uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_new(jboolean offered_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, uint32_t transaction_output_index_arg) { + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK(*((uint32_t*)payment_hash_arg) == 32); + memcpy(payment_hash_arg_ref.data, (uint8_t*)(payment_hash_arg + 4), 32); + LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1); + FREE((void*)transaction_output_index_arg); + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_clone(uint32_t orig) { LDKHTLCOutputInCommitment orig_conv; orig_conv.inner = (void*)(orig & (~1)); @@ -18060,6 +18368,66 @@ void __attribute__((visibility("default"))) TS_RouteHint_set_cltv_expiry_delta( RouteHint_set_cltv_expiry_delta(&this_ptr_conv, val); } +uint32_t __attribute__((visibility("default"))) TS_RouteHint_get_htlc_minimum_msat(uint32_t this_ptr) { + LDKRouteHint this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHint_get_htlc_minimum_msat(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_RouteHint_set_htlc_minimum_msat(uint32_t this_ptr, uint32_t val) { + LDKRouteHint this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + RouteHint_set_htlc_minimum_msat(&this_ptr_conv, val_conv); +} + +uint32_t __attribute__((visibility("default"))) TS_RouteHint_get_htlc_maximum_msat(uint32_t this_ptr) { + LDKRouteHint this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHint_get_htlc_maximum_msat(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_RouteHint_set_htlc_maximum_msat(uint32_t this_ptr, uint32_t val) { + LDKRouteHint this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + RouteHint_set_htlc_maximum_msat(&this_ptr_conv, val_conv); +} + +uint32_t __attribute__((visibility("default"))) TS_RouteHint_new(int8_tArray src_node_id_arg, int64_t short_channel_id_arg, uint32_t fees_arg, int16_t cltv_expiry_delta_arg, uint32_t htlc_minimum_msat_arg, uint32_t htlc_maximum_msat_arg) { + LDKPublicKey src_node_id_arg_ref; + CHECK(*((uint32_t*)src_node_id_arg) == 33); + memcpy(src_node_id_arg_ref.compressed_form, (uint8_t*)(src_node_id_arg + 4), 33); + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = (void*)(fees_arg & (~1)); + fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1); + FREE((void*)htlc_minimum_msat_arg); + LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1); + FREE((void*)htlc_maximum_msat_arg); + LDKRouteHint ret_var = RouteHint_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + uint32_t __attribute__((visibility("default"))) TS_RouteHint_clone(uint32_t orig) { LDKRouteHint orig_conv; orig_conv.inner = (void*)(orig & (~1)); @@ -18331,6 +18699,25 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_htlc_ DirectionalChannelInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } +uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_htlc_maximum_msat(uint32_t this_ptr) { + LDKDirectionalChannelInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = DirectionalChannelInfo_get_htlc_maximum_msat(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_htlc_maximum_msat(uint32_t this_ptr, uint32_t val) { + LDKDirectionalChannelInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + DirectionalChannelInfo_set_htlc_maximum_msat(&this_ptr_conv, val_conv); +} + uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_fees(uint32_t this_ptr) { LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -18381,6 +18768,27 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_last_ DirectionalChannelInfo_set_last_update_message(&this_ptr_conv, val_conv); } +uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_new(int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, uint32_t htlc_maximum_msat_arg, uint32_t fees_arg, uint32_t last_update_message_arg) { + LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1); + FREE((void*)htlc_maximum_msat_arg); + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = (void*)(fees_arg & (~1)); + fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + LDKChannelUpdate last_update_message_arg_conv; + last_update_message_arg_conv.inner = (void*)(last_update_message_arg & (~1)); + last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0); + last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); + LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_message_arg_conv); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_clone(uint32_t orig) { LDKDirectionalChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); @@ -18535,6 +18943,25 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_two_to_one(uint3 ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } +uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_capacity_sats(uint32_t this_ptr) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_ChannelInfo_set_capacity_sats(uint32_t this_ptr, uint32_t val) { + LDKChannelInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1); + FREE((void*)val); + ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); +} + uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_announcement_message(uint32_t this_ptr) { LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -18560,6 +18987,41 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_announcement_mes ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } +uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_new(uint32_t features_arg, int8_tArray node_one_arg, uint32_t one_to_two_arg, int8_tArray node_two_arg, uint32_t two_to_one_arg, uint32_t capacity_sats_arg, uint32_t announcement_message_arg) { + LDKChannelFeatures features_arg_conv; + features_arg_conv.inner = (void*)(features_arg & (~1)); + features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + features_arg_conv = ChannelFeatures_clone(&features_arg_conv); + LDKPublicKey node_one_arg_ref; + CHECK(*((uint32_t*)node_one_arg) == 33); + memcpy(node_one_arg_ref.compressed_form, (uint8_t*)(node_one_arg + 4), 33); + LDKDirectionalChannelInfo one_to_two_arg_conv; + one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1)); + one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0); + one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv); + LDKPublicKey node_two_arg_ref; + CHECK(*((uint32_t*)node_two_arg) == 33); + memcpy(node_two_arg_ref.compressed_form, (uint8_t*)(node_two_arg + 4), 33); + LDKDirectionalChannelInfo two_to_one_arg_conv; + two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1)); + two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0); + two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv); + LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1); + FREE((void*)capacity_sats_arg); + LDKChannelAnnouncement announcement_message_arg_conv; + announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); + announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv); + LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_ref, one_to_two_arg_conv, node_two_arg_ref, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv); + CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long ret_ref = (long)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_clone(uint32_t orig) { LDKChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); diff --git a/ts/bindings.ts b/ts/bindings.ts index 6de31bc4..78842cba 100644 --- a/ts/bindings.ts +++ b/ts/bindings.ts @@ -167,6 +167,19 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_TxCreationKeysErrorZ_result_ok(long arg); public static native number LDKCResult_TxCreationKeysErrorZ_get_ok(long arg); public static native LDKSecp256k1Error LDKCResult_TxCreationKeysErrorZ_get_err(long arg); + public static class LDKCOption_u32Z { + private LDKCOption_u32Z() {} + export class Some extends LDKCOption_u32Z { + public number some; + Some(number some) { this.some = some; } + } + export class None extends LDKCOption_u32Z { + None() { } + } + static native void init(); + } + static { LDKCOption_u32Z.init(); } + public static native LDKCOption_u32Z LDKCOption_u32Z_ref_from_ptr(long ptr); public static native boolean LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(long arg); @@ -363,6 +376,19 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_ChannelConfigDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ChannelConfigDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ChannelConfigDecodeErrorZ_get_err(long arg); + public static class LDKCOption_u64Z { + private LDKCOption_u64Z() {} + export class Some extends LDKCOption_u64Z { + public number some; + Some(number some) { this.some = some; } + } + export class None extends LDKCOption_u64Z { + None() { } + } + static native void init(); + } + static { LDKCOption_u64Z.init(); } + public static native LDKCOption_u64Z LDKCOption_u64Z_ref_from_ptr(long ptr); public static native boolean LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_err(long arg); @@ -421,10 +447,12 @@ public static native long new_empty_slice_vec(); public static class LDKMonitorEvent { private LDKMonitorEvent() {} export class HTLCEvent extends LDKMonitorEvent { - HTLCEvent() { } + public number htlc_event; + HTLCEvent(number htlc_event) { this.htlc_event = htlc_event; } } export class CommitmentTxBroadcasted extends LDKMonitorEvent { - CommitmentTxBroadcasted() { } + public number commitment_tx_broadcasted; + CommitmentTxBroadcasted(number commitment_tx_broadcasted) { this.commitment_tx_broadcasted = commitment_tx_broadcasted; } } static native void init(); } @@ -439,10 +467,12 @@ public static native long new_empty_slice_vec(); StaticOutput(number outpoint, number output) { this.outpoint = outpoint; this.output = output; } } export class DelayedPaymentOutput extends LDKSpendableOutputDescriptor { - DelayedPaymentOutput() { } + public number delayed_payment_output; + DelayedPaymentOutput(number delayed_payment_output) { this.delayed_payment_output = delayed_payment_output; } } export class StaticPaymentOutput extends LDKSpendableOutputDescriptor { - StaticPaymentOutput() { } + public number static_payment_output; + StaticPaymentOutput(number static_payment_output) { this.static_payment_output = static_payment_output; } } static native void init(); } @@ -662,6 +692,19 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_TxOutAccessErrorZ_result_ok(long arg); public static native number LDKCResult_TxOutAccessErrorZ_get_ok(long arg); public static native LDKAccessError LDKCResult_TxOutAccessErrorZ_get_err(long arg); + public static class LDKCOption_C2Tuple_usizeTransactionZZ { + private LDKCOption_C2Tuple_usizeTransactionZZ() {} + export class Some extends LDKCOption_C2Tuple_usizeTransactionZZ { + public number some; + Some(number some) { this.some = some; } + } + export class None extends LDKCOption_C2Tuple_usizeTransactionZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_C2Tuple_usizeTransactionZZ.init(); } + public static native LDKCOption_C2Tuple_usizeTransactionZZ LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr(long ptr); public static class LDKAPIError { private LDKAPIError() {} export class APIMisuseError extends LDKAPIError { @@ -697,16 +740,20 @@ public static native long new_empty_slice_vec(); public static class LDKPaymentSendFailure { private LDKPaymentSendFailure() {} export class ParameterError extends LDKPaymentSendFailure { - ParameterError() { } + public number parameter_error; + ParameterError(number parameter_error) { this.parameter_error = parameter_error; } } export class PathParameterError extends LDKPaymentSendFailure { - PathParameterError() { } + public number[] path_parameter_error; + PathParameterError(number[] path_parameter_error) { this.path_parameter_error = path_parameter_error; } } export class AllFailedRetrySafe extends LDKPaymentSendFailure { - AllFailedRetrySafe() { } + public number[] all_failed_retry_safe; + AllFailedRetrySafe(number[] all_failed_retry_safe) { this.all_failed_retry_safe = all_failed_retry_safe; } } export class PartialFailure extends LDKPaymentSendFailure { - PartialFailure() { } + public number[] partial_failure; + PartialFailure(number[] partial_failure) { this.partial_failure = partial_failure; } } static native void init(); } @@ -1136,7 +1183,7 @@ public static native long new_empty_slice_vec(); export interface LDKFilter { register_tx (txid: Uint8Array, script_pubkey: Uint8Array): void; - register_output (outpoint: number, script_pubkey: Uint8Array): void; + register_output (output: number): number; } export function LDKFilter_new(impl: LDKFilter): number { @@ -1154,13 +1201,13 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Filter_register_tx(this_arg, encodeArray(txid), encodeArray(script_pubkey)); // debug statements here } - // void Filter_register_output LDKFilter *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey - export function Filter_register_output(this_arg: number, outpoint: number, script_pubkey: Uint8Array): void { + // LDKCOption_C2Tuple_usizeTransactionZZ Filter_register_output LDKFilter *NONNULL_PTR this_arg, struct LDKWatchedOutput output + export function Filter_register_output(this_arg: number, output: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Filter_register_output(this_arg, outpoint, encodeArray(script_pubkey)); - // debug statements here + const nativeResponseValue = wasm.Filter_register_output(this_arg, output); + return nativeResponseValue; } @@ -1707,6 +1754,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TxCreationKeysErrorZ_free(_res); // debug statements here } + // struct LDKCOption_u32Z COption_u32Z_some(uint32_t o); + export function COption_u32Z_some(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u32Z_some(o); + return nativeResponseValue; + } + // struct LDKCOption_u32Z COption_u32Z_none(void); + export function COption_u32Z_none(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u32Z_none(); + return nativeResponseValue; + } + // void COption_u32Z_free(struct LDKCOption_u32Z _res); + export function COption_u32Z_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u32Z_free(_res); + // debug statements here + } + // struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig); + export function COption_u32Z_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u32Z_clone(orig); + return nativeResponseValue; + } // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o); export function CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { @@ -2315,6 +2394,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelConfigDecodeErrorZ_clone(orig); return nativeResponseValue; } + // struct LDKCOption_u64Z COption_u64Z_some(uint64_t o); + export function COption_u64Z_some(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u64Z_some(o); + return nativeResponseValue; + } + // struct LDKCOption_u64Z COption_u64Z_none(void); + export function COption_u64Z_none(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u64Z_none(); + return nativeResponseValue; + } + // void COption_u64Z_free(struct LDKCOption_u64Z _res); + export function COption_u64Z_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u64Z_free(_res); + // debug statements here + } + // struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); + export function COption_u64Z_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u64Z_clone(orig); + return nativeResponseValue; + } // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o); export function CResult_DirectionalChannelInfoDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { @@ -2947,6 +3058,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TxOutAccessErrorZ_clone(orig); return nativeResponseValue; } + // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o); + export function COption_C2Tuple_usizeTransactionZZ_some(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_C2Tuple_usizeTransactionZZ_some(o); + return nativeResponseValue; + } + // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void); + export function COption_C2Tuple_usizeTransactionZZ_none(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_C2Tuple_usizeTransactionZZ_none(); + return nativeResponseValue; + } + // void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res); + export function COption_C2Tuple_usizeTransactionZZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_C2Tuple_usizeTransactionZZ_free(_res); + // debug statements here + } // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); export function CResult_NoneAPIErrorZ_ok(): number { if(!isWasmInitialized) { @@ -5115,6 +5250,70 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Filter_free(this_ptr); // debug statements here } + // void WatchedOutput_free(struct LDKWatchedOutput this_obj); + export function WatchedOutput_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.WatchedOutput_free(this_obj); + // debug statements here + } + // struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); + export function WatchedOutput_get_block_hash(this_ptr: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.WatchedOutput_get_block_hash(this_ptr); + return decodeArray(nativeResponseValue); + } + // void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + export function WatchedOutput_set_block_hash(this_ptr: number, val: Uint8Array): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.WatchedOutput_set_block_hash(this_ptr, encodeArray(val)); + // debug statements here + } + // struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); + export function WatchedOutput_get_outpoint(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.WatchedOutput_get_outpoint(this_ptr); + return nativeResponseValue; + } + // void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val); + export function WatchedOutput_set_outpoint(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.WatchedOutput_set_outpoint(this_ptr, val); + // debug statements here + } + // struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); + export function WatchedOutput_get_script_pubkey(this_ptr: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.WatchedOutput_get_script_pubkey(this_ptr); + return decodeArray(nativeResponseValue); + } + // void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); + export function WatchedOutput_set_script_pubkey(this_ptr: number, val: Uint8Array): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.WatchedOutput_set_script_pubkey(this_ptr, encodeArray(val)); + // debug statements here + } + // MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg); + export function WatchedOutput_new(block_hash_arg: Uint8Array, outpoint_arg: number, script_pubkey_arg: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.WatchedOutput_new(encodeArray(block_hash_arg), outpoint_arg, encodeArray(script_pubkey_arg)); + return nativeResponseValue; + } // void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr); export function BroadcasterInterface_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -6115,6 +6314,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelDetails_set_channel_id(this_ptr, encodeArray(val)); // debug statements here } + // struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + export function ChannelDetails_get_short_channel_id(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelDetails_get_short_channel_id(this_ptr); + return nativeResponseValue; + } + // void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + export function ChannelDetails_set_short_channel_id(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelDetails_set_short_channel_id(this_ptr, val); + // debug statements here + } // struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); export function ChannelDetails_get_remote_network_id(this_ptr: number): Uint8Array { if(!isWasmInitialized) { @@ -10619,6 +10834,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.HTLCOutputInCommitment_set_payment_hash(this_ptr, encodeArray(val)); // debug statements here } + // struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); + export function HTLCOutputInCommitment_get_transaction_output_index(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.HTLCOutputInCommitment_get_transaction_output_index(this_ptr); + return nativeResponseValue; + } + // void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + export function HTLCOutputInCommitment_set_transaction_output_index(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.HTLCOutputInCommitment_set_transaction_output_index(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg); + export function HTLCOutputInCommitment_new(offered_arg: boolean, amount_msat_arg: number, cltv_expiry_arg: number, payment_hash_arg: Uint8Array, transaction_output_index_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, encodeArray(payment_hash_arg), transaction_output_index_arg); + return nativeResponseValue; + } // struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig); export function HTLCOutputInCommitment_clone(orig: number): number { if(!isWasmInitialized) { @@ -11643,6 +11882,46 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RouteHint_set_cltv_expiry_delta(this_ptr, val); // debug statements here } + // struct LDKCOption_u64Z RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr); + export function RouteHint_get_htlc_minimum_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_get_htlc_minimum_msat(this_ptr); + return nativeResponseValue; + } + // void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + export function RouteHint_set_htlc_minimum_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_set_htlc_minimum_msat(this_ptr, val); + // debug statements here + } + // struct LDKCOption_u64Z RouteHint_get_htlc_maximum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr); + export function RouteHint_get_htlc_maximum_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_get_htlc_maximum_msat(this_ptr); + return nativeResponseValue; + } + // void RouteHint_set_htlc_maximum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + export function RouteHint_set_htlc_maximum_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_set_htlc_maximum_msat(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg); + export function RouteHint_new(src_node_id_arg: Uint8Array, short_channel_id_arg: number, fees_arg: number, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: number, htlc_maximum_msat_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_new(encodeArray(src_node_id_arg), short_channel_id_arg, fees_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg); + return nativeResponseValue; + } // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); export function RouteHint_clone(orig: number): number { if(!isWasmInitialized) { @@ -11819,6 +12098,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr, val); // debug statements here } + // struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); + export function DirectionalChannelInfo_get_htlc_maximum_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.DirectionalChannelInfo_get_htlc_maximum_msat(this_ptr); + return nativeResponseValue; + } + // void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + export function DirectionalChannelInfo_set_htlc_maximum_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.DirectionalChannelInfo_set_htlc_maximum_msat(this_ptr, val); + // debug statements here + } // struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); export function DirectionalChannelInfo_get_fees(this_ptr: number): number { if(!isWasmInitialized) { @@ -11851,6 +12146,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DirectionalChannelInfo_set_last_update_message(this_ptr, val); // debug statements here } + // MUST_USE_RES struct LDKDirectionalChannelInfo DirectionalChannelInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg); + export function DirectionalChannelInfo_new(last_update_arg: number, enabled_arg: boolean, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: number, htlc_maximum_msat_arg: number, fees_arg: number, last_update_message_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg, last_update_message_arg); + return nativeResponseValue; + } // struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig); export function DirectionalChannelInfo_clone(orig: number): number { if(!isWasmInitialized) { @@ -11963,6 +12266,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelInfo_set_two_to_one(this_ptr, val); // debug statements here } + // struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr); + export function ChannelInfo_get_capacity_sats(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelInfo_get_capacity_sats(this_ptr); + return nativeResponseValue; + } + // void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + export function ChannelInfo_set_capacity_sats(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelInfo_set_capacity_sats(this_ptr, val); + // debug statements here + } // struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr); export function ChannelInfo_get_announcement_message(this_ptr: number): number { if(!isWasmInitialized) { @@ -11979,6 +12298,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelInfo_set_announcement_message(this_ptr, val); // debug statements here } + // MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKPublicKey node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKPublicKey node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg); + export function ChannelInfo_new(features_arg: number, node_one_arg: Uint8Array, one_to_two_arg: number, node_two_arg: Uint8Array, two_to_one_arg: number, capacity_sats_arg: number, announcement_message_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelInfo_new(features_arg, encodeArray(node_one_arg), one_to_two_arg, encodeArray(node_two_arg), two_to_one_arg, capacity_sats_arg, announcement_message_arg); + return nativeResponseValue; + } // struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig); export function ChannelInfo_clone(orig: number): number { if(!isWasmInitialized) { diff --git a/ts/structs/APIError.ts b/ts/structs/APIError.ts index 5904b6c5..41033ebe 100644 --- a/ts/structs/APIError.ts +++ b/ts/structs/APIError.ts @@ -63,4 +63,12 @@ export class MonitorUpdateFailed extends APIError { private constructor(ptr: number, obj: bindings.LDKAPIError.MonitorUpdateFailed) { super(null, ptr); } +} + public APIError clone() { + number ret = bindings.APIError_clone(this.ptr); + APIError ret_hu_conv = APIError.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/ts/structs/ChannelDetails.ts b/ts/structs/ChannelDetails.ts index b7ef907c..fa57ebb1 100644 --- a/ts/structs/ChannelDetails.ts +++ b/ts/structs/ChannelDetails.ts @@ -27,6 +27,17 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ChannelDetails_set_channel_id(this.ptr, val); } + public Option_u64Z get_short_channel_id() { + number ret = bindings.ChannelDetails_get_short_channel_id(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public void set_short_channel_id(Option_u64Z val) { + bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr); + } + public Uint8Array get_remote_network_id() { Uint8Array ret = bindings.ChannelDetails_get_remote_network_id(this.ptr); return ret; diff --git a/ts/structs/ChannelInfo.ts b/ts/structs/ChannelInfo.ts index ea7a292f..c86fe579 100644 --- a/ts/structs/ChannelInfo.ts +++ b/ts/structs/ChannelInfo.ts @@ -72,6 +72,17 @@ import * as bindings from '../bindings' // TODO: figure out location this.ptrs_to.add(val); } + public Option_u64Z get_capacity_sats() { + number ret = bindings.ChannelInfo_get_capacity_sats(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public void set_capacity_sats(Option_u64Z val) { + bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr); + } + public ChannelAnnouncement get_announcement_message() { number ret = bindings.ChannelInfo_get_announcement_message(this.ptr); const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); @@ -84,6 +95,17 @@ import * as bindings from '../bindings' // TODO: figure out location this.ptrs_to.add(val); } + public static ChannelInfo constructor_new(ChannelFeatures features_arg, Uint8Array node_one_arg, DirectionalChannelInfo one_to_two_arg, Uint8Array node_two_arg, DirectionalChannelInfo two_to_one_arg, Option_u64Z capacity_sats_arg, ChannelAnnouncement announcement_message_arg) { + number ret = bindings.ChannelInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, node_one_arg, one_to_two_arg == null ? 0 : one_to_two_arg.ptr & ~1, node_two_arg, two_to_one_arg == null ? 0 : two_to_one_arg.ptr & ~1, capacity_sats_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1); + const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(features_arg); + ret_hu_conv.ptrs_to.add(one_to_two_arg); + ret_hu_conv.ptrs_to.add(two_to_one_arg); + ret_hu_conv.ptrs_to.add(announcement_message_arg); + return ret_hu_conv; + } + public ChannelInfo clone() { number ret = bindings.ChannelInfo_clone(this.ptr); const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret); diff --git a/ts/structs/DirectionalChannelInfo.ts b/ts/structs/DirectionalChannelInfo.ts index 903e56ec..9fb9c317 100644 --- a/ts/structs/DirectionalChannelInfo.ts +++ b/ts/structs/DirectionalChannelInfo.ts @@ -54,6 +54,17 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val); } + public Option_u64Z get_htlc_maximum_msat() { + number ret = bindings.DirectionalChannelInfo_get_htlc_maximum_msat(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public void set_htlc_maximum_msat(Option_u64Z val) { + bindings.DirectionalChannelInfo_set_htlc_maximum_msat(this.ptr, val.ptr); + } + public RoutingFees get_fees() { number ret = bindings.DirectionalChannelInfo_get_fees(this.ptr); const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); @@ -78,6 +89,15 @@ import * as bindings from '../bindings' // TODO: figure out location this.ptrs_to.add(val); } + public static DirectionalChannelInfo constructor_new(number last_update_arg, boolean enabled_arg, number cltv_expiry_delta_arg, number htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg, RoutingFees fees_arg, ChannelUpdate last_update_message_arg) { + number ret = bindings.DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg.ptr, fees_arg == null ? 0 : fees_arg.ptr & ~1, last_update_message_arg == null ? 0 : last_update_message_arg.ptr & ~1); + const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(fees_arg); + ret_hu_conv.ptrs_to.add(last_update_message_arg); + return ret_hu_conv; + } + public DirectionalChannelInfo clone() { number ret = bindings.DirectionalChannelInfo_clone(this.ptr); const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret); diff --git a/ts/structs/ErrorAction.ts b/ts/structs/ErrorAction.ts index fed9258c..25bf0917 100644 --- a/ts/structs/ErrorAction.ts +++ b/ts/structs/ErrorAction.ts @@ -47,4 +47,12 @@ export class SendErrorMessage extends ErrorAction { msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } +} + public ErrorAction clone() { + number ret = bindings.ErrorAction_clone(this.ptr); + ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/ts/structs/Event.ts b/ts/structs/Event.ts index e24c66e2..3648f399 100644 --- a/ts/structs/Event.ts +++ b/ts/structs/Event.ts @@ -108,4 +108,17 @@ export class SpendableOutputs extends Event { } this.outputs = outputs_conv_27_arr; } +} + public Event clone() { + number ret = bindings.Event_clone(this.ptr); + Event ret_hu_conv = Event.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public Uint8Array write() { + Uint8Array ret = bindings.Event_write(this.ptr); + return ret; + } + } diff --git a/ts/structs/Filter.ts b/ts/structs/Filter.ts index fa7bceb1..4b43e036 100644 --- a/ts/structs/Filter.ts +++ b/ts/structs/Filter.ts @@ -36,9 +36,12 @@ import * as bindings from '../bindings' // TODO: figure out location arg.register_tx(txid, script_pubkey); }, - register_output (outpoint: number, script_pubkey: Uint8Array): void { - const outpoint_hu_conv: OutPoint = new OutPoint(null, outpoint); - arg.register_output(outpoint_hu_conv, script_pubkey); + register_output (output: number): number { + const output_hu_conv: WatchedOutput = new WatchedOutput(null, output); + output_hu_conv.ptrs_to.add(this); + Option_C2Tuple_usizeTransactionZZ ret = arg.register_output(output_hu_conv); + result: number = ret.ptr; + return result; }, @@ -49,7 +52,7 @@ import * as bindings from '../bindings' // TODO: figure out location export interface FilterInterface { register_tx(txid: Uint8Array, script_pubkey: Uint8Array): void; - register_output(outpoint: OutPoint, script_pubkey: Uint8Array): void; + register_output(output: WatchedOutput): Option_C2Tuple_usizeTransactionZZ; } @@ -60,9 +63,12 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.Filter_register_tx(this.ptr, txid, script_pubkey); } - public void register_output(OutPoint outpoint, Uint8Array script_pubkey) { - bindings.Filter_register_output(this.ptr, outpoint == null ? 0 : outpoint.ptr & ~1, script_pubkey); - this.ptrs_to.add(outpoint); + public Option_C2Tuple_usizeTransactionZZ register_output(Uint8Array output_block_hash_arg, OutPoint output_outpoint_arg, Uint8Array output_script_pubkey_arg) { + number ret = bindings.Filter_register_output(this.ptr, bindings.WatchedOutput_new(output_block_hash_arg, output_outpoint_arg == null ? 0 : output_outpoint_arg.ptr & ~1, output_script_pubkey_arg)); + Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + ret_hu_conv.ptrs_to.add(output_outpoint_arg); + return ret_hu_conv; } } diff --git a/ts/structs/HTLCFailChannelUpdate.ts b/ts/structs/HTLCFailChannelUpdate.ts index 5f76a0df..b89c1462 100644 --- a/ts/structs/HTLCFailChannelUpdate.ts +++ b/ts/structs/HTLCFailChannelUpdate.ts @@ -50,4 +50,12 @@ export class NodeFailure extends HTLCFailChannelUpdate { this.node_id = obj.node_id; this.is_permanent = obj.is_permanent; } +} + public HTLCFailChannelUpdate clone() { + number ret = bindings.HTLCFailChannelUpdate_clone(this.ptr); + HTLCFailChannelUpdate ret_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/ts/structs/HTLCOutputInCommitment.ts b/ts/structs/HTLCOutputInCommitment.ts index 42c2eccf..2f0e42b1 100644 --- a/ts/structs/HTLCOutputInCommitment.ts +++ b/ts/structs/HTLCOutputInCommitment.ts @@ -54,6 +54,24 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val); } + public Option_u32Z get_transaction_output_index() { + number ret = bindings.HTLCOutputInCommitment_get_transaction_output_index(this.ptr); + Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public void set_transaction_output_index(Option_u32Z val) { + bindings.HTLCOutputInCommitment_set_transaction_output_index(this.ptr, val.ptr); + } + + public static HTLCOutputInCommitment constructor_new(boolean offered_arg, number amount_msat_arg, number cltv_expiry_arg, Uint8Array payment_hash_arg, Option_u32Z transaction_output_index_arg) { + number ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg, transaction_output_index_arg.ptr); + const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + public HTLCOutputInCommitment clone() { number ret = bindings.HTLCOutputInCommitment_clone(this.ptr); const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); diff --git a/ts/structs/MessageSendEvent.ts b/ts/structs/MessageSendEvent.ts index 38998e25..a2f96107 100644 --- a/ts/structs/MessageSendEvent.ts +++ b/ts/structs/MessageSendEvent.ts @@ -295,4 +295,12 @@ export class SendReplyChannelRange extends MessageSendEvent { msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } +} + public MessageSendEvent clone() { + number ret = bindings.MessageSendEvent_clone(this.ptr); + MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/ts/structs/MonitorEvent.ts b/ts/structs/MonitorEvent.ts index 1a6c1637..e226f96e 100644 --- a/ts/structs/MonitorEvent.ts +++ b/ts/structs/MonitorEvent.ts @@ -21,12 +21,30 @@ export default class MonitorEvent extends CommonBase { } export class HTLCEvent extends MonitorEvent { + public htlc_event: HTLCUpdate; private constructor(ptr: number, obj: bindings.LDKMonitorEvent.HTLCEvent) { super(null, ptr); + const htlc_event: number = obj.htlc_event; + const htlc_event_hu_conv: HTLCUpdate = new HTLCUpdate(null, htlc_event); + htlc_event_hu_conv.ptrs_to.add(this); + this.htlc_event = htlc_event_hu_conv; } } export class CommitmentTxBroadcasted extends MonitorEvent { + public commitment_tx_broadcasted: OutPoint; private constructor(ptr: number, obj: bindings.LDKMonitorEvent.CommitmentTxBroadcasted) { super(null, ptr); + const commitment_tx_broadcasted: number = obj.commitment_tx_broadcasted; + const commitment_tx_broadcasted_hu_conv: OutPoint = new OutPoint(null, commitment_tx_broadcasted); + commitment_tx_broadcasted_hu_conv.ptrs_to.add(this); + this.commitment_tx_broadcasted = commitment_tx_broadcasted_hu_conv; } +} + public MonitorEvent clone() { + number ret = bindings.MonitorEvent_clone(this.ptr); + MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/ts/structs/NetAddress.ts b/ts/structs/NetAddress.ts index 3de3d2ef..269741b9 100644 --- a/ts/structs/NetAddress.ts +++ b/ts/structs/NetAddress.ts @@ -65,4 +65,17 @@ export class OnionV3 extends NetAddress { this.version = obj.version; this.port = obj.port; } +} + public NetAddress clone() { + number ret = bindings.NetAddress_clone(this.ptr); + NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public Uint8Array write() { + Uint8Array ret = bindings.NetAddress_write(this.ptr); + return ret; + } + } diff --git a/ts/structs/Option_C2Tuple_usizeTransactionZZ.ts b/ts/structs/Option_C2Tuple_usizeTransactionZZ.ts new file mode 100644 index 00000000..fc0b9b70 --- /dev/null +++ b/ts/structs/Option_C2Tuple_usizeTransactionZZ.ts @@ -0,0 +1,55 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +export default class COption_C2Tuple_usizeTransactionZZ extends CommonBase { + protected constructor(_dummy: object, ptr: number) { super(ptr); } + protected finalize() { + super.finalize(); + if (this.ptr != 0) { bindings.COption_C2Tuple_usizeTransactionZZ_free(this.ptr); } + } + static constr_from_ptr(ptr: number): COption_C2Tuple_usizeTransactionZZ { + const raw_val: bindings.LDKCOption_C2Tuple_usizeTransactionZZ = bindings.LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr(ptr); + if (raw_val instanceof bindings.LDKCOption_C2Tuple_usizeTransactionZZ.Some) { + return new Some(this.ptr, raw_val); + } + if (raw_val instanceof bindings.LDKCOption_C2Tuple_usizeTransactionZZ.None) { + return new None(this.ptr, raw_val); + } + throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface + } + +} +export class Some extends COption_C2Tuple_usizeTransactionZZ { + public some: TwoTuple; + private constructor(ptr: number, obj: bindings.LDKCOption_C2Tuple_usizeTransactionZZ.Some) { + super(null, ptr); + const some: number = obj.some; + number some_a = bindings.LDKC2Tuple_usizeTransactionZ_get_a(some); + Uint8Array some_b = bindings.LDKC2Tuple_usizeTransactionZ_get_b(some); + TwoTuple some_conv = new TwoTuple(some_a, some_b, () -> { + bindings.C2Tuple_usizeTransactionZ_free(some); + }); + this.some = some_conv; + } +} +export class None extends COption_C2Tuple_usizeTransactionZZ { + private constructor(ptr: number, obj: bindings.LDKCOption_C2Tuple_usizeTransactionZZ.None) { + super(null, ptr); + } +} + public static Option_C2Tuple_usizeTransactionZZ constructor__some(TwoTuple o) { + number ret = bindings.COption_C2Tuple_usizeTransactionZZ_some(bindings.C2Tuple_usizeTransactionZ_new(o.a, o.b)); + Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static Option_C2Tuple_usizeTransactionZZ constructor__none() { + number ret = bindings.COption_C2Tuple_usizeTransactionZZ_none(); + Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + +} diff --git a/ts/structs/Option_u32Z.ts b/ts/structs/Option_u32Z.ts new file mode 100644 index 00000000..9d7b9616 --- /dev/null +++ b/ts/structs/Option_u32Z.ts @@ -0,0 +1,56 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +export default class COption_u32Z extends CommonBase { + protected constructor(_dummy: object, ptr: number) { super(ptr); } + protected finalize() { + super.finalize(); + if (this.ptr != 0) { bindings.COption_u32Z_free(this.ptr); } + } + static constr_from_ptr(ptr: number): COption_u32Z { + const raw_val: bindings.LDKCOption_u32Z = bindings.LDKCOption_u32Z_ref_from_ptr(ptr); + if (raw_val instanceof bindings.LDKCOption_u32Z.Some) { + return new Some(this.ptr, raw_val); + } + if (raw_val instanceof bindings.LDKCOption_u32Z.None) { + return new None(this.ptr, raw_val); + } + throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface + } + +} +export class Some extends COption_u32Z { + public some: number; + private constructor(ptr: number, obj: bindings.LDKCOption_u32Z.Some) { + super(null, ptr); + this.some = obj.some; + } +} +export class None extends COption_u32Z { + private constructor(ptr: number, obj: bindings.LDKCOption_u32Z.None) { + super(null, ptr); + } +} + public static Option_u32Z constructor__some(number o) { + number ret = bindings.COption_u32Z_some(o); + Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static Option_u32Z constructor__none() { + number ret = bindings.COption_u32Z_none(); + Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public Option_u32Z _clone() { + number ret = bindings.COption_u32Z_clone(this.ptr); + Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/ts/structs/Option_u64Z.ts b/ts/structs/Option_u64Z.ts new file mode 100644 index 00000000..c23f0895 --- /dev/null +++ b/ts/structs/Option_u64Z.ts @@ -0,0 +1,56 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +export default class COption_u64Z extends CommonBase { + protected constructor(_dummy: object, ptr: number) { super(ptr); } + protected finalize() { + super.finalize(); + if (this.ptr != 0) { bindings.COption_u64Z_free(this.ptr); } + } + static constr_from_ptr(ptr: number): COption_u64Z { + const raw_val: bindings.LDKCOption_u64Z = bindings.LDKCOption_u64Z_ref_from_ptr(ptr); + if (raw_val instanceof bindings.LDKCOption_u64Z.Some) { + return new Some(this.ptr, raw_val); + } + if (raw_val instanceof bindings.LDKCOption_u64Z.None) { + return new None(this.ptr, raw_val); + } + throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface + } + +} +export class Some extends COption_u64Z { + public some: number; + private constructor(ptr: number, obj: bindings.LDKCOption_u64Z.Some) { + super(null, ptr); + this.some = obj.some; + } +} +export class None extends COption_u64Z { + private constructor(ptr: number, obj: bindings.LDKCOption_u64Z.None) { + super(null, ptr); + } +} + public static Option_u64Z constructor__some(number o) { + number ret = bindings.COption_u64Z_some(o); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static Option_u64Z constructor__none() { + number ret = bindings.COption_u64Z_none(); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public Option_u64Z _clone() { + number ret = bindings.COption_u64Z_clone(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/ts/structs/PaymentSendFailure.ts b/ts/structs/PaymentSendFailure.ts index 2310a2ee..36daa4ec 100644 --- a/ts/structs/PaymentSendFailure.ts +++ b/ts/structs/PaymentSendFailure.ts @@ -27,22 +27,63 @@ export default class PaymentSendFailure extends CommonBase { } export class ParameterError extends PaymentSendFailure { + public parameter_error: APIError; private constructor(ptr: number, obj: bindings.LDKPaymentSendFailure.ParameterError) { super(null, ptr); + const parameter_error: number = obj.parameter_error; + APIError parameter_error_hu_conv = APIError.constr_from_ptr(parameter_error); + parameter_error_hu_conv.ptrs_to.add(this); + this.parameter_error = parameter_error_hu_conv; } } export class PathParameterError extends PaymentSendFailure { + public path_parameter_error: Result_NoneAPIErrorZ[]; private constructor(ptr: number, obj: bindings.LDKPaymentSendFailure.PathParameterError) { super(null, ptr); + const path_parameter_error: number[] = obj.path_parameter_error; + Result_NoneAPIErrorZ[] path_parameter_error_conv_22_arr = new Result_NoneAPIErrorZ[path_parameter_error.length]; + for (int w = 0; w < path_parameter_error.length; w++) { + number path_parameter_error_conv_22 = path_parameter_error[w]; + Result_NoneAPIErrorZ path_parameter_error_conv_22_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(path_parameter_error_conv_22); + path_parameter_error_conv_22_arr[w] = path_parameter_error_conv_22_hu_conv; + } + this.path_parameter_error = path_parameter_error_conv_22_arr; } } export class AllFailedRetrySafe extends PaymentSendFailure { + public all_failed_retry_safe: APIError[]; private constructor(ptr: number, obj: bindings.LDKPaymentSendFailure.AllFailedRetrySafe) { super(null, ptr); + const all_failed_retry_safe: number[] = obj.all_failed_retry_safe; + APIError[] all_failed_retry_safe_conv_10_arr = new APIError[all_failed_retry_safe.length]; + for (int k = 0; k < all_failed_retry_safe.length; k++) { + number all_failed_retry_safe_conv_10 = all_failed_retry_safe[k]; + APIError all_failed_retry_safe_conv_10_hu_conv = APIError.constr_from_ptr(all_failed_retry_safe_conv_10); + all_failed_retry_safe_conv_10_hu_conv.ptrs_to.add(this); + all_failed_retry_safe_conv_10_arr[k] = all_failed_retry_safe_conv_10_hu_conv; + } + this.all_failed_retry_safe = all_failed_retry_safe_conv_10_arr; } } export class PartialFailure extends PaymentSendFailure { + public partial_failure: Result_NoneAPIErrorZ[]; private constructor(ptr: number, obj: bindings.LDKPaymentSendFailure.PartialFailure) { super(null, ptr); + const partial_failure: number[] = obj.partial_failure; + Result_NoneAPIErrorZ[] partial_failure_conv_22_arr = new Result_NoneAPIErrorZ[partial_failure.length]; + for (int w = 0; w < partial_failure.length; w++) { + number partial_failure_conv_22 = partial_failure[w]; + Result_NoneAPIErrorZ partial_failure_conv_22_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(partial_failure_conv_22); + partial_failure_conv_22_arr[w] = partial_failure_conv_22_hu_conv; + } + this.partial_failure = partial_failure_conv_22_arr; } +} + public PaymentSendFailure clone() { + number ret = bindings.PaymentSendFailure_clone(this.ptr); + PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_AcceptChannelDecodeErrorZ.ts b/ts/structs/Result_AcceptChannelDecodeErrorZ.ts index ddc5ef5e..5e24e2fd 100644 --- a/ts/structs/Result_AcceptChannelDecodeErrorZ.ts +++ b/ts/structs/Result_AcceptChannelDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_AcceptChannelDecodeErrorZ_OK(AcceptChannel res) { - this(null, bindings.CResult_AcceptChannelDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_AcceptChannelDecodeErrorZ_Err extends Result_AcceptChannelDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_AcceptChannelDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_AcceptChannelDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_AcceptChannelDecodeErrorZ constructor__ok(AcceptChannel o) { + number ret = bindings.CResult_AcceptChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_AcceptChannelDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_AcceptChannelDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_AcceptChannelDecodeErrorZ _clone() { + number ret = bindings.CResult_AcceptChannelDecodeErrorZ_clone(this.ptr); + Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.ts b/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.ts index c2432445..02479d72 100644 --- a/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.ts +++ b/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_AnnouncementSignaturesDecodeErrorZ_OK(AnnouncementSignatures res) { - this(null, bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_AnnouncementSignaturesDecodeErrorZ_Err extends Result_AnnouncementSignaturesDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_AnnouncementSignaturesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_AnnouncementSignaturesDecodeErrorZ constructor__ok(AnnouncementSignatures o) { + number ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_AnnouncementSignaturesDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_AnnouncementSignaturesDecodeErrorZ _clone() { + number ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_clone(this.ptr); + Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.ts b/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.ts index 9e4fdaa8..7d04d85a 100644 --- a/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.ts +++ b/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_BuiltCommitmentTransactionDecodeErrorZ_OK(BuiltCommitmentTransaction res) { - this(null, bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_BuiltCommitmentTransactionDecodeErrorZ_Err extends Result_BuiltCommitmentTransactionDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_BuiltCommitmentTransactionDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_BuiltCommitmentTransactionDecodeErrorZ constructor__ok(BuiltCommitmentTransaction o) { + number ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_BuiltCommitmentTransactionDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_BuiltCommitmentTransactionDecodeErrorZ _clone() { + number ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(this.ptr); + Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts b/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts index 91fcaa40..e3878992 100644 --- a/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts +++ b/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts @@ -30,18 +30,6 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB res_b_hu_conv.ptrs_to.add(res_conv); this.res = res_conv; } - public Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(TwoTuple res) { - this(null, bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelManagerZ_new(res.a, res.b == null ? 0 : res.b.ptr & ~1))); - this.ptrs_to.add(res.b); - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid this being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after this call, res.b is reset to null and is now a dummy object. - res.b.ptr = 0; - } } public static final class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err extends Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { @@ -53,9 +41,28 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constructor__ok(TwoTuple o) { + number ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelManagerZ_new(o.a, o.b == null ? 0 : o.b.ptr & ~1)); + Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o.b); + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o.b is reset to null and is now a dummy object. + o.b.ptr = 0; + return ret_hu_conv; + } + + public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts b/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts index c563f848..3139b2b6 100644 --- a/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts +++ b/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts @@ -30,10 +30,6 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB res_b_hu_conv.ptrs_to.add(res_conv); this.res = res_conv; } - public Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(TwoTuple res) { - this(null, bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelMonitorZ_new(res.a, res.b == null ? 0 : res.b.ptr & ~1))); - this.ptrs_to.add(res.b); - } } public static final class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err extends Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { @@ -45,9 +41,20 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constructor__ok(TwoTuple o) { + number ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelMonitorZ_new(o.a, o.b == null ? 0 : o.b.ptr & ~1)); + Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o.b); + return ret_hu_conv; + } + + public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts b/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts index 23aad79f..bf9ac050 100644 --- a/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts +++ b/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts @@ -27,17 +27,30 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { }); this.res = res_conv; } - public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_OK(TwoTuple res) { - this(null, bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(bindings.C2Tuple_SignatureCVec_SignatureZZ_new(res.a, res.b))); - } } public static final class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err extends Result_C2Tuple_SignatureCVec_SignatureZZNoneZ { private Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err() { - this(null, bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err()); - } } + + public static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ constructor__ok(TwoTuple o) { + number ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(bindings.C2Tuple_SignatureCVec_SignatureZZ_new(o.a, o.b)); + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ constructor__err() { + number ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ _clone() { + number ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(this.ptr); + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.ts b/ts/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.ts index efef7e62..d6dc175e 100644 --- a/ts/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.ts +++ b/ts/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.ts @@ -23,9 +23,6 @@ public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase { Result_NetAddressu8Z res_hu_conv = Result_NetAddressu8Z.constr_from_ptr(res); this.res = res_hu_conv; } - public Result_CResult_NetAddressu8ZDecodeErrorZ_OK(Result_NetAddressu8Z res) { - this(null, bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(res != null ? res.ptr : 0)); - } } public static final class Result_CResult_NetAddressu8ZDecodeErrorZ_Err extends Result_CResult_NetAddressu8ZDecodeErrorZ { @@ -37,9 +34,25 @@ public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CResult_NetAddressu8ZDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_CResult_NetAddressu8ZDecodeErrorZ constructor__ok(Result_NetAddressu8Z o) { + number ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o != null ? o.ptr : 0); + Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_CResult_NetAddressu8ZDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_CResult_NetAddressu8ZDecodeErrorZ _clone() { + number ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(this.ptr); + Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_CVec_CVec_u8ZZNoneZ.ts b/ts/structs/Result_CVec_CVec_u8ZZNoneZ.ts index 58502517..1bf0b6b9 100644 --- a/ts/structs/Result_CVec_CVec_u8ZZNoneZ.ts +++ b/ts/structs/Result_CVec_CVec_u8ZZNoneZ.ts @@ -21,17 +21,30 @@ public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(ptr); } - public Result_CVec_CVec_u8ZZNoneZ_OK(Uint8Array[] res) { - this(null, bindings.CResult_CVec_CVec_u8ZZNoneZ_ok(res)); - } } public static final class Result_CVec_CVec_u8ZZNoneZ_Err extends Result_CVec_CVec_u8ZZNoneZ { private Result_CVec_CVec_u8ZZNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_CVec_CVec_u8ZZNoneZ_Err() { - this(null, bindings.CResult_CVec_CVec_u8ZZNoneZ_err()); - } } + + public static Result_CVec_CVec_u8ZZNoneZ constructor__ok(Uint8Array[] o) { + number ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_ok(o); + Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_CVec_CVec_u8ZZNoneZ constructor__err() { + number ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_err(); + Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public Result_CVec_CVec_u8ZZNoneZ _clone() { + number ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_clone(this.ptr); + Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_CVec_SignatureZNoneZ.ts b/ts/structs/Result_CVec_SignatureZNoneZ.ts index 4bbae609..237f4476 100644 --- a/ts/structs/Result_CVec_SignatureZNoneZ.ts +++ b/ts/structs/Result_CVec_SignatureZNoneZ.ts @@ -21,17 +21,30 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_CVec_SignatureZNoneZ_get_ok(ptr); } - public Result_CVec_SignatureZNoneZ_OK(Uint8Array[] res) { - this(null, bindings.CResult_CVec_SignatureZNoneZ_ok(res)); - } } public static final class Result_CVec_SignatureZNoneZ_Err extends Result_CVec_SignatureZNoneZ { private Result_CVec_SignatureZNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_CVec_SignatureZNoneZ_Err() { - this(null, bindings.CResult_CVec_SignatureZNoneZ_err()); - } } + + public static Result_CVec_SignatureZNoneZ constructor__ok(Uint8Array[] o) { + number ret = bindings.CResult_CVec_SignatureZNoneZ_ok(o); + Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_CVec_SignatureZNoneZ constructor__err() { + number ret = bindings.CResult_CVec_SignatureZNoneZ_err(); + Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public Result_CVec_SignatureZNoneZ _clone() { + number ret = bindings.CResult_CVec_SignatureZNoneZ_clone(this.ptr); + Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts b/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts index 2b318343..96c33d3a 100644 --- a/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts +++ b/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts @@ -21,9 +21,6 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(ptr); } - public Result_CVec_u8ZPeerHandleErrorZ_OK(Uint8Array res) { - this(null, bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(res)); - } } public static final class Result_CVec_u8ZPeerHandleErrorZ_Err extends Result_CVec_u8ZPeerHandleErrorZ { @@ -35,9 +32,25 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CVec_u8ZPeerHandleErrorZ_Err(PeerHandleError err) { - this(null, bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_CVec_u8ZPeerHandleErrorZ constructor__ok(Uint8Array o) { + number ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(o); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_CVec_u8ZPeerHandleErrorZ constructor__err(PeerHandleError e) { + number ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_CVec_u8ZPeerHandleErrorZ _clone() { + number ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone(this.ptr); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.ts b/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.ts index 5145f35c..a94e2294 100644 --- a/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelAnnouncementDecodeErrorZ_OK(ChannelAnnouncement res) { - this(null, bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelAnnouncementDecodeErrorZ_Err extends Result_ChannelAnnouncementDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelAnnouncementDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ChannelAnnouncementDecodeErrorZ constructor__ok(ChannelAnnouncement o) { + number ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ChannelAnnouncementDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ChannelAnnouncementDecodeErrorZ _clone() { + number ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_clone(this.ptr); + Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ChannelConfigDecodeErrorZ.ts b/ts/structs/Result_ChannelConfigDecodeErrorZ.ts index ea264bbb..05146da5 100644 --- a/ts/structs/Result_ChannelConfigDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelConfigDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelConfigDecodeErrorZ_OK(ChannelConfig res) { - this(null, bindings.CResult_ChannelConfigDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelConfigDecodeErrorZ_Err extends Result_ChannelConfigDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelConfigDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelConfigDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ChannelConfigDecodeErrorZ constructor__ok(ChannelConfig o) { + number ret = bindings.CResult_ChannelConfigDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ChannelConfigDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ChannelConfigDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ChannelConfigDecodeErrorZ _clone() { + number ret = bindings.CResult_ChannelConfigDecodeErrorZ_clone(this.ptr); + Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ChannelFeaturesDecodeErrorZ.ts b/ts/structs/Result_ChannelFeaturesDecodeErrorZ.ts index 931540ce..af6fcd00 100644 --- a/ts/structs/Result_ChannelFeaturesDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelFeaturesDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelFeaturesDecodeErrorZ_OK(ChannelFeatures res) { - this(null, bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelFeaturesDecodeErrorZ_Err extends Result_ChannelFeaturesDecodeErrorZ { @@ -39,9 +35,20 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelFeaturesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ChannelFeaturesDecodeErrorZ constructor__ok(ChannelFeatures o) { + number ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ChannelFeaturesDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ChannelInfoDecodeErrorZ.ts b/ts/structs/Result_ChannelInfoDecodeErrorZ.ts index 3650d84f..79a4a6d5 100644 --- a/ts/structs/Result_ChannelInfoDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelInfoDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelInfoDecodeErrorZ_OK(ChannelInfo res) { - this(null, bindings.CResult_ChannelInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelInfoDecodeErrorZ_Err extends Result_ChannelInfoDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelInfoDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ChannelInfoDecodeErrorZ constructor__ok(ChannelInfo o) { + number ret = bindings.CResult_ChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ChannelInfoDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ChannelInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ChannelInfoDecodeErrorZ _clone() { + number ret = bindings.CResult_ChannelInfoDecodeErrorZ_clone(this.ptr); + Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts b/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts index 28bba160..ff96b9ad 100644 --- a/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelMonitorUpdateDecodeErrorZ_OK(ChannelMonitorUpdate res) { - this(null, bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelMonitorUpdateDecodeErrorZ_Err extends Result_ChannelMonitorUpdateDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelMonitorUpdateDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ChannelMonitorUpdateDecodeErrorZ constructor__ok(ChannelMonitorUpdate o) { + number ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ChannelMonitorUpdateDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ChannelMonitorUpdateDecodeErrorZ _clone() { + number ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_clone(this.ptr); + Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.ts b/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.ts index c0febead..df516cba 100644 --- a/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelPublicKeysDecodeErrorZ_OK(ChannelPublicKeys res) { - this(null, bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelPublicKeysDecodeErrorZ_Err extends Result_ChannelPublicKeysDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelPublicKeysDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ChannelPublicKeysDecodeErrorZ constructor__ok(ChannelPublicKeys o) { + number ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ChannelPublicKeysDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ChannelPublicKeysDecodeErrorZ _clone() { + number ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_clone(this.ptr); + Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts b/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts index 13377d67..c4bd01d4 100644 --- a/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelReestablishDecodeErrorZ_OK(ChannelReestablish res) { - this(null, bindings.CResult_ChannelReestablishDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelReestablishDecodeErrorZ_Err extends Result_ChannelReestablishDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelReestablishDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelReestablishDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ChannelReestablishDecodeErrorZ constructor__ok(ChannelReestablish o) { + number ret = bindings.CResult_ChannelReestablishDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ChannelReestablishDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ChannelReestablishDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ChannelReestablishDecodeErrorZ _clone() { + number ret = bindings.CResult_ChannelReestablishDecodeErrorZ_clone(this.ptr); + Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.ts b/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.ts index 2353ce90..cc5accfd 100644 --- a/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelTransactionParametersDecodeErrorZ_OK(ChannelTransactionParameters res) { - this(null, bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelTransactionParametersDecodeErrorZ_Err extends Result_ChannelTransactionParametersDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelTransactionParametersDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ChannelTransactionParametersDecodeErrorZ constructor__ok(ChannelTransactionParameters o) { + number ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ChannelTransactionParametersDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ChannelTransactionParametersDecodeErrorZ _clone() { + number ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_clone(this.ptr); + Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ChannelUpdateDecodeErrorZ.ts b/ts/structs/Result_ChannelUpdateDecodeErrorZ.ts index f3f85e3a..91219618 100644 --- a/ts/structs/Result_ChannelUpdateDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelUpdateDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ChannelUpdateDecodeErrorZ_OK(ChannelUpdate res) { - this(null, bindings.CResult_ChannelUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ChannelUpdateDecodeErrorZ_Err extends Result_ChannelUpdateDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ChannelUpdateDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ChannelUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ChannelUpdateDecodeErrorZ constructor__ok(ChannelUpdate o) { + number ret = bindings.CResult_ChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ChannelUpdateDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ChannelUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ChannelUpdateDecodeErrorZ _clone() { + number ret = bindings.CResult_ChannelUpdateDecodeErrorZ_clone(this.ptr); + Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ClosingSignedDecodeErrorZ.ts b/ts/structs/Result_ClosingSignedDecodeErrorZ.ts index 7163fff2..a56d732d 100644 --- a/ts/structs/Result_ClosingSignedDecodeErrorZ.ts +++ b/ts/structs/Result_ClosingSignedDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ClosingSignedDecodeErrorZ_OK(ClosingSigned res) { - this(null, bindings.CResult_ClosingSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ClosingSignedDecodeErrorZ_Err extends Result_ClosingSignedDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ClosingSignedDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ClosingSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ClosingSignedDecodeErrorZ constructor__ok(ClosingSigned o) { + number ret = bindings.CResult_ClosingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ClosingSignedDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ClosingSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ClosingSignedDecodeErrorZ _clone() { + number ret = bindings.CResult_ClosingSignedDecodeErrorZ_clone(this.ptr); + Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_CommitmentSignedDecodeErrorZ.ts b/ts/structs/Result_CommitmentSignedDecodeErrorZ.ts index 3168c278..a8e92e72 100644 --- a/ts/structs/Result_CommitmentSignedDecodeErrorZ.ts +++ b/ts/structs/Result_CommitmentSignedDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_CommitmentSignedDecodeErrorZ_OK(CommitmentSigned res) { - this(null, bindings.CResult_CommitmentSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_CommitmentSignedDecodeErrorZ_Err extends Result_CommitmentSignedDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CommitmentSignedDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_CommitmentSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_CommitmentSignedDecodeErrorZ constructor__ok(CommitmentSigned o) { + number ret = bindings.CResult_CommitmentSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_CommitmentSignedDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_CommitmentSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_CommitmentSignedDecodeErrorZ _clone() { + number ret = bindings.CResult_CommitmentSignedDecodeErrorZ_clone(this.ptr); + Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_CommitmentTransactionDecodeErrorZ.ts b/ts/structs/Result_CommitmentTransactionDecodeErrorZ.ts index a555e9eb..cf248fb2 100644 --- a/ts/structs/Result_CommitmentTransactionDecodeErrorZ.ts +++ b/ts/structs/Result_CommitmentTransactionDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_CommitmentTransactionDecodeErrorZ_OK(CommitmentTransaction res) { - this(null, bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_CommitmentTransactionDecodeErrorZ_Err extends Result_CommitmentTransactionDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CommitmentTransactionDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_CommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_CommitmentTransactionDecodeErrorZ constructor__ok(CommitmentTransaction o) { + number ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_CommitmentTransactionDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_CommitmentTransactionDecodeErrorZ _clone() { + number ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_clone(this.ptr); + Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.ts b/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.ts index 68e67ff7..c96ded5d 100644 --- a/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.ts +++ b/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(CounterpartyChannelTransactionParameters res) { - this(null, bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err extends Result_CounterpartyChannelTransactionParametersDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ constructor__ok(CounterpartyChannelTransactionParameters o) { + number ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_CounterpartyChannelTransactionParametersDecodeErrorZ _clone() { + number ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(this.ptr); + Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.ts b/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.ts index 972fc4ba..84a6e382 100644 --- a/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.ts +++ b/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_DirectionalChannelInfoDecodeErrorZ_OK(DirectionalChannelInfo res) { - this(null, bindings.CResult_DirectionalChannelInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_DirectionalChannelInfoDecodeErrorZ_Err extends Result_DirectionalChannelInfoDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_DirectionalChannelInfoDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_DirectionalChannelInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_DirectionalChannelInfoDecodeErrorZ constructor__ok(DirectionalChannelInfo o) { + number ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_DirectionalChannelInfoDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_DirectionalChannelInfoDecodeErrorZ _clone() { + number ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_clone(this.ptr); + Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ErrorMessageDecodeErrorZ.ts b/ts/structs/Result_ErrorMessageDecodeErrorZ.ts index f3060b29..40b124b0 100644 --- a/ts/structs/Result_ErrorMessageDecodeErrorZ.ts +++ b/ts/structs/Result_ErrorMessageDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ErrorMessageDecodeErrorZ_OK(ErrorMessage res) { - this(null, bindings.CResult_ErrorMessageDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ErrorMessageDecodeErrorZ_Err extends Result_ErrorMessageDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ErrorMessageDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ErrorMessageDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ErrorMessageDecodeErrorZ constructor__ok(ErrorMessage o) { + number ret = bindings.CResult_ErrorMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ErrorMessageDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ErrorMessageDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ErrorMessageDecodeErrorZ _clone() { + number ret = bindings.CResult_ErrorMessageDecodeErrorZ_clone(this.ptr); + Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_FundingCreatedDecodeErrorZ.ts b/ts/structs/Result_FundingCreatedDecodeErrorZ.ts index 61050127..758bf575 100644 --- a/ts/structs/Result_FundingCreatedDecodeErrorZ.ts +++ b/ts/structs/Result_FundingCreatedDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_FundingCreatedDecodeErrorZ_OK(FundingCreated res) { - this(null, bindings.CResult_FundingCreatedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_FundingCreatedDecodeErrorZ_Err extends Result_FundingCreatedDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_FundingCreatedDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_FundingCreatedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_FundingCreatedDecodeErrorZ constructor__ok(FundingCreated o) { + number ret = bindings.CResult_FundingCreatedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_FundingCreatedDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_FundingCreatedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_FundingCreatedDecodeErrorZ _clone() { + number ret = bindings.CResult_FundingCreatedDecodeErrorZ_clone(this.ptr); + Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_FundingLockedDecodeErrorZ.ts b/ts/structs/Result_FundingLockedDecodeErrorZ.ts index c5bd2017..83e5f6b0 100644 --- a/ts/structs/Result_FundingLockedDecodeErrorZ.ts +++ b/ts/structs/Result_FundingLockedDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_FundingLockedDecodeErrorZ_OK(FundingLocked res) { - this(null, bindings.CResult_FundingLockedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_FundingLockedDecodeErrorZ_Err extends Result_FundingLockedDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_FundingLockedDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_FundingLockedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_FundingLockedDecodeErrorZ constructor__ok(FundingLocked o) { + number ret = bindings.CResult_FundingLockedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_FundingLockedDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_FundingLockedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_FundingLockedDecodeErrorZ _clone() { + number ret = bindings.CResult_FundingLockedDecodeErrorZ_clone(this.ptr); + Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_FundingSignedDecodeErrorZ.ts b/ts/structs/Result_FundingSignedDecodeErrorZ.ts index 37fbef2c..046c8ede 100644 --- a/ts/structs/Result_FundingSignedDecodeErrorZ.ts +++ b/ts/structs/Result_FundingSignedDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_FundingSignedDecodeErrorZ_OK(FundingSigned res) { - this(null, bindings.CResult_FundingSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_FundingSignedDecodeErrorZ_Err extends Result_FundingSignedDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_FundingSignedDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_FundingSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_FundingSignedDecodeErrorZ constructor__ok(FundingSigned o) { + number ret = bindings.CResult_FundingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_FundingSignedDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_FundingSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_FundingSignedDecodeErrorZ _clone() { + number ret = bindings.CResult_FundingSignedDecodeErrorZ_clone(this.ptr); + Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts b/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts index 2e8c6498..8a4f07c2 100644 --- a/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts +++ b/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_GossipTimestampFilterDecodeErrorZ_OK(GossipTimestampFilter res) { - this(null, bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_GossipTimestampFilterDecodeErrorZ_Err extends Result_GossipTimestampFilterDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_GossipTimestampFilterDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_GossipTimestampFilterDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_GossipTimestampFilterDecodeErrorZ constructor__ok(GossipTimestampFilter o) { + number ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_GossipTimestampFilterDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_GossipTimestampFilterDecodeErrorZ _clone() { + number ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_clone(this.ptr); + Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.ts b/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.ts index 634405b4..51e04765 100644 --- a/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.ts +++ b/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_HTLCOutputInCommitmentDecodeErrorZ_OK(HTLCOutputInCommitment res) { - this(null, bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_HTLCOutputInCommitmentDecodeErrorZ_Err extends Result_HTLCOutputInCommitmentDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_HTLCOutputInCommitmentDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_HTLCOutputInCommitmentDecodeErrorZ constructor__ok(HTLCOutputInCommitment o) { + number ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_HTLCOutputInCommitmentDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_HTLCOutputInCommitmentDecodeErrorZ _clone() { + number ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(this.ptr); + Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_HTLCUpdateDecodeErrorZ.ts b/ts/structs/Result_HTLCUpdateDecodeErrorZ.ts index 3e6815f2..14b061e2 100644 --- a/ts/structs/Result_HTLCUpdateDecodeErrorZ.ts +++ b/ts/structs/Result_HTLCUpdateDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_HTLCUpdateDecodeErrorZ_OK(HTLCUpdate res) { - this(null, bindings.CResult_HTLCUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_HTLCUpdateDecodeErrorZ_Err extends Result_HTLCUpdateDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_HTLCUpdateDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_HTLCUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_HTLCUpdateDecodeErrorZ constructor__ok(HTLCUpdate o) { + number ret = bindings.CResult_HTLCUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_HTLCUpdateDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_HTLCUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_HTLCUpdateDecodeErrorZ _clone() { + number ret = bindings.CResult_HTLCUpdateDecodeErrorZ_clone(this.ptr); + Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.ts b/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.ts index 613fcb9d..ff8a0ad4 100644 --- a/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.ts +++ b/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_HolderCommitmentTransactionDecodeErrorZ_OK(HolderCommitmentTransaction res) { - this(null, bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_HolderCommitmentTransactionDecodeErrorZ_Err extends Result_HolderCommitmentTransactionDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_HolderCommitmentTransactionDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_HolderCommitmentTransactionDecodeErrorZ constructor__ok(HolderCommitmentTransaction o) { + number ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_HolderCommitmentTransactionDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_HolderCommitmentTransactionDecodeErrorZ _clone() { + number ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_clone(this.ptr); + Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_InMemorySignerDecodeErrorZ.ts b/ts/structs/Result_InMemorySignerDecodeErrorZ.ts index 89175a71..ad24b905 100644 --- a/ts/structs/Result_InMemorySignerDecodeErrorZ.ts +++ b/ts/structs/Result_InMemorySignerDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_InMemorySignerDecodeErrorZ_OK(InMemorySigner res) { - this(null, bindings.CResult_InMemorySignerDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_InMemorySignerDecodeErrorZ_Err extends Result_InMemorySignerDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_InMemorySignerDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_InMemorySignerDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_InMemorySignerDecodeErrorZ constructor__ok(InMemorySigner o) { + number ret = bindings.CResult_InMemorySignerDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_InMemorySignerDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_InMemorySignerDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_InMemorySignerDecodeErrorZ _clone() { + number ret = bindings.CResult_InMemorySignerDecodeErrorZ_clone(this.ptr); + Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_InitDecodeErrorZ.ts b/ts/structs/Result_InitDecodeErrorZ.ts index 168ffcdb..48c57880 100644 --- a/ts/structs/Result_InitDecodeErrorZ.ts +++ b/ts/structs/Result_InitDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_InitDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_InitDecodeErrorZ_OK(Init res) { - this(null, bindings.CResult_InitDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_InitDecodeErrorZ_Err extends Result_InitDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_InitDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_InitDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_InitDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_InitDecodeErrorZ constructor__ok(Init o) { + number ret = bindings.CResult_InitDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_InitDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_InitDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_InitDecodeErrorZ _clone() { + number ret = bindings.CResult_InitDecodeErrorZ_clone(this.ptr); + Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_InitFeaturesDecodeErrorZ.ts b/ts/structs/Result_InitFeaturesDecodeErrorZ.ts index 2d959796..a1950107 100644 --- a/ts/structs/Result_InitFeaturesDecodeErrorZ.ts +++ b/ts/structs/Result_InitFeaturesDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_InitFeaturesDecodeErrorZ_OK(InitFeatures res) { - this(null, bindings.CResult_InitFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_InitFeaturesDecodeErrorZ_Err extends Result_InitFeaturesDecodeErrorZ { @@ -39,9 +35,20 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_InitFeaturesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_InitFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_InitFeaturesDecodeErrorZ constructor__ok(InitFeatures o) { + number ret = bindings.CResult_InitFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_InitFeaturesDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_InitFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.ts b/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.ts index ac13a5ae..9f8baa89 100644 --- a/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.ts +++ b/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_InvoiceFeaturesDecodeErrorZ_OK(InvoiceFeatures res) { - this(null, bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_InvoiceFeaturesDecodeErrorZ_Err extends Result_InvoiceFeaturesDecodeErrorZ { @@ -39,9 +35,20 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_InvoiceFeaturesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_InvoiceFeaturesDecodeErrorZ constructor__ok(InvoiceFeatures o) { + number ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_InvoiceFeaturesDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NetAddressu8Z.ts b/ts/structs/Result_NetAddressu8Z.ts index 0725f11f..17ad93c2 100644 --- a/ts/structs/Result_NetAddressu8Z.ts +++ b/ts/structs/Result_NetAddressu8Z.ts @@ -24,9 +24,6 @@ public class Result_NetAddressu8Z extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NetAddressu8Z_OK(NetAddress res) { - this(null, bindings.CResult_NetAddressu8Z_ok(res.ptr)); - } } public static final class Result_NetAddressu8Z_Err extends Result_NetAddressu8Z { @@ -35,8 +32,24 @@ public class Result_NetAddressu8Z extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_NetAddressu8Z_get_err(ptr); } - public Result_NetAddressu8Z_Err(number err) { - this(null, bindings.CResult_NetAddressu8Z_err(err)); - } } + + public static Result_NetAddressu8Z constructor__ok(NetAddress o) { + number ret = bindings.CResult_NetAddressu8Z_ok(o.ptr); + Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_NetAddressu8Z constructor__err(number e) { + number ret = bindings.CResult_NetAddressu8Z_err(e); + Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret); + return ret_hu_conv; + } + + public Result_NetAddressu8Z _clone() { + number ret = bindings.CResult_NetAddressu8Z_clone(this.ptr); + Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NetworkGraphDecodeErrorZ.ts b/ts/structs/Result_NetworkGraphDecodeErrorZ.ts index 78921d4e..1cc929fa 100644 --- a/ts/structs/Result_NetworkGraphDecodeErrorZ.ts +++ b/ts/structs/Result_NetworkGraphDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NetworkGraphDecodeErrorZ_OK(NetworkGraph res) { - this(null, bindings.CResult_NetworkGraphDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_NetworkGraphDecodeErrorZ_Err extends Result_NetworkGraphDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NetworkGraphDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_NetworkGraphDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_NetworkGraphDecodeErrorZ constructor__ok(NetworkGraph o) { + number ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_NetworkGraphDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_NetworkGraphDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_NetworkGraphDecodeErrorZ _clone() { + number ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone(this.ptr); + Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NodeAnnouncementDecodeErrorZ.ts b/ts/structs/Result_NodeAnnouncementDecodeErrorZ.ts index b382ff5d..4d02f8d7 100644 --- a/ts/structs/Result_NodeAnnouncementDecodeErrorZ.ts +++ b/ts/structs/Result_NodeAnnouncementDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NodeAnnouncementDecodeErrorZ_OK(NodeAnnouncement res) { - this(null, bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_NodeAnnouncementDecodeErrorZ_Err extends Result_NodeAnnouncementDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NodeAnnouncementDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_NodeAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_NodeAnnouncementDecodeErrorZ constructor__ok(NodeAnnouncement o) { + number ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_NodeAnnouncementDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_NodeAnnouncementDecodeErrorZ _clone() { + number ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_clone(this.ptr); + Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts b/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts index f0eb3fd4..76c3f85b 100644 --- a/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts +++ b/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NodeAnnouncementInfoDecodeErrorZ_OK(NodeAnnouncementInfo res) { - this(null, bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_NodeAnnouncementInfoDecodeErrorZ_Err extends Result_NodeAnnouncementInfoDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NodeAnnouncementInfoDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_NodeAnnouncementInfoDecodeErrorZ constructor__ok(NodeAnnouncementInfo o) { + number ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_NodeAnnouncementInfoDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_NodeAnnouncementInfoDecodeErrorZ _clone() { + number ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone(this.ptr); + Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NodeFeaturesDecodeErrorZ.ts b/ts/structs/Result_NodeFeaturesDecodeErrorZ.ts index cd3d97da..c75d721b 100644 --- a/ts/structs/Result_NodeFeaturesDecodeErrorZ.ts +++ b/ts/structs/Result_NodeFeaturesDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NodeFeaturesDecodeErrorZ_OK(NodeFeatures res) { - this(null, bindings.CResult_NodeFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_NodeFeaturesDecodeErrorZ_Err extends Result_NodeFeaturesDecodeErrorZ { @@ -39,9 +35,20 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NodeFeaturesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_NodeFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_NodeFeaturesDecodeErrorZ constructor__ok(NodeFeatures o) { + number ret = bindings.CResult_NodeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_NodeFeaturesDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_NodeFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NodeInfoDecodeErrorZ.ts b/ts/structs/Result_NodeInfoDecodeErrorZ.ts index 3e9c8d2b..7c40d301 100644 --- a/ts/structs/Result_NodeInfoDecodeErrorZ.ts +++ b/ts/structs/Result_NodeInfoDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_NodeInfoDecodeErrorZ_OK(NodeInfo res) { - this(null, bindings.CResult_NodeInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_NodeInfoDecodeErrorZ_Err extends Result_NodeInfoDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NodeInfoDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_NodeInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_NodeInfoDecodeErrorZ constructor__ok(NodeInfo o) { + number ret = bindings.CResult_NodeInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_NodeInfoDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_NodeInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_NodeInfoDecodeErrorZ _clone() { + number ret = bindings.CResult_NodeInfoDecodeErrorZ_clone(this.ptr); + Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NoneAPIErrorZ.ts b/ts/structs/Result_NoneAPIErrorZ.ts index 7bedbd60..a90182d5 100644 --- a/ts/structs/Result_NoneAPIErrorZ.ts +++ b/ts/structs/Result_NoneAPIErrorZ.ts @@ -19,9 +19,6 @@ public class Result_NoneAPIErrorZ extends CommonBase { private Result_NoneAPIErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NoneAPIErrorZ_OK() { - this(null, bindings.CResult_NoneAPIErrorZ_ok()); - } } public static final class Result_NoneAPIErrorZ_Err extends Result_NoneAPIErrorZ { @@ -33,8 +30,24 @@ public class Result_NoneAPIErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NoneAPIErrorZ_Err(APIError err) { - this(null, bindings.CResult_NoneAPIErrorZ_err(err.ptr)); - } } + + public static Result_NoneAPIErrorZ constructor__ok() { + number ret = bindings.CResult_NoneAPIErrorZ_ok(); + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_NoneAPIErrorZ constructor__err(APIError e) { + number ret = bindings.CResult_NoneAPIErrorZ_err(e.ptr); + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public Result_NoneAPIErrorZ _clone() { + number ret = bindings.CResult_NoneAPIErrorZ_clone(this.ptr); + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NoneChannelMonitorUpdateErrZ.ts b/ts/structs/Result_NoneChannelMonitorUpdateErrZ.ts index 5e61c527..d0bcb7ef 100644 --- a/ts/structs/Result_NoneChannelMonitorUpdateErrZ.ts +++ b/ts/structs/Result_NoneChannelMonitorUpdateErrZ.ts @@ -19,9 +19,6 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { private Result_NoneChannelMonitorUpdateErrZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NoneChannelMonitorUpdateErrZ_OK() { - this(null, bindings.CResult_NoneChannelMonitorUpdateErrZ_ok()); - } } public static final class Result_NoneChannelMonitorUpdateErrZ_Err extends Result_NoneChannelMonitorUpdateErrZ { @@ -30,8 +27,24 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(ptr); } - public Result_NoneChannelMonitorUpdateErrZ_Err(LDKChannelMonitorUpdateErr err) { - this(null, bindings.CResult_NoneChannelMonitorUpdateErrZ_err(err)); - } } + + public static Result_NoneChannelMonitorUpdateErrZ constructor__ok() { + number ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_ok(); + Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_NoneChannelMonitorUpdateErrZ constructor__err(LDKChannelMonitorUpdateErr e) { + number ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_err(e); + Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public Result_NoneChannelMonitorUpdateErrZ _clone() { + number ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone(this.ptr); + Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NoneLightningErrorZ.ts b/ts/structs/Result_NoneLightningErrorZ.ts index 510af04e..86718862 100644 --- a/ts/structs/Result_NoneLightningErrorZ.ts +++ b/ts/structs/Result_NoneLightningErrorZ.ts @@ -19,9 +19,6 @@ public class Result_NoneLightningErrorZ extends CommonBase { private Result_NoneLightningErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NoneLightningErrorZ_OK() { - this(null, bindings.CResult_NoneLightningErrorZ_ok()); - } } public static final class Result_NoneLightningErrorZ_Err extends Result_NoneLightningErrorZ { @@ -33,9 +30,25 @@ public class Result_NoneLightningErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NoneLightningErrorZ_Err(LightningError err) { - this(null, bindings.CResult_NoneLightningErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_NoneLightningErrorZ constructor__ok() { + number ret = bindings.CResult_NoneLightningErrorZ_ok(); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_NoneLightningErrorZ constructor__err(LightningError e) { + number ret = bindings.CResult_NoneLightningErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_NoneLightningErrorZ _clone() { + number ret = bindings.CResult_NoneLightningErrorZ_clone(this.ptr); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NoneMonitorUpdateErrorZ.ts b/ts/structs/Result_NoneMonitorUpdateErrorZ.ts index 5b340cba..d0984aec 100644 --- a/ts/structs/Result_NoneMonitorUpdateErrorZ.ts +++ b/ts/structs/Result_NoneMonitorUpdateErrorZ.ts @@ -19,9 +19,6 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase { private Result_NoneMonitorUpdateErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NoneMonitorUpdateErrorZ_OK() { - this(null, bindings.CResult_NoneMonitorUpdateErrorZ_ok()); - } } public static final class Result_NoneMonitorUpdateErrorZ_Err extends Result_NoneMonitorUpdateErrorZ { @@ -33,9 +30,25 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NoneMonitorUpdateErrorZ_Err(MonitorUpdateError err) { - this(null, bindings.CResult_NoneMonitorUpdateErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_NoneMonitorUpdateErrorZ constructor__ok() { + number ret = bindings.CResult_NoneMonitorUpdateErrorZ_ok(); + Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_NoneMonitorUpdateErrorZ constructor__err(MonitorUpdateError e) { + number ret = bindings.CResult_NoneMonitorUpdateErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_NoneMonitorUpdateErrorZ _clone() { + number ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone(this.ptr); + Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NonePaymentSendFailureZ.ts b/ts/structs/Result_NonePaymentSendFailureZ.ts index 66ac0bed..d51a0c56 100644 --- a/ts/structs/Result_NonePaymentSendFailureZ.ts +++ b/ts/structs/Result_NonePaymentSendFailureZ.ts @@ -19,9 +19,6 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { private Result_NonePaymentSendFailureZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NonePaymentSendFailureZ_OK() { - this(null, bindings.CResult_NonePaymentSendFailureZ_ok()); - } } public static final class Result_NonePaymentSendFailureZ_Err extends Result_NonePaymentSendFailureZ { @@ -33,8 +30,24 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NonePaymentSendFailureZ_Err(PaymentSendFailure err) { - this(null, bindings.CResult_NonePaymentSendFailureZ_err(err.ptr)); - } } + + public static Result_NonePaymentSendFailureZ constructor__ok() { + number ret = bindings.CResult_NonePaymentSendFailureZ_ok(); + Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_NonePaymentSendFailureZ constructor__err(PaymentSendFailure e) { + number ret = bindings.CResult_NonePaymentSendFailureZ_err(e.ptr); + Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public Result_NonePaymentSendFailureZ _clone() { + number ret = bindings.CResult_NonePaymentSendFailureZ_clone(this.ptr); + Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_NonePeerHandleErrorZ.ts b/ts/structs/Result_NonePeerHandleErrorZ.ts index 6607c204..c4ba64ef 100644 --- a/ts/structs/Result_NonePeerHandleErrorZ.ts +++ b/ts/structs/Result_NonePeerHandleErrorZ.ts @@ -19,9 +19,6 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { private Result_NonePeerHandleErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_NonePeerHandleErrorZ_OK() { - this(null, bindings.CResult_NonePeerHandleErrorZ_ok()); - } } public static final class Result_NonePeerHandleErrorZ_Err extends Result_NonePeerHandleErrorZ { @@ -33,9 +30,25 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_NonePeerHandleErrorZ_Err(PeerHandleError err) { - this(null, bindings.CResult_NonePeerHandleErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_NonePeerHandleErrorZ constructor__ok() { + number ret = bindings.CResult_NonePeerHandleErrorZ_ok(); + Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_NonePeerHandleErrorZ constructor__err(PeerHandleError e) { + number ret = bindings.CResult_NonePeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_NonePeerHandleErrorZ _clone() { + number ret = bindings.CResult_NonePeerHandleErrorZ_clone(this.ptr); + Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_OpenChannelDecodeErrorZ.ts b/ts/structs/Result_OpenChannelDecodeErrorZ.ts index 0b9e5bf6..8bce36ee 100644 --- a/ts/structs/Result_OpenChannelDecodeErrorZ.ts +++ b/ts/structs/Result_OpenChannelDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_OpenChannelDecodeErrorZ_OK(OpenChannel res) { - this(null, bindings.CResult_OpenChannelDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_OpenChannelDecodeErrorZ_Err extends Result_OpenChannelDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_OpenChannelDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_OpenChannelDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_OpenChannelDecodeErrorZ constructor__ok(OpenChannel o) { + number ret = bindings.CResult_OpenChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_OpenChannelDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_OpenChannelDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_OpenChannelDecodeErrorZ _clone() { + number ret = bindings.CResult_OpenChannelDecodeErrorZ_clone(this.ptr); + Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_OutPointDecodeErrorZ.ts b/ts/structs/Result_OutPointDecodeErrorZ.ts index 7d46bc26..bed0290b 100644 --- a/ts/structs/Result_OutPointDecodeErrorZ.ts +++ b/ts/structs/Result_OutPointDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_OutPointDecodeErrorZ_OK(OutPoint res) { - this(null, bindings.CResult_OutPointDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_OutPointDecodeErrorZ_Err extends Result_OutPointDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_OutPointDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_OutPointDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_OutPointDecodeErrorZ constructor__ok(OutPoint o) { + number ret = bindings.CResult_OutPointDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_OutPointDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_OutPointDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_OutPointDecodeErrorZ _clone() { + number ret = bindings.CResult_OutPointDecodeErrorZ_clone(this.ptr); + Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_PingDecodeErrorZ.ts b/ts/structs/Result_PingDecodeErrorZ.ts index d97504f3..a2ce4415 100644 --- a/ts/structs/Result_PingDecodeErrorZ.ts +++ b/ts/structs/Result_PingDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_PingDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_PingDecodeErrorZ_OK(Ping res) { - this(null, bindings.CResult_PingDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_PingDecodeErrorZ_Err extends Result_PingDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_PingDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_PingDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_PingDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_PingDecodeErrorZ constructor__ok(Ping o) { + number ret = bindings.CResult_PingDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_PingDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_PingDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_PingDecodeErrorZ _clone() { + number ret = bindings.CResult_PingDecodeErrorZ_clone(this.ptr); + Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_PongDecodeErrorZ.ts b/ts/structs/Result_PongDecodeErrorZ.ts index f690d02d..3ccbb31d 100644 --- a/ts/structs/Result_PongDecodeErrorZ.ts +++ b/ts/structs/Result_PongDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_PongDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_PongDecodeErrorZ_OK(Pong res) { - this(null, bindings.CResult_PongDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_PongDecodeErrorZ_Err extends Result_PongDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_PongDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_PongDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_PongDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_PongDecodeErrorZ constructor__ok(Pong o) { + number ret = bindings.CResult_PongDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_PongDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_PongDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_PongDecodeErrorZ _clone() { + number ret = bindings.CResult_PongDecodeErrorZ_clone(this.ptr); + Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_PublicKeyErrorZ.ts b/ts/structs/Result_PublicKeyErrorZ.ts index 2a790f14..3403c981 100644 --- a/ts/structs/Result_PublicKeyErrorZ.ts +++ b/ts/structs/Result_PublicKeyErrorZ.ts @@ -21,9 +21,6 @@ public class Result_PublicKeyErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_PublicKeyErrorZ_get_ok(ptr); } - public Result_PublicKeyErrorZ_OK(Uint8Array res) { - this(null, bindings.CResult_PublicKeyErrorZ_ok(res)); - } } public static final class Result_PublicKeyErrorZ_Err extends Result_PublicKeyErrorZ { @@ -32,8 +29,18 @@ public class Result_PublicKeyErrorZ extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_PublicKeyErrorZ_get_err(ptr); } - public Result_PublicKeyErrorZ_Err(LDKSecp256k1Error err) { - this(null, bindings.CResult_PublicKeyErrorZ_err(err)); - } } + + public static Result_PublicKeyErrorZ constructor__ok(Uint8Array o) { + number ret = bindings.CResult_PublicKeyErrorZ_ok(o); + Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_PublicKeyErrorZ constructor__err(LDKSecp256k1Error e) { + number ret = bindings.CResult_PublicKeyErrorZ_err(e); + Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts b/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts index dd80d084..93c5c144 100644 --- a/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts +++ b/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_QueryChannelRangeDecodeErrorZ_OK(QueryChannelRange res) { - this(null, bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_QueryChannelRangeDecodeErrorZ_Err extends Result_QueryChannelRangeDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_QueryChannelRangeDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_QueryChannelRangeDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_QueryChannelRangeDecodeErrorZ constructor__ok(QueryChannelRange o) { + number ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_QueryChannelRangeDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_QueryChannelRangeDecodeErrorZ _clone() { + number ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_clone(this.ptr); + Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts b/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts index b699612e..1f4a84a5 100644 --- a/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts +++ b/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_QueryShortChannelIdsDecodeErrorZ_OK(QueryShortChannelIds res) { - this(null, bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_QueryShortChannelIdsDecodeErrorZ_Err extends Result_QueryShortChannelIdsDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_QueryShortChannelIdsDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_QueryShortChannelIdsDecodeErrorZ constructor__ok(QueryShortChannelIds o) { + number ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_QueryShortChannelIdsDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_QueryShortChannelIdsDecodeErrorZ _clone() { + number ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_clone(this.ptr); + Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts b/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts index 2fd3593e..ae171310 100644 --- a/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts +++ b/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ReplyChannelRangeDecodeErrorZ_OK(ReplyChannelRange res) { - this(null, bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ReplyChannelRangeDecodeErrorZ_Err extends Result_ReplyChannelRangeDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ReplyChannelRangeDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ReplyChannelRangeDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ReplyChannelRangeDecodeErrorZ constructor__ok(ReplyChannelRange o) { + number ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ReplyChannelRangeDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ReplyChannelRangeDecodeErrorZ _clone() { + number ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_clone(this.ptr); + Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts b/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts index 23a4f46d..33ce0ded 100644 --- a/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts +++ b/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ReplyShortChannelIdsEndDecodeErrorZ_OK(ReplyShortChannelIdsEnd res) { - this(null, bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ReplyShortChannelIdsEndDecodeErrorZ_Err extends Result_ReplyShortChannelIdsEndDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ReplyShortChannelIdsEndDecodeErrorZ constructor__ok(ReplyShortChannelIdsEnd o) { + number ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ReplyShortChannelIdsEndDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ReplyShortChannelIdsEndDecodeErrorZ _clone() { + number ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(this.ptr); + Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_RevokeAndACKDecodeErrorZ.ts b/ts/structs/Result_RevokeAndACKDecodeErrorZ.ts index 30426fd1..9a125b63 100644 --- a/ts/structs/Result_RevokeAndACKDecodeErrorZ.ts +++ b/ts/structs/Result_RevokeAndACKDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_RevokeAndACKDecodeErrorZ_OK(RevokeAndACK res) { - this(null, bindings.CResult_RevokeAndACKDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_RevokeAndACKDecodeErrorZ_Err extends Result_RevokeAndACKDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_RevokeAndACKDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_RevokeAndACKDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_RevokeAndACKDecodeErrorZ constructor__ok(RevokeAndACK o) { + number ret = bindings.CResult_RevokeAndACKDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_RevokeAndACKDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_RevokeAndACKDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_RevokeAndACKDecodeErrorZ _clone() { + number ret = bindings.CResult_RevokeAndACKDecodeErrorZ_clone(this.ptr); + Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_RouteDecodeErrorZ.ts b/ts/structs/Result_RouteDecodeErrorZ.ts index ce596cb2..2a34d449 100644 --- a/ts/structs/Result_RouteDecodeErrorZ.ts +++ b/ts/structs/Result_RouteDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_RouteDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_RouteDecodeErrorZ_OK(Route res) { - this(null, bindings.CResult_RouteDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_RouteDecodeErrorZ_Err extends Result_RouteDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_RouteDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_RouteDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_RouteDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_RouteDecodeErrorZ constructor__ok(Route o) { + number ret = bindings.CResult_RouteDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_RouteDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_RouteDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_RouteDecodeErrorZ _clone() { + number ret = bindings.CResult_RouteDecodeErrorZ_clone(this.ptr); + Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_RouteLightningErrorZ.ts b/ts/structs/Result_RouteLightningErrorZ.ts index 8c84374b..47f961ea 100644 --- a/ts/structs/Result_RouteLightningErrorZ.ts +++ b/ts/structs/Result_RouteLightningErrorZ.ts @@ -24,10 +24,6 @@ public class Result_RouteLightningErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_RouteLightningErrorZ_OK(Route res) { - this(null, bindings.CResult_RouteLightningErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_RouteLightningErrorZ_Err extends Result_RouteLightningErrorZ { @@ -39,9 +35,26 @@ public class Result_RouteLightningErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_RouteLightningErrorZ_Err(LightningError err) { - this(null, bindings.CResult_RouteLightningErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_RouteLightningErrorZ constructor__ok(Route o) { + number ret = bindings.CResult_RouteLightningErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_RouteLightningErrorZ constructor__err(LightningError e) { + number ret = bindings.CResult_RouteLightningErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_RouteLightningErrorZ _clone() { + number ret = bindings.CResult_RouteLightningErrorZ_clone(this.ptr); + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_RoutingFeesDecodeErrorZ.ts b/ts/structs/Result_RoutingFeesDecodeErrorZ.ts index e8aef3a9..851ef573 100644 --- a/ts/structs/Result_RoutingFeesDecodeErrorZ.ts +++ b/ts/structs/Result_RoutingFeesDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_RoutingFeesDecodeErrorZ_OK(RoutingFees res) { - this(null, bindings.CResult_RoutingFeesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_RoutingFeesDecodeErrorZ_Err extends Result_RoutingFeesDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_RoutingFeesDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_RoutingFeesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_RoutingFeesDecodeErrorZ constructor__ok(RoutingFees o) { + number ret = bindings.CResult_RoutingFeesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_RoutingFeesDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_RoutingFeesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_RoutingFeesDecodeErrorZ _clone() { + number ret = bindings.CResult_RoutingFeesDecodeErrorZ_clone(this.ptr); + Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_SecretKeyErrorZ.ts b/ts/structs/Result_SecretKeyErrorZ.ts index 727c4b29..b21a0513 100644 --- a/ts/structs/Result_SecretKeyErrorZ.ts +++ b/ts/structs/Result_SecretKeyErrorZ.ts @@ -21,9 +21,6 @@ public class Result_SecretKeyErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_SecretKeyErrorZ_get_ok(ptr); } - public Result_SecretKeyErrorZ_OK(Uint8Array res) { - this(null, bindings.CResult_SecretKeyErrorZ_ok(res)); - } } public static final class Result_SecretKeyErrorZ_Err extends Result_SecretKeyErrorZ { @@ -32,8 +29,18 @@ public class Result_SecretKeyErrorZ extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_SecretKeyErrorZ_get_err(ptr); } - public Result_SecretKeyErrorZ_Err(LDKSecp256k1Error err) { - this(null, bindings.CResult_SecretKeyErrorZ_err(err)); - } } + + public static Result_SecretKeyErrorZ constructor__ok(Uint8Array o) { + number ret = bindings.CResult_SecretKeyErrorZ_ok(o); + Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_SecretKeyErrorZ constructor__err(LDKSecp256k1Error e) { + number ret = bindings.CResult_SecretKeyErrorZ_err(e); + Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_ShutdownDecodeErrorZ.ts b/ts/structs/Result_ShutdownDecodeErrorZ.ts index 6b53c424..1c0c82d6 100644 --- a/ts/structs/Result_ShutdownDecodeErrorZ.ts +++ b/ts/structs/Result_ShutdownDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_ShutdownDecodeErrorZ_OK(Shutdown res) { - this(null, bindings.CResult_ShutdownDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_ShutdownDecodeErrorZ_Err extends Result_ShutdownDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_ShutdownDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_ShutdownDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_ShutdownDecodeErrorZ constructor__ok(Shutdown o) { + number ret = bindings.CResult_ShutdownDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_ShutdownDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_ShutdownDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_ShutdownDecodeErrorZ _clone() { + number ret = bindings.CResult_ShutdownDecodeErrorZ_clone(this.ptr); + Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_SignDecodeErrorZ.ts b/ts/structs/Result_SignDecodeErrorZ.ts index 005c0a03..9fa88d15 100644 --- a/ts/structs/Result_SignDecodeErrorZ.ts +++ b/ts/structs/Result_SignDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_SignDecodeErrorZ extends CommonBase { ret_hu_conv.ptrs_to.add(this); this.res = ret_hu_conv; } - public Result_SignDecodeErrorZ_OK(Sign res) { - this(null, bindings.CResult_SignDecodeErrorZ_ok(res == null ? 0 : res.ptr)); - this.ptrs_to.add(res); - } } public static final class Result_SignDecodeErrorZ_Err extends Result_SignDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_SignDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_SignDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_SignDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_SignDecodeErrorZ constructor__ok(Sign o) { + number ret = bindings.CResult_SignDecodeErrorZ_ok(o == null ? 0 : o.ptr); + Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_SignDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_SignDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_SignDecodeErrorZ _clone() { + number ret = bindings.CResult_SignDecodeErrorZ_clone(this.ptr); + Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_SignatureNoneZ.ts b/ts/structs/Result_SignatureNoneZ.ts index 56faaa4f..0f884fda 100644 --- a/ts/structs/Result_SignatureNoneZ.ts +++ b/ts/structs/Result_SignatureNoneZ.ts @@ -21,17 +21,30 @@ public class Result_SignatureNoneZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_SignatureNoneZ_get_ok(ptr); } - public Result_SignatureNoneZ_OK(Uint8Array res) { - this(null, bindings.CResult_SignatureNoneZ_ok(res)); - } } public static final class Result_SignatureNoneZ_Err extends Result_SignatureNoneZ { private Result_SignatureNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_SignatureNoneZ_Err() { - this(null, bindings.CResult_SignatureNoneZ_err()); - } } + + public static Result_SignatureNoneZ constructor__ok(Uint8Array o) { + number ret = bindings.CResult_SignatureNoneZ_ok(o); + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_SignatureNoneZ constructor__err() { + number ret = bindings.CResult_SignatureNoneZ_err(); + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public Result_SignatureNoneZ _clone() { + number ret = bindings.CResult_SignatureNoneZ_clone(this.ptr); + Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts b/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts index 38033611..c47948fa 100644 --- a/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts +++ b/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts @@ -24,9 +24,6 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_SpendableOutputDescriptorDecodeErrorZ_OK(SpendableOutputDescriptor res) { - this(null, bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(res.ptr)); - } } public static final class Result_SpendableOutputDescriptorDecodeErrorZ_Err extends Result_SpendableOutputDescriptorDecodeErrorZ { @@ -38,9 +35,25 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_SpendableOutputDescriptorDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_SpendableOutputDescriptorDecodeErrorZ constructor__ok(SpendableOutputDescriptor o) { + number ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o.ptr); + Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_SpendableOutputDescriptorDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_SpendableOutputDescriptorDecodeErrorZ _clone() { + number ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone(this.ptr); + Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_TransactionNoneZ.ts b/ts/structs/Result_TransactionNoneZ.ts index b6abe503..b173cec3 100644 --- a/ts/structs/Result_TransactionNoneZ.ts +++ b/ts/structs/Result_TransactionNoneZ.ts @@ -21,17 +21,24 @@ public class Result_TransactionNoneZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_TransactionNoneZ_get_ok(ptr); } - public Result_TransactionNoneZ_OK(Uint8Array res) { - this(null, bindings.CResult_TransactionNoneZ_ok(res)); - } } public static final class Result_TransactionNoneZ_Err extends Result_TransactionNoneZ { private Result_TransactionNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_TransactionNoneZ_Err() { - this(null, bindings.CResult_TransactionNoneZ_err()); - } } + + public static Result_TransactionNoneZ constructor__ok(Uint8Array o) { + number ret = bindings.CResult_TransactionNoneZ_ok(o); + Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_TransactionNoneZ constructor__err() { + number ret = bindings.CResult_TransactionNoneZ_err(); + Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts b/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts index 798db4f5..641a008f 100644 --- a/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts +++ b/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts @@ -24,26 +24,33 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_TrustedCommitmentTransactionNoneZ_OK(TrustedCommitmentTransaction res) { - this(null, bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid this being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after this call, res is reset to null and is now a dummy object. - res.ptr = 0; - } } public static final class Result_TrustedCommitmentTransactionNoneZ_Err extends Result_TrustedCommitmentTransactionNoneZ { private Result_TrustedCommitmentTransactionNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); } - public Result_TrustedCommitmentTransactionNoneZ_Err() { - this(null, bindings.CResult_TrustedCommitmentTransactionNoneZ_err()); - } } + + public static Result_TrustedCommitmentTransactionNoneZ constructor__ok(TrustedCommitmentTransaction o) { + number ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(o == null ? 0 : o.ptr & ~1); + Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. + o.ptr = 0; + return ret_hu_conv; + } + + public static Result_TrustedCommitmentTransactionNoneZ constructor__err() { + number ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_err(); + Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_TxCreationKeysDecodeErrorZ.ts b/ts/structs/Result_TxCreationKeysDecodeErrorZ.ts index d58dcaf5..fece556f 100644 --- a/ts/structs/Result_TxCreationKeysDecodeErrorZ.ts +++ b/ts/structs/Result_TxCreationKeysDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_TxCreationKeysDecodeErrorZ_OK(TxCreationKeys res) { - this(null, bindings.CResult_TxCreationKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_TxCreationKeysDecodeErrorZ_Err extends Result_TxCreationKeysDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_TxCreationKeysDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_TxCreationKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_TxCreationKeysDecodeErrorZ constructor__ok(TxCreationKeys o) { + number ret = bindings.CResult_TxCreationKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_TxCreationKeysDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_TxCreationKeysDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_TxCreationKeysDecodeErrorZ _clone() { + number ret = bindings.CResult_TxCreationKeysDecodeErrorZ_clone(this.ptr); + Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_TxCreationKeysErrorZ.ts b/ts/structs/Result_TxCreationKeysErrorZ.ts index 964be884..ab2a7315 100644 --- a/ts/structs/Result_TxCreationKeysErrorZ.ts +++ b/ts/structs/Result_TxCreationKeysErrorZ.ts @@ -24,10 +24,6 @@ public class Result_TxCreationKeysErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_TxCreationKeysErrorZ_OK(TxCreationKeys res) { - this(null, bindings.CResult_TxCreationKeysErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_TxCreationKeysErrorZ_Err extends Result_TxCreationKeysErrorZ { @@ -36,8 +32,19 @@ public class Result_TxCreationKeysErrorZ extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_TxCreationKeysErrorZ_get_err(ptr); } - public Result_TxCreationKeysErrorZ_Err(LDKSecp256k1Error err) { - this(null, bindings.CResult_TxCreationKeysErrorZ_err(err)); - } } + + public static Result_TxCreationKeysErrorZ constructor__ok(TxCreationKeys o) { + number ret = bindings.CResult_TxCreationKeysErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_TxCreationKeysErrorZ constructor__err(LDKSecp256k1Error e) { + number ret = bindings.CResult_TxCreationKeysErrorZ_err(e); + Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_TxOutAccessErrorZ.ts b/ts/structs/Result_TxOutAccessErrorZ.ts index 53a09f17..aebc1624 100644 --- a/ts/structs/Result_TxOutAccessErrorZ.ts +++ b/ts/structs/Result_TxOutAccessErrorZ.ts @@ -23,9 +23,6 @@ public class Result_TxOutAccessErrorZ extends CommonBase { TxOut res_conv = new TxOut(null, res); this.res = res_conv; } - public Result_TxOutAccessErrorZ_OK(TxOut res) { - this(null, bindings.CResult_TxOutAccessErrorZ_ok(res.ptr)); - } } public static final class Result_TxOutAccessErrorZ_Err extends Result_TxOutAccessErrorZ { @@ -34,8 +31,24 @@ public class Result_TxOutAccessErrorZ extends CommonBase { super(_dummy, ptr); this.err = bindings.LDKCResult_TxOutAccessErrorZ_get_err(ptr); } - public Result_TxOutAccessErrorZ_Err(LDKAccessError err) { - this(null, bindings.CResult_TxOutAccessErrorZ_err(err)); - } } + + public static Result_TxOutAccessErrorZ constructor__ok(TxOut o) { + number ret = bindings.CResult_TxOutAccessErrorZ_ok(o.ptr); + Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_TxOutAccessErrorZ constructor__err(LDKAccessError e) { + number ret = bindings.CResult_TxOutAccessErrorZ_err(e); + Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public Result_TxOutAccessErrorZ _clone() { + number ret = bindings.CResult_TxOutAccessErrorZ_clone(this.ptr); + Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts b/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts index 4d1dab8e..f0ed63ed 100644 --- a/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts +++ b/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(UnsignedChannelAnnouncement res) { - this(null, bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UnsignedChannelAnnouncementDecodeErrorZ_Err extends Result_UnsignedChannelAnnouncementDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_UnsignedChannelAnnouncementDecodeErrorZ constructor__ok(UnsignedChannelAnnouncement o) { + number ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_UnsignedChannelAnnouncementDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_UnsignedChannelAnnouncementDecodeErrorZ _clone() { + number ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(this.ptr); + Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts b/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts index c9f8fca1..a77733fd 100644 --- a/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts +++ b/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UnsignedChannelUpdateDecodeErrorZ_OK(UnsignedChannelUpdate res) { - this(null, bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UnsignedChannelUpdateDecodeErrorZ_Err extends Result_UnsignedChannelUpdateDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UnsignedChannelUpdateDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_UnsignedChannelUpdateDecodeErrorZ constructor__ok(UnsignedChannelUpdate o) { + number ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_UnsignedChannelUpdateDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_UnsignedChannelUpdateDecodeErrorZ _clone() { + number ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_clone(this.ptr); + Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts b/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts index 9bf0f9e5..7431e082 100644 --- a/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts +++ b/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UnsignedNodeAnnouncementDecodeErrorZ_OK(UnsignedNodeAnnouncement res) { - this(null, bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UnsignedNodeAnnouncementDecodeErrorZ_Err extends Result_UnsignedNodeAnnouncementDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor__ok(UnsignedNodeAnnouncement o) { + number ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_UnsignedNodeAnnouncementDecodeErrorZ _clone() { + number ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(this.ptr); + Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.ts b/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.ts index 5e1b94fa..0f0e7c28 100644 --- a/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.ts +++ b/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateAddHTLCDecodeErrorZ_OK(UpdateAddHTLC res) { - this(null, bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateAddHTLCDecodeErrorZ_Err extends Result_UpdateAddHTLCDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateAddHTLCDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_UpdateAddHTLCDecodeErrorZ constructor__ok(UpdateAddHTLC o) { + number ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_UpdateAddHTLCDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_UpdateAddHTLCDecodeErrorZ _clone() { + number ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_clone(this.ptr); + Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.ts b/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.ts index f1b6b732..b8a0a378 100644 --- a/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.ts +++ b/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateFailHTLCDecodeErrorZ_OK(UpdateFailHTLC res) { - this(null, bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateFailHTLCDecodeErrorZ_Err extends Result_UpdateFailHTLCDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateFailHTLCDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_UpdateFailHTLCDecodeErrorZ constructor__ok(UpdateFailHTLC o) { + number ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_UpdateFailHTLCDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_UpdateFailHTLCDecodeErrorZ _clone() { + number ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_clone(this.ptr); + Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.ts b/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.ts index 8b05b5a2..b56c04a5 100644 --- a/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.ts +++ b/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(UpdateFailMalformedHTLC res) { - this(null, bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateFailMalformedHTLCDecodeErrorZ_Err extends Result_UpdateFailMalformedHTLCDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_UpdateFailMalformedHTLCDecodeErrorZ constructor__ok(UpdateFailMalformedHTLC o) { + number ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_UpdateFailMalformedHTLCDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_UpdateFailMalformedHTLCDecodeErrorZ _clone() { + number ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(this.ptr); + Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_UpdateFeeDecodeErrorZ.ts b/ts/structs/Result_UpdateFeeDecodeErrorZ.ts index abb01dd7..8f124ba5 100644 --- a/ts/structs/Result_UpdateFeeDecodeErrorZ.ts +++ b/ts/structs/Result_UpdateFeeDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateFeeDecodeErrorZ_OK(UpdateFee res) { - this(null, bindings.CResult_UpdateFeeDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateFeeDecodeErrorZ_Err extends Result_UpdateFeeDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateFeeDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateFeeDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_UpdateFeeDecodeErrorZ constructor__ok(UpdateFee o) { + number ret = bindings.CResult_UpdateFeeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_UpdateFeeDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_UpdateFeeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_UpdateFeeDecodeErrorZ _clone() { + number ret = bindings.CResult_UpdateFeeDecodeErrorZ_clone(this.ptr); + Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.ts b/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.ts index 4899f6fc..39d38c4e 100644 --- a/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.ts +++ b/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.ts @@ -24,10 +24,6 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } - public Result_UpdateFulfillHTLCDecodeErrorZ_OK(UpdateFulfillHTLC res) { - this(null, bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); - this.ptrs_to.add(res); - } } public static final class Result_UpdateFulfillHTLCDecodeErrorZ_Err extends Result_UpdateFulfillHTLCDecodeErrorZ { @@ -39,9 +35,26 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_UpdateFulfillHTLCDecodeErrorZ_Err(DecodeError err) { - this(null, bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_UpdateFulfillHTLCDecodeErrorZ constructor__ok(UpdateFulfillHTLC o) { + number ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o); + return ret_hu_conv; + } + + public static Result_UpdateFulfillHTLCDecodeErrorZ constructor__err(DecodeError e) { + number ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_UpdateFulfillHTLCDecodeErrorZ _clone() { + number ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone(this.ptr); + Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_boolLightningErrorZ.ts b/ts/structs/Result_boolLightningErrorZ.ts index 1b5ac3dd..454ecdc6 100644 --- a/ts/structs/Result_boolLightningErrorZ.ts +++ b/ts/structs/Result_boolLightningErrorZ.ts @@ -21,9 +21,6 @@ public class Result_boolLightningErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_boolLightningErrorZ_get_ok(ptr); } - public Result_boolLightningErrorZ_OK(boolean res) { - this(null, bindings.CResult_boolLightningErrorZ_ok(res)); - } } public static final class Result_boolLightningErrorZ_Err extends Result_boolLightningErrorZ { @@ -35,9 +32,25 @@ public class Result_boolLightningErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_boolLightningErrorZ_Err(LightningError err) { - this(null, bindings.CResult_boolLightningErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_boolLightningErrorZ constructor__ok(boolean o) { + number ret = bindings.CResult_boolLightningErrorZ_ok(o); + Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_boolLightningErrorZ constructor__err(LightningError e) { + number ret = bindings.CResult_boolLightningErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_boolLightningErrorZ _clone() { + number ret = bindings.CResult_boolLightningErrorZ_clone(this.ptr); + Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/Result_boolPeerHandleErrorZ.ts b/ts/structs/Result_boolPeerHandleErrorZ.ts index c1a720de..e91e237e 100644 --- a/ts/structs/Result_boolPeerHandleErrorZ.ts +++ b/ts/structs/Result_boolPeerHandleErrorZ.ts @@ -21,9 +21,6 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { super(_dummy, ptr); this.res = bindings.LDKCResult_boolPeerHandleErrorZ_get_ok(ptr); } - public Result_boolPeerHandleErrorZ_OK(boolean res) { - this(null, bindings.CResult_boolPeerHandleErrorZ_ok(res)); - } } public static final class Result_boolPeerHandleErrorZ_Err extends Result_boolPeerHandleErrorZ { @@ -35,9 +32,25 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_boolPeerHandleErrorZ_Err(PeerHandleError err) { - this(null, bindings.CResult_boolPeerHandleErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_boolPeerHandleErrorZ constructor__ok(boolean o) { + number ret = bindings.CResult_boolPeerHandleErrorZ_ok(o); + Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_boolPeerHandleErrorZ constructor__err(PeerHandleError e) { + number ret = bindings.CResult_boolPeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(e); + return ret_hu_conv; + } + + public Result_boolPeerHandleErrorZ _clone() { + number ret = bindings.CResult_boolPeerHandleErrorZ_clone(this.ptr); + Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/RouteHint.ts b/ts/structs/RouteHint.ts index 9e0474f5..babcda0f 100644 --- a/ts/structs/RouteHint.ts +++ b/ts/structs/RouteHint.ts @@ -57,6 +57,36 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.RouteHint_set_cltv_expiry_delta(this.ptr, val); } + public Option_u64Z get_htlc_minimum_msat() { + number ret = bindings.RouteHint_get_htlc_minimum_msat(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public void set_htlc_minimum_msat(Option_u64Z val) { + bindings.RouteHint_set_htlc_minimum_msat(this.ptr, val.ptr); + } + + public Option_u64Z get_htlc_maximum_msat() { + number ret = bindings.RouteHint_get_htlc_maximum_msat(this.ptr); + Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public void set_htlc_maximum_msat(Option_u64Z val) { + bindings.RouteHint_set_htlc_maximum_msat(this.ptr, val.ptr); + } + + public static RouteHint constructor_new(Uint8Array src_node_id_arg, number short_channel_id_arg, RoutingFees fees_arg, number cltv_expiry_delta_arg, Option_u64Z htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg) { + number ret = bindings.RouteHint_new(src_node_id_arg, short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr); + const ret_hu_conv: RouteHint = new RouteHint(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(fees_arg); + return ret_hu_conv; + } + public RouteHint clone() { number ret = bindings.RouteHint_clone(this.ptr); const ret_hu_conv: RouteHint = new RouteHint(null, ret); diff --git a/ts/structs/SpendableOutputDescriptor.ts b/ts/structs/SpendableOutputDescriptor.ts index b2481d75..caf6286f 100644 --- a/ts/structs/SpendableOutputDescriptor.ts +++ b/ts/structs/SpendableOutputDescriptor.ts @@ -38,12 +38,41 @@ export class StaticOutput extends SpendableOutputDescriptor { } } export class DelayedPaymentOutput extends SpendableOutputDescriptor { + public delayed_payment_output: DelayedPaymentOutputDescriptor; private constructor(ptr: number, obj: bindings.LDKSpendableOutputDescriptor.DelayedPaymentOutput) { super(null, ptr); + const delayed_payment_output: number = obj.delayed_payment_output; + const delayed_payment_output_hu_conv: DelayedPaymentOutputDescriptor = new DelayedPaymentOutputDescriptor(null, delayed_payment_output); + delayed_payment_output_hu_conv.ptrs_to.add(this); + this.delayed_payment_output = delayed_payment_output_hu_conv; } } export class StaticPaymentOutput extends SpendableOutputDescriptor { + public static_payment_output: StaticPaymentOutputDescriptor; private constructor(ptr: number, obj: bindings.LDKSpendableOutputDescriptor.StaticPaymentOutput) { super(null, ptr); + const static_payment_output: number = obj.static_payment_output; + const static_payment_output_hu_conv: StaticPaymentOutputDescriptor = new StaticPaymentOutputDescriptor(null, static_payment_output); + static_payment_output_hu_conv.ptrs_to.add(this); + this.static_payment_output = static_payment_output_hu_conv; } +} + public SpendableOutputDescriptor clone() { + number ret = bindings.SpendableOutputDescriptor_clone(this.ptr); + SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public Uint8Array write() { + Uint8Array ret = bindings.SpendableOutputDescriptor_write(this.ptr); + return ret; + } + + public static Result_SpendableOutputDescriptorDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.SpendableOutputDescriptor_read(ser); + Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/ts/structs/WatchedOutput.ts b/ts/structs/WatchedOutput.ts new file mode 100644 index 00000000..c0c0515a --- /dev/null +++ b/ts/structs/WatchedOutput.ts @@ -0,0 +1,59 @@ + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export default class WatchedOutput extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.WatchedOutput_free(this.ptr); + } + } + public Uint8Array get_block_hash() { + Uint8Array ret = bindings.WatchedOutput_get_block_hash(this.ptr); + return ret; + } + + public void set_block_hash(Uint8Array val) { + bindings.WatchedOutput_set_block_hash(this.ptr, val); + } + + public OutPoint get_outpoint() { + number ret = bindings.WatchedOutput_get_outpoint(this.ptr); + const ret_hu_conv: OutPoint = new OutPoint(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public void set_outpoint(OutPoint val) { + bindings.WatchedOutput_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + + public Uint8Array get_script_pubkey() { + Uint8Array ret = bindings.WatchedOutput_get_script_pubkey(this.ptr); + return ret; + } + + public void set_script_pubkey(Uint8Array val) { + bindings.WatchedOutput_set_script_pubkey(this.ptr, val); + } + + public static WatchedOutput constructor_new(Uint8Array block_hash_arg, OutPoint outpoint_arg, Uint8Array script_pubkey_arg) { + number ret = bindings.WatchedOutput_new(block_hash_arg, outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg); + const ret_hu_conv: WatchedOutput = new WatchedOutput(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(outpoint_arg); + return ret_hu_conv; + } + +}