From: Matt Corallo Date: Fri, 8 Jan 2021 04:33:25 +0000 (-0500) Subject: Updated bindings X-Git-Tag: v0.0.1~70 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=a9b82019e7ffa7d32d44943133bb64e1197bd2f1;p=ldk-java Updated bindings --- diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 097aa220..744af9f7 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -36,82 +36,11 @@ public class bindings { static { LDKLevel.values(); /* Force enum statics to run */ } static { LDKNetwork.values(); /* Force enum statics to run */ } static { LDKSecp256k1Error.values(); /* Force enum statics to run */ } - public static native VecOrSliceDef LDKCVecTempl_u8_arr_info(long vec_ptr); - public static native long LDKCVecTempl_u8_new(byte[] elems); - public static native long LDKC2TupleTempl_usize__Transaction_new(long a, byte[] b); - public static native long LDKC2Tuple_usizeTransactionZ_get_a(long ptr); - public static native byte[] LDKC2Tuple_usizeTransactionZ_get_b(long ptr); - public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg); - public static native byte LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(long arg); - public static native LDKChannelMonitorUpdateErr LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(long arg); - public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg); - public static native byte LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg); - public static native long LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg); - public static native long LDKC2TupleTempl_OutPoint__CVec_u8Z_new(long a, byte[] b); - public static native long LDKC2Tuple_OutPointScriptZ_get_a(long ptr); - public static native byte[] LDKC2Tuple_OutPointScriptZ_get_b(long ptr); - public static native VecOrSliceDef LDKCVecTempl_TxOut_arr_info(long vec_ptr); - public static native long LDKCVecTempl_TxOut_new(long[] elems); - public static native long LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_new(byte[] a, long[] b); - public static native byte[] LDKC2Tuple_TxidCVec_TxOutZZ_get_a(long ptr); - public static native long[] LDKC2Tuple_TxidCVec_TxOutZZ_get_b(long ptr); - public static native long LDKC2TupleTempl_u64__u64_new(long a, long b); + public static native VecOrSliceDef LDKCVec_u8Z_arr_info(long vec_ptr); + public static native long LDKCVec_u8Z_new(byte[] elems); + public static native long LDKC2Tuple_u64u64Z_new(long a, long b); public static native long LDKC2Tuple_u64u64Z_get_a(long ptr); public static native long LDKC2Tuple_u64u64Z_get_b(long ptr); - public static native VecOrSliceDef LDKCVecTempl_Signature_arr_info(long vec_ptr); - public static native long LDKC2TupleTempl_Signature__CVecTempl_Signature_new(byte[] a, byte[][] b); - public static native byte[] LDKC2Tuple_SignatureCVec_SignatureZZ_get_a(long ptr); - public static native byte[][] LDKC2Tuple_SignatureCVec_SignatureZZ_get_b(long ptr); - public static native boolean LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(long arg); - public static native long LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(long arg); - public static native byte LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(long arg); - public static native boolean LDKCResult_SignatureNoneZ_result_ok(long arg); - public static native byte[] LDKCResult_SignatureNoneZ_get_ok(long arg); - public static native byte LDKCResult_SignatureNoneZ_get_err(long arg); - public static native boolean LDKCResult_CVec_SignatureZNoneZ_result_ok(long arg); - public static native byte[][] LDKCResult_CVec_SignatureZNoneZ_get_ok(long arg); - public static native byte LDKCResult_CVec_SignatureZNoneZ_get_err(long arg); - public static class LDKAPIError { - private LDKAPIError() {} - public final static class APIMisuseError extends LDKAPIError { - public byte[] err; - APIMisuseError(byte[] err) { this.err = err; } - } - public final static class FeeRateTooHigh extends LDKAPIError { - public byte[] err; - public int feerate; - FeeRateTooHigh(byte[] err, int feerate) { this.err = err; this.feerate = feerate; } - } - public final static class RouteError extends LDKAPIError { - public String err; - RouteError(String err) { this.err = err; } - } - public final static class ChannelUnavailable extends LDKAPIError { - public byte[] err; - ChannelUnavailable(byte[] err) { this.err = err; } - } - public final static class MonitorUpdateFailed extends LDKAPIError { - } - static native void init(); - } - static { LDKAPIError.init(); } - public static native LDKAPIError LDKAPIError_ref_from_ptr(long ptr); - public static native boolean LDKCResult_NoneAPIErrorZ_result_ok(long arg); - public static native byte LDKCResult_NoneAPIErrorZ_get_ok(long arg); - public static native long LDKCResult_NoneAPIErrorZ_get_err(long arg); - public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg); - public static native byte LDKCResult_NonePaymentSendFailureZ_get_ok(long arg); - public static native long LDKCResult_NonePaymentSendFailureZ_get_err(long arg); - public static native long LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_new(long a, long b, long c); - public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(long ptr); - public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(long ptr); - public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(long ptr); - public static native boolean LDKCResult_NonePeerHandleErrorZ_result_ok(long arg); - public static native byte LDKCResult_NonePeerHandleErrorZ_get_ok(long arg); - public static native long LDKCResult_NonePeerHandleErrorZ_get_err(long arg); - public static native long LDKC2TupleTempl_HTLCOutputInCommitment__Signature_new(long a, byte[] b); - public static native long LDKC2Tuple_HTLCOutputInCommitmentSignatureZ_get_a(long ptr); - public static native byte[] LDKC2Tuple_HTLCOutputInCommitmentSignatureZ_get_b(long ptr); public static class LDKSpendableOutputDescriptor { private LDKSpendableOutputDescriptor() {} public final static class StaticOutput extends LDKSpendableOutputDescriptor { @@ -138,49 +67,8 @@ public class bindings { } static { LDKSpendableOutputDescriptor.init(); } public static native LDKSpendableOutputDescriptor LDKSpendableOutputDescriptor_ref_from_ptr(long ptr); - public static native VecOrSliceDef LDKCVecTempl_SpendableOutputDescriptor_arr_info(long vec_ptr); - public static native long LDKCVecTempl_SpendableOutputDescriptor_new(long[] elems); - public static class LDKEvent { - private LDKEvent() {} - public final static class FundingGenerationReady extends LDKEvent { - public byte[] temporary_channel_id; - public long channel_value_satoshis; - public byte[] output_script; - public long user_channel_id; - FundingGenerationReady(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } - } - public final static class FundingBroadcastSafe extends LDKEvent { - public long funding_txo; - public long user_channel_id; - FundingBroadcastSafe(long funding_txo, long user_channel_id) { this.funding_txo = funding_txo; this.user_channel_id = user_channel_id; } - } - public final static class PaymentReceived extends LDKEvent { - public byte[] payment_hash; - public byte[] payment_secret; - public long amt; - PaymentReceived(byte[] payment_hash, byte[] payment_secret, long amt) { this.payment_hash = payment_hash; this.payment_secret = payment_secret; this.amt = amt; } - } - public final static class PaymentSent extends LDKEvent { - public byte[] payment_preimage; - PaymentSent(byte[] payment_preimage) { this.payment_preimage = payment_preimage; } - } - public final static class PaymentFailed extends LDKEvent { - public byte[] payment_hash; - public boolean rejected_by_dest; - PaymentFailed(byte[] payment_hash, boolean rejected_by_dest) { this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; } - } - public final static class PendingHTLCsForwardable extends LDKEvent { - public long time_forwardable; - PendingHTLCsForwardable(long time_forwardable) { this.time_forwardable = time_forwardable; } - } - public final static class SpendableOutputs extends LDKEvent { - public long[] outputs; - SpendableOutputs(long[] outputs) { this.outputs = outputs; } - } - static native void init(); - } - static { LDKEvent.init(); } - public static native LDKEvent LDKEvent_ref_from_ptr(long ptr); + public static native VecOrSliceDef LDKCVec_SpendableOutputDescriptorZ_arr_info(long vec_ptr); + public static native long LDKCVec_SpendableOutputDescriptorZ_new(long[] elems); public static class LDKErrorAction { private LDKErrorAction() {} public final static class DisconnectPeer extends LDKErrorAction { @@ -296,57 +184,120 @@ public class bindings { public long update; PaymentFailureNetworkUpdate(long update) { this.update = update; } } + public final static class SendChannelRangeQuery extends LDKMessageSendEvent { + public byte[] node_id; + public long msg; + SendChannelRangeQuery(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class SendShortIdsQuery extends LDKMessageSendEvent { + public byte[] node_id; + public long msg; + SendShortIdsQuery(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } static native void init(); } static { LDKMessageSendEvent.init(); } public static native LDKMessageSendEvent LDKMessageSendEvent_ref_from_ptr(long ptr); - public static native VecOrSliceDef LDKCVecTempl_MessageSendEvent_arr_info(long vec_ptr); - public static native long LDKCVecTempl_MessageSendEvent_new(long[] elems); - public interface LDKMessageSendEventsProvider { - long[] get_and_clear_pending_msg_events(); - } - public static native long LDKMessageSendEventsProvider_new(LDKMessageSendEventsProvider impl); - public static native LDKMessageSendEventsProvider LDKMessageSendEventsProvider_get_obj_from_jcalls(long val); - // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider* this_arg - public static native long[] MessageSendEventsProvider_get_and_clear_pending_msg_events(long this_arg); - public static native VecOrSliceDef LDKCVecTempl_Event_arr_info(long vec_ptr); - public static native long LDKCVecTempl_Event_new(long[] elems); - public interface LDKEventsProvider { - long[] get_and_clear_pending_events(); - } - public static native long LDKEventsProvider_new(LDKEventsProvider impl); - public static native LDKEventsProvider LDKEventsProvider_get_obj_from_jcalls(long val); - // LDKCVec_EventZ EventsProvider_get_and_clear_pending_events LDKEventsProvider* this_arg - public static native long[] EventsProvider_get_and_clear_pending_events(long this_arg); - public interface LDKLogger { - void log(String record); - } - public static native long LDKLogger_new(LDKLogger impl); - public static native LDKLogger LDKLogger_get_obj_from_jcalls(long val); - 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 interface LDKAccess { - long get_utxo(byte[] genesis_hash, long short_channel_id); + public static native VecOrSliceDef LDKCVec_MessageSendEventZ_arr_info(long vec_ptr); + public static native long LDKCVec_MessageSendEventZ_new(long[] elems); + public static class LDKEvent { + private LDKEvent() {} + public final static class FundingGenerationReady extends LDKEvent { + public byte[] temporary_channel_id; + public long channel_value_satoshis; + public byte[] output_script; + public long user_channel_id; + FundingGenerationReady(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } + } + public final static class FundingBroadcastSafe extends LDKEvent { + public long funding_txo; + public long user_channel_id; + FundingBroadcastSafe(long funding_txo, long user_channel_id) { this.funding_txo = funding_txo; this.user_channel_id = user_channel_id; } + } + public final static class PaymentReceived extends LDKEvent { + public byte[] payment_hash; + public byte[] payment_secret; + public long amt; + PaymentReceived(byte[] payment_hash, byte[] payment_secret, long amt) { this.payment_hash = payment_hash; this.payment_secret = payment_secret; this.amt = amt; } + } + public final static class PaymentSent extends LDKEvent { + public byte[] payment_preimage; + PaymentSent(byte[] payment_preimage) { this.payment_preimage = payment_preimage; } + } + public final static class PaymentFailed extends LDKEvent { + public byte[] payment_hash; + public boolean rejected_by_dest; + PaymentFailed(byte[] payment_hash, boolean rejected_by_dest) { this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; } + } + public final static class PendingHTLCsForwardable extends LDKEvent { + public long time_forwardable; + PendingHTLCsForwardable(long time_forwardable) { this.time_forwardable = time_forwardable; } + } + public final static class SpendableOutputs extends LDKEvent { + public long[] outputs; + SpendableOutputs(long[] outputs) { this.outputs = outputs; } + } + static native void init(); } - public static native long LDKAccess_new(LDKAccess impl); - public static native LDKAccess LDKAccess_get_obj_from_jcalls(long val); - // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id - public static native long Access_get_utxo(long this_arg, byte[] genesis_hash, long short_channel_id); - public static native long[] LDKCVecTempl_HTLCOutputInCommitment_arr_info(long vec_ptr); - public static native long LDKCVecTempl_HTLCOutputInCommitment_new(long[] elems); + static { LDKEvent.init(); } + public static native LDKEvent LDKEvent_ref_from_ptr(long ptr); + public static native VecOrSliceDef LDKCVec_EventZ_arr_info(long vec_ptr); + public static native long LDKCVec_EventZ_new(long[] elems); + public static native long LDKC2Tuple_usizeTransactionZ_new(long a, byte[] b); + public static native long LDKC2Tuple_usizeTransactionZ_get_a(long ptr); + public static native byte[] LDKC2Tuple_usizeTransactionZ_get_b(long ptr); + public static native VecOrSliceDef LDKCVec_C2Tuple_usizeTransactionZZ_arr_info(long vec_ptr); + public static native long LDKCVec_C2Tuple_usizeTransactionZZ_new(long[] elems); + public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg); + public static native void LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(long arg); + public static native LDKChannelMonitorUpdateErr LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(long arg); + public static native long[] LDKCVec_MonitorEventZ_arr_info(long vec_ptr); + public static native long LDKCVec_MonitorEventZ_new(long[] elems); + public static native boolean LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg); + public static native void LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg); + public static native long LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg); + public static native long LDKC2Tuple_OutPointScriptZ_new(long a, byte[] b); + public static native long LDKC2Tuple_OutPointScriptZ_get_a(long ptr); + public static native byte[] LDKC2Tuple_OutPointScriptZ_get_b(long ptr); + public static native VecOrSliceDef LDKCVec_TransactionZ_arr_info(long vec_ptr); + public static native long LDKC2Tuple_u32TxOutZ_new(int a, long b); + public static native int LDKC2Tuple_u32TxOutZ_get_a(long ptr); + public static native long LDKC2Tuple_u32TxOutZ_get_b(long ptr); + public static native VecOrSliceDef LDKCVec_C2Tuple_u32TxOutZZ_arr_info(long vec_ptr); + public static native long LDKCVec_C2Tuple_u32TxOutZZ_new(long[] elems); + public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(byte[] a, long[] b); + public static native byte[] LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(long ptr); + public static native long[] LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(long ptr); + public static native VecOrSliceDef LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_arr_info(long vec_ptr); + public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new(long[] elems); + public static native VecOrSliceDef LDKCVec_SignatureZ_arr_info(long vec_ptr); + public static native long LDKC2Tuple_SignatureCVec_SignatureZZ_new(byte[] a, byte[][] b); + public static native byte[] LDKC2Tuple_SignatureCVec_SignatureZZ_get_a(long ptr); + public static native byte[][] LDKC2Tuple_SignatureCVec_SignatureZZ_get_b(long ptr); + public static native boolean LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(long arg); + public static native long LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(long arg); + public static native void LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(long arg); + public static native boolean LDKCResult_SignatureNoneZ_result_ok(long arg); + public static native byte[] LDKCResult_SignatureNoneZ_get_ok(long arg); + public static native void LDKCResult_SignatureNoneZ_get_err(long arg); + public static native boolean LDKCResult_CVec_SignatureZNoneZ_result_ok(long arg); + public static native byte[][] LDKCResult_CVec_SignatureZNoneZ_get_ok(long arg); + public static native void LDKCResult_CVec_SignatureZNoneZ_get_err(long arg); public interface LDKChannelKeys { byte[] get_per_commitment_point(long idx); byte[] release_commitment_secret(long idx); long key_derivation_params(); - long sign_counterparty_commitment(int feerate_per_kw, byte[] commitment_tx, long keys, long[] htlcs); - long sign_holder_commitment(long holder_commitment_tx); - long sign_holder_commitment_htlc_transactions(long holder_commitment_tx); + long sign_counterparty_commitment(long commitment_tx); + long sign_holder_commitment(long commitment_tx); + long sign_holder_commitment_htlc_transactions(long commitment_tx); long sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc); long sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc); long sign_closing_transaction(byte[] closing_tx); long sign_channel_announcement(long msg); - void on_accept(long channel_points, short counterparty_selected_contest_delay, short holder_selected_contest_delay); + void ready_channel(long channel_parameters); byte[] write(); } public static native long LDKChannelKeys_new(LDKChannelKeys impl, long pubkeys); @@ -357,28 +308,109 @@ public class bindings { public static native byte[] ChannelKeys_release_commitment_secret(long this_arg, long idx); // LDKC2Tuple_u64u64Z ChannelKeys_key_derivation_params LDKChannelKeys* this_arg public static native long ChannelKeys_key_derivation_params(long this_arg); - // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ChannelKeys_sign_counterparty_commitment LDKChannelKeys* this_arg, uint32_t feerate_per_kw, LDKTransaction commitment_tx, const LDKPreCalculatedTxCreationKeys *keys, LDKCVec_HTLCOutputInCommitmentZ htlcs - public static native long ChannelKeys_sign_counterparty_commitment(long this_arg, int feerate_per_kw, byte[] commitment_tx, long keys, long[] htlcs); - // LDKCResult_SignatureNoneZ ChannelKeys_sign_holder_commitment LDKChannelKeys* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx - public static native long ChannelKeys_sign_holder_commitment(long this_arg, long holder_commitment_tx); - // LDKCResult_CVec_SignatureZNoneZ ChannelKeys_sign_holder_commitment_htlc_transactions LDKChannelKeys* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx - public static native long ChannelKeys_sign_holder_commitment_htlc_transactions(long this_arg, long holder_commitment_tx); - // LDKCResult_SignatureNoneZ ChannelKeys_sign_justice_transaction LDKChannelKeys* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const LDKHTLCOutputInCommitment *htlc + // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ChannelKeys_sign_counterparty_commitment LDKChannelKeys* this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx + public static native long ChannelKeys_sign_counterparty_commitment(long this_arg, long commitment_tx); + // LDKCResult_SignatureNoneZ ChannelKeys_sign_holder_commitment LDKChannelKeys* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx + public static native long ChannelKeys_sign_holder_commitment(long this_arg, long commitment_tx); + // LDKCResult_CVec_SignatureZNoneZ ChannelKeys_sign_holder_commitment_htlc_transactions LDKChannelKeys* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx + public static native long ChannelKeys_sign_holder_commitment_htlc_transactions(long this_arg, long commitment_tx); + // LDKCResult_SignatureNoneZ ChannelKeys_sign_justice_transaction LDKChannelKeys* this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc public static native long ChannelKeys_sign_justice_transaction(long this_arg, byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc); - // LDKCResult_SignatureNoneZ ChannelKeys_sign_counterparty_htlc_transaction LDKChannelKeys* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment *htlc + // LDKCResult_SignatureNoneZ ChannelKeys_sign_counterparty_htlc_transaction LDKChannelKeys* this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc public static native long ChannelKeys_sign_counterparty_htlc_transaction(long this_arg, byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc); - // LDKCResult_SignatureNoneZ ChannelKeys_sign_closing_transaction LDKChannelKeys* this_arg, LDKTransaction closing_tx + // LDKCResult_SignatureNoneZ ChannelKeys_sign_closing_transaction LDKChannelKeys* this_arg, struct LDKTransaction closing_tx public static native long ChannelKeys_sign_closing_transaction(long this_arg, byte[] closing_tx); - // LDKCResult_SignatureNoneZ ChannelKeys_sign_channel_announcement LDKChannelKeys* this_arg, const LDKUnsignedChannelAnnouncement *msg + // LDKCResult_SignatureNoneZ ChannelKeys_sign_channel_announcement LDKChannelKeys* this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg public static native long ChannelKeys_sign_channel_announcement(long this_arg, long msg); - // void ChannelKeys_on_accept LDKChannelKeys* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay - public static native void ChannelKeys_on_accept(long this_arg, long channel_points, short counterparty_selected_contest_delay, short holder_selected_contest_delay); + // void ChannelKeys_ready_channel LDKChannelKeys* this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters + public static native void ChannelKeys_ready_channel(long this_arg, long channel_parameters); // LDKCVec_u8Z ChannelKeys_write LDKChannelKeys* this_arg public static native byte[] ChannelKeys_write(long this_arg); // LDKChannelPublicKeys ChannelKeys_get_pubkeys LDKChannelKeys* this_arg public static native long ChannelKeys_get_pubkeys(long this_arg); - public static native long[] LDKCVecTempl_MonitorEvent_arr_info(long vec_ptr); - public static native long LDKCVecTempl_MonitorEvent_new(long[] elems); + public static native long LDKC2Tuple_BlockHashChannelMonitorZ_new(byte[] a, long b); + public static native byte[] LDKC2Tuple_BlockHashChannelMonitorZ_get_a(long ptr); + public static native long LDKC2Tuple_BlockHashChannelMonitorZ_get_b(long ptr); + public static native boolean LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_ChanKeySignerDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_ChanKeySignerDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_ChanKeySignerDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err(long arg); + 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 LDKAPIError { + private LDKAPIError() {} + public final static class APIMisuseError extends LDKAPIError { + public byte[] err; + APIMisuseError(byte[] err) { this.err = err; } + } + public final static class FeeRateTooHigh extends LDKAPIError { + public byte[] err; + public int feerate; + FeeRateTooHigh(byte[] err, int feerate) { this.err = err; this.feerate = feerate; } + } + public final static class RouteError extends LDKAPIError { + public String err; + RouteError(String err) { this.err = err; } + } + public final static class ChannelUnavailable extends LDKAPIError { + public byte[] err; + ChannelUnavailable(byte[] err) { this.err = err; } + } + public final static class MonitorUpdateFailed extends LDKAPIError { + } + static native void init(); + } + static { LDKAPIError.init(); } + public static native LDKAPIError LDKAPIError_ref_from_ptr(long ptr); + public static native boolean LDKCResult_NoneAPIErrorZ_result_ok(long arg); + public static native void LDKCResult_NoneAPIErrorZ_get_ok(long arg); + public static native long LDKCResult_NoneAPIErrorZ_get_err(long arg); + public static native long[] LDKCVec_ChannelDetailsZ_arr_info(long vec_ptr); + public static native long LDKCVec_ChannelDetailsZ_new(long[] elems); + public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg); + public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg); + public static native long LDKCResult_NonePaymentSendFailureZ_get_err(long arg); + public static class LDKNetAddress { + private LDKNetAddress() {} + public final static class IPv4 extends LDKNetAddress { + public byte[] addr; + public short port; + IPv4(byte[] addr, short port) { this.addr = addr; this.port = port; } + } + public final static class IPv6 extends LDKNetAddress { + public byte[] addr; + public short port; + IPv6(byte[] addr, short port) { this.addr = addr; this.port = port; } + } + public final static class OnionV2 extends LDKNetAddress { + public byte[] addr; + public short port; + OnionV2(byte[] addr, short port) { this.addr = addr; this.port = port; } + } + public final static class OnionV3 extends LDKNetAddress { + public byte[] ed25519_pubkey; + public short checksum; + public byte version; + public short port; + OnionV3(byte[] ed25519_pubkey, short checksum, byte version, short port) { this.ed25519_pubkey = ed25519_pubkey; this.checksum = checksum; this.version = version; this.port = port; } + } + static native void init(); + } + static { LDKNetAddress.init(); } + public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr); + public static native VecOrSliceDef LDKCVec_NetAddressZ_arr_info(long vec_ptr); + public static native long LDKCVec_NetAddressZ_new(long[] elems); + public static native long[] LDKCVec_ChannelMonitorZ_arr_info(long vec_ptr); + public static native long LDKCVec_ChannelMonitorZ_new(long[] elems); public interface LDKWatch { long watch_channel(long funding_txo, long monitor); long update_channel(long funding_txo, long update); @@ -386,47 +418,26 @@ public class bindings { } public static native long LDKWatch_new(LDKWatch impl); public static native LDKWatch LDKWatch_get_obj_from_jcalls(long val); - // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_watch_channel LDKWatch* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor + // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_watch_channel LDKWatch* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor public static native long Watch_watch_channel(long this_arg, long funding_txo, long monitor); - // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_update_channel LDKWatch* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update + // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_update_channel LDKWatch* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update public static native long Watch_update_channel(long this_arg, long funding_txo, long update); // LDKCVec_MonitorEventZ Watch_release_pending_monitor_events LDKWatch* this_arg public static native long[] Watch_release_pending_monitor_events(long this_arg); - public interface LDKFilter { - void register_tx(byte[] txid, byte[] script_pubkey); - void register_output(long outpoint, byte[] script_pubkey); - } - public static native long LDKFilter_new(LDKFilter impl); - public static native LDKFilter LDKFilter_get_obj_from_jcalls(long val); - // void Filter_register_tx LDKFilter* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pubkey - public static native void Filter_register_tx(long this_arg, byte[] txid, byte[] script_pubkey); - // void Filter_register_output LDKFilter* this_arg, const LDKOutPoint *outpoint, LDKu8slice script_pubkey - public static native void Filter_register_output(long this_arg, long outpoint, byte[] script_pubkey); public interface LDKBroadcasterInterface { void broadcast_transaction(byte[] tx); } public static native long LDKBroadcasterInterface_new(LDKBroadcasterInterface impl); public static native LDKBroadcasterInterface LDKBroadcasterInterface_get_obj_from_jcalls(long val); - // void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface* this_arg, LDKTransaction tx + // void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface* this_arg, struct LDKTransaction tx public static native void BroadcasterInterface_broadcast_transaction(long this_arg, byte[] tx); - public interface LDKFeeEstimator { - int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target); - } - public static native long LDKFeeEstimator_new(LDKFeeEstimator impl); - public static native LDKFeeEstimator LDKFeeEstimator_get_obj_from_jcalls(long val); - // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator* this_arg, LDKConfirmationTarget confirmation_target - public static native int FeeEstimator_get_est_sat_per_1000_weight(long this_arg, LDKConfirmationTarget confirmation_target); - public static native VecOrSliceDef LDKCVecTempl_C2TupleTempl_usize__Transaction_arr_info(long vec_ptr); - public static native long LDKCVecTempl_C2TupleTempl_usize__Transaction_new(long[] elems); - public static native VecOrSliceDef LDKCVecTempl_Transaction_arr_info(long vec_ptr); - public static native VecOrSliceDef LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_arr_info(long vec_ptr); - public static native long LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_new(long[] elems); public interface LDKKeysInterface { byte[] get_node_secret(); byte[] get_destination_script(); byte[] get_shutdown_pubkey(); long get_channel_keys(boolean inbound, long channel_value_satoshis); byte[] get_secure_random_bytes(); + long read_chan_signer(byte[] reader); } public static native long LDKKeysInterface_new(LDKKeysInterface impl); public static native LDKKeysInterface LDKKeysInterface_get_obj_from_jcalls(long val); @@ -440,38 +451,181 @@ public class bindings { public static native long KeysInterface_get_channel_keys(long this_arg, boolean inbound, long channel_value_satoshis); // LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface* this_arg public static native byte[] KeysInterface_get_secure_random_bytes(long this_arg); - public static native long[] LDKCVecTempl_ChannelDetails_arr_info(long vec_ptr); - public static native long LDKCVecTempl_ChannelDetails_new(long[] elems); - public static class LDKNetAddress { - private LDKNetAddress() {} - public final static class IPv4 extends LDKNetAddress { - public byte[] addr; - public short port; - IPv4(byte[] addr, short port) { this.addr = addr; this.port = port; } - } - public final static class IPv6 extends LDKNetAddress { - public byte[] addr; - public short port; - IPv6(byte[] addr, short port) { this.addr = addr; this.port = port; } - } - public final static class OnionV2 extends LDKNetAddress { - public byte[] addr; - public short port; - OnionV2(byte[] addr, short port) { this.addr = addr; this.port = port; } - } - public final static class OnionV3 extends LDKNetAddress { - public byte[] ed25519_pubkey; - public short checksum; - public byte version; - public short port; - OnionV3(byte[] ed25519_pubkey, short checksum, byte version, short port) { this.ed25519_pubkey = ed25519_pubkey; this.checksum = checksum; this.version = version; this.port = port; } - } - static native void init(); + // LDKCResult_ChanKeySignerDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface* this_arg, struct LDKu8slice reader + public static native long KeysInterface_read_chan_signer(long this_arg, byte[] reader); + public interface LDKFeeEstimator { + int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target); } - static { LDKNetAddress.init(); } - public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr); - public static native VecOrSliceDef LDKCVecTempl_NetAddress_arr_info(long vec_ptr); - public static native long LDKCVecTempl_NetAddress_new(long[] elems); + public static native long LDKFeeEstimator_new(LDKFeeEstimator impl); + public static native LDKFeeEstimator LDKFeeEstimator_get_obj_from_jcalls(long val); + // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator* this_arg, enum LDKConfirmationTarget confirmation_target + public static native int FeeEstimator_get_est_sat_per_1000_weight(long this_arg, LDKConfirmationTarget confirmation_target); + public interface LDKLogger { + void log(String record); + } + public static native long LDKLogger_new(LDKLogger impl); + public static native LDKLogger LDKLogger_get_obj_from_jcalls(long val); + public static native long LDKC2Tuple_BlockHashChannelManagerZ_new(byte[] a, long b); + public static native byte[] LDKC2Tuple_BlockHashChannelManagerZ_get_a(long ptr); + public static native long LDKC2Tuple_BlockHashChannelManagerZ_get_b(long ptr); + public static native boolean LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_NetAddressu8Z_result_ok(long arg); + public static native long LDKCResult_NetAddressu8Z_get_ok(long arg); + public static native byte LDKCResult_NetAddressu8Z_get_err(long arg); + public static native boolean LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(long arg); + public static native VecOrSliceDef LDKCVec_u64Z_arr_info(long vec_ptr); + public static native long LDKCVec_u64Z_new(long[] elems); + public static native long[] LDKCVec_UpdateAddHTLCZ_arr_info(long vec_ptr); + public static native long LDKCVec_UpdateAddHTLCZ_new(long[] elems); + public static native long[] LDKCVec_UpdateFulfillHTLCZ_arr_info(long vec_ptr); + public static native long LDKCVec_UpdateFulfillHTLCZ_new(long[] elems); + public static native long[] LDKCVec_UpdateFailHTLCZ_arr_info(long vec_ptr); + public static native long LDKCVec_UpdateFailHTLCZ_new(long[] elems); + public static native long[] LDKCVec_UpdateFailMalformedHTLCZ_arr_info(long vec_ptr); + public static native long LDKCVec_UpdateFailMalformedHTLCZ_new(long[] elems); + public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg); + public static native boolean LDKCResult_boolLightningErrorZ_get_ok(long arg); + public static native long LDKCResult_boolLightningErrorZ_get_err(long arg); + public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(long a, long b, long c); + public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(long ptr); + public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(long ptr); + public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(long ptr); + public static native VecOrSliceDef LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_arr_info(long vec_ptr); + public static native long LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new(long[] elems); + public static native long[] LDKCVec_NodeAnnouncementZ_arr_info(long vec_ptr); + public static native long LDKCVec_NodeAnnouncementZ_new(long[] elems); + public static native boolean LDKCResult_NoneLightningErrorZ_result_ok(long arg); + public static native void LDKCResult_NoneLightningErrorZ_get_ok(long arg); + public static native long LDKCResult_NoneLightningErrorZ_get_err(long arg); + public static native boolean LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_ChannelReestablishDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_InitDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_InitDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_InitDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_PingDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_PingDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_PingDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_PongDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_PongDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_PongDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_ErrorMessageDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_ErrorMessageDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_ErrorMessageDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(long arg); + public static native VecOrSliceDef LDKCVec_PublicKeyZ_arr_info(long vec_ptr); + public static native boolean LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(long arg); + public static native byte[] LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(long arg); + public static native long LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(long arg); + public static native boolean LDKCResult_NonePeerHandleErrorZ_result_ok(long arg); + public static native void LDKCResult_NonePeerHandleErrorZ_get_ok(long arg); + public static native long LDKCResult_NonePeerHandleErrorZ_get_err(long arg); + public static native boolean LDKCResult_boolPeerHandleErrorZ_result_ok(long arg); + public static native boolean LDKCResult_boolPeerHandleErrorZ_get_ok(long arg); + public static native long LDKCResult_boolPeerHandleErrorZ_get_err(long arg); + public static native boolean LDKCResult_SecretKeySecpErrorZ_result_ok(long arg); + public static native byte[] LDKCResult_SecretKeySecpErrorZ_get_ok(long arg); + public static native LDKSecp256k1Error LDKCResult_SecretKeySecpErrorZ_get_err(long arg); + public static native boolean LDKCResult_PublicKeySecpErrorZ_result_ok(long arg); + public static native byte[] LDKCResult_PublicKeySecpErrorZ_get_ok(long arg); + public static native LDKSecp256k1Error LDKCResult_PublicKeySecpErrorZ_get_err(long arg); + public static native boolean LDKCResult_TxCreationKeysSecpErrorZ_result_ok(long arg); + public static native long LDKCResult_TxCreationKeysSecpErrorZ_get_ok(long arg); + public static native LDKSecp256k1Error LDKCResult_TxCreationKeysSecpErrorZ_get_err(long arg); + public static native boolean LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(long arg); + public static native long LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(long arg); + public static native void LDKCResult_TrustedCommitmentTransactionNoneZ_get_err(long arg); + public static native long[] LDKCVec_RouteHopZ_arr_info(long vec_ptr); + public static native long LDKCVec_RouteHopZ_new(long[] elems); + public static native VecOrSliceDef LDKCVec_CVec_RouteHopZZ_arr_info(long vec_ptr); + public static native boolean LDKCResult_RouteDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_RouteDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_RouteDecodeErrorZ_get_err(long arg); + public static native long[] LDKCVec_RouteHintZ_arr_info(long vec_ptr); + public static native long LDKCVec_RouteHintZ_new(long[] elems); + public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg); + public static native long LDKCResult_RouteLightningErrorZ_get_ok(long arg); + public static native long LDKCResult_RouteLightningErrorZ_get_err(long arg); + public static native boolean LDKCResult_RoutingFeesDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_RoutingFeesDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_RoutingFeesDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_NodeInfoDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_NodeInfoDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_NodeInfoDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_NetworkGraphDecodeErrorZ_result_ok(long arg); + public static native long LDKCResult_NetworkGraphDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_NetworkGraphDecodeErrorZ_get_err(long arg); + public interface LDKMessageSendEventsProvider { + long[] get_and_clear_pending_msg_events(); + } + public static native long LDKMessageSendEventsProvider_new(LDKMessageSendEventsProvider impl); + public static native LDKMessageSendEventsProvider LDKMessageSendEventsProvider_get_obj_from_jcalls(long val); + // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider* this_arg + public static native long[] MessageSendEventsProvider_get_and_clear_pending_msg_events(long this_arg); + public interface LDKEventsProvider { + long[] get_and_clear_pending_events(); + } + public static native long LDKEventsProvider_new(LDKEventsProvider impl); + public static native LDKEventsProvider LDKEventsProvider_get_obj_from_jcalls(long val); + // LDKCVec_EventZ EventsProvider_get_and_clear_pending_events LDKEventsProvider* this_arg + public static native long[] EventsProvider_get_and_clear_pending_events(long this_arg); + public interface LDKAccess { + long get_utxo(byte[] genesis_hash, long short_channel_id); + } + public static native long LDKAccess_new(LDKAccess impl); + public static native LDKAccess LDKAccess_get_obj_from_jcalls(long val); + // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id + public static native long Access_get_utxo(long this_arg, byte[] genesis_hash, long short_channel_id); + public interface LDKFilter { + void register_tx(byte[] txid, byte[] script_pubkey); + void register_output(long outpoint, byte[] script_pubkey); + } + public static native long LDKFilter_new(LDKFilter impl); + public static native LDKFilter LDKFilter_get_obj_from_jcalls(long val); + // void Filter_register_tx LDKFilter* 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* 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); + public interface LDKPersist { + long persist_new_channel(long id, long data); + long update_persisted_channel(long id, long update, long data); + } + public static native long LDKPersist_new(LDKPersist impl); + public static native LDKPersist LDKPersist_get_obj_from_jcalls(long val); + // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data + public static native long Persist_persist_new_channel(long this_arg, long id, long data); + // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data + public static native long Persist_update_persisted_channel(long this_arg, long id, long update, long data); public interface LDKChannelMessageHandler { void handle_open_channel(byte[] their_node_id, long their_features, long msg); void handle_accept_channel(byte[] their_node_id, long their_features, long msg); @@ -495,63 +649,44 @@ public class bindings { } public static native long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider); public static native LDKChannelMessageHandler LDKChannelMessageHandler_get_obj_from_jcalls(long val); - // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg + // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_open_channel(long this_arg, byte[] their_node_id, long their_features, long msg); - // void ChannelMessageHandler_handle_accept_channel LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg + // void ChannelMessageHandler_handle_accept_channel LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_accept_channel(long this_arg, byte[] their_node_id, long their_features, long msg); - // void ChannelMessageHandler_handle_funding_created LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg + // void ChannelMessageHandler_handle_funding_created LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_funding_created(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_funding_signed LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg + // void ChannelMessageHandler_handle_funding_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_funding_signed(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_funding_locked LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg + // void ChannelMessageHandler_handle_funding_locked LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_funding_locked(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg + // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_shutdown(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg + // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_closing_signed(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_update_add_htlc LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg + // void ChannelMessageHandler_handle_update_add_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_update_add_htlc(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_update_fulfill_htlc LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg + // void ChannelMessageHandler_handle_update_fulfill_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_update_fulfill_htlc(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_update_fail_htlc LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg + // void ChannelMessageHandler_handle_update_fail_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_update_fail_htlc(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_update_fail_malformed_htlc LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg + // void ChannelMessageHandler_handle_update_fail_malformed_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_update_fail_malformed_htlc(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_commitment_signed LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg + // void ChannelMessageHandler_handle_commitment_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_commitment_signed(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_revoke_and_ack LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg + // void ChannelMessageHandler_handle_revoke_and_ack LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_revoke_and_ack(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_update_fee LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg + // void ChannelMessageHandler_handle_update_fee LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_update_fee(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_announcement_signatures LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg + // void ChannelMessageHandler_handle_announcement_signatures LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_announcement_signatures(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_peer_disconnected LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, bool no_connection_possible + // void ChannelMessageHandler_peer_disconnected LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible public static native void ChannelMessageHandler_peer_disconnected(long this_arg, byte[] their_node_id, boolean no_connection_possible); - // void ChannelMessageHandler_peer_connected LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKInit *msg + // void ChannelMessageHandler_peer_connected LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg public static native void ChannelMessageHandler_peer_connected(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg + // void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_channel_reestablish(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_error LDKChannelMessageHandler* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg + // void ChannelMessageHandler_handle_error LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_error(long this_arg, byte[] their_node_id, long msg); - public static native long[] LDKCVecTempl_ChannelMonitor_arr_info(long vec_ptr); - public static native long LDKCVecTempl_ChannelMonitor_new(long[] elems); - public static native VecOrSliceDef LDKCVecTempl_u64_arr_info(long vec_ptr); - public static native long LDKCVecTempl_u64_new(long[] elems); - public static native long[] LDKCVecTempl_UpdateAddHTLC_arr_info(long vec_ptr); - public static native long LDKCVecTempl_UpdateAddHTLC_new(long[] elems); - public static native long[] LDKCVecTempl_UpdateFulfillHTLC_arr_info(long vec_ptr); - public static native long LDKCVecTempl_UpdateFulfillHTLC_new(long[] elems); - public static native long[] LDKCVecTempl_UpdateFailHTLC_arr_info(long vec_ptr); - public static native long LDKCVecTempl_UpdateFailHTLC_new(long[] elems); - public static native long[] LDKCVecTempl_UpdateFailMalformedHTLC_arr_info(long vec_ptr); - public static native long LDKCVecTempl_UpdateFailMalformedHTLC_new(long[] elems); - public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg); - public static native boolean LDKCResult_boolLightningErrorZ_get_ok(long arg); - public static native long LDKCResult_boolLightningErrorZ_get_err(long arg); - public static native VecOrSliceDef LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_arr_info(long vec_ptr); - public static native long LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_new(long[] elems); - public static native long[] LDKCVecTempl_NodeAnnouncement_arr_info(long vec_ptr); - public static native long LDKCVecTempl_NodeAnnouncement_new(long[] elems); public interface LDKRoutingMessageHandler { long handle_node_announcement(long msg); long handle_channel_announcement(long msg); @@ -559,24 +694,36 @@ public class bindings { void handle_htlc_fail_channel_update(long update); long[] get_next_channel_announcements(long starting_point, byte batch_amount); long[] get_next_node_announcements(byte[] starting_point, byte batch_amount); - boolean should_request_full_sync(byte[] node_id); + void sync_routing_table(byte[] their_node_id, long init); + long handle_reply_channel_range(byte[] their_node_id, long msg); + long handle_reply_short_channel_ids_end(byte[] their_node_id, long msg); + long handle_query_channel_range(byte[] their_node_id, long msg); + long handle_query_short_channel_ids(byte[] their_node_id, long msg); } - public static native long LDKRoutingMessageHandler_new(LDKRoutingMessageHandler impl); + public static native long LDKRoutingMessageHandler_new(LDKRoutingMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider); public static native LDKRoutingMessageHandler LDKRoutingMessageHandler_get_obj_from_jcalls(long val); - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler* this_arg, const LDKNodeAnnouncement *msg + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler* this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg public static native long RoutingMessageHandler_handle_node_announcement(long this_arg, long msg); - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler* this_arg, const LDKChannelAnnouncement *msg + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler* this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg public static native long RoutingMessageHandler_handle_channel_announcement(long this_arg, long msg); - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler* this_arg, const LDKChannelUpdate *msg + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler* this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg public static native long RoutingMessageHandler_handle_channel_update(long this_arg, long msg); - // void RoutingMessageHandler_handle_htlc_fail_channel_update LDKRoutingMessageHandler* this_arg, const LDKHTLCFailChannelUpdate *update + // void RoutingMessageHandler_handle_htlc_fail_channel_update LDKRoutingMessageHandler* this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update public static native void RoutingMessageHandler_handle_htlc_fail_channel_update(long this_arg, long update); // LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ RoutingMessageHandler_get_next_channel_announcements LDKRoutingMessageHandler* this_arg, uint64_t starting_point, uint8_t batch_amount public static native long[] RoutingMessageHandler_get_next_channel_announcements(long this_arg, long starting_point, byte batch_amount); - // LDKCVec_NodeAnnouncementZ RoutingMessageHandler_get_next_node_announcements LDKRoutingMessageHandler* this_arg, LDKPublicKey starting_point, uint8_t batch_amount + // LDKCVec_NodeAnnouncementZ RoutingMessageHandler_get_next_node_announcements LDKRoutingMessageHandler* this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount public static native long[] RoutingMessageHandler_get_next_node_announcements(long this_arg, byte[] starting_point, byte batch_amount); - // bool RoutingMessageHandler_should_request_full_sync LDKRoutingMessageHandler* this_arg, LDKPublicKey node_id - public static native boolean RoutingMessageHandler_should_request_full_sync(long this_arg, byte[] node_id); + // void RoutingMessageHandler_sync_routing_table LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init + public static native void RoutingMessageHandler_sync_routing_table(long this_arg, byte[] their_node_id, long init); + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_channel_range LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg + public static native long RoutingMessageHandler_handle_reply_channel_range(long this_arg, byte[] their_node_id, long msg); + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_short_channel_ids_end LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg + public static native long RoutingMessageHandler_handle_reply_short_channel_ids_end(long this_arg, byte[] their_node_id, long msg); + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_channel_range LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg + public static native long RoutingMessageHandler_handle_query_channel_range(long this_arg, byte[] their_node_id, long msg); + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_short_channel_ids LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg + public static native long RoutingMessageHandler_handle_query_short_channel_ids(long this_arg, byte[] their_node_id, long msg); public interface LDKSocketDescriptor { long send_data(byte[] data, boolean resume_read); void disconnect_socket(); @@ -585,1868 +732,2152 @@ public class bindings { } public static native long LDKSocketDescriptor_new(LDKSocketDescriptor impl); public static native LDKSocketDescriptor LDKSocketDescriptor_get_obj_from_jcalls(long val); - // uintptr_t SocketDescriptor_send_data LDKSocketDescriptor* this_arg, LDKu8slice data, bool resume_read + // uintptr_t SocketDescriptor_send_data LDKSocketDescriptor* this_arg, struct LDKu8slice data, bool resume_read public static native long SocketDescriptor_send_data(long this_arg, byte[] data, boolean resume_read); // void SocketDescriptor_disconnect_socket LDKSocketDescriptor* this_arg public static native void SocketDescriptor_disconnect_socket(long this_arg); // uint64_t SocketDescriptor_hash LDKSocketDescriptor* this_arg public static native long SocketDescriptor_hash(long this_arg); - public static native VecOrSliceDef LDKCVecTempl_PublicKey_arr_info(long vec_ptr); - public static native boolean LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(long arg); - public static native byte[] LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(long arg); - public static native long LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_boolPeerHandleErrorZ_result_ok(long arg); - public static native boolean LDKCResult_boolPeerHandleErrorZ_get_ok(long arg); - public static native long LDKCResult_boolPeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_SecretKeySecpErrorZ_result_ok(long arg); - public static native byte[] LDKCResult_SecretKeySecpErrorZ_get_ok(long arg); - public static native LDKSecp256k1Error LDKCResult_SecretKeySecpErrorZ_get_err(long arg); - public static native boolean LDKCResult_PublicKeySecpErrorZ_result_ok(long arg); - public static native byte[] LDKCResult_PublicKeySecpErrorZ_get_ok(long arg); - public static native LDKSecp256k1Error LDKCResult_PublicKeySecpErrorZ_get_err(long arg); - public static native boolean LDKCResult_TxCreationKeysSecpErrorZ_result_ok(long arg); - public static native long LDKCResult_TxCreationKeysSecpErrorZ_get_ok(long arg); - public static native LDKSecp256k1Error LDKCResult_TxCreationKeysSecpErrorZ_get_err(long arg); - public static native VecOrSliceDef LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature_arr_info(long vec_ptr); - public static native long LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature_new(long[] elems); - public static native long[] LDKCVecTempl_RouteHop_arr_info(long vec_ptr); - public static native long LDKCVecTempl_RouteHop_new(long[] elems); - public static native VecOrSliceDef LDKCVecTempl_CVecTempl_RouteHop_arr_info(long vec_ptr); - public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg); - public static native long LDKCResult_RouteLightningErrorZ_get_ok(long arg); - public static native long LDKCResult_RouteLightningErrorZ_get_err(long arg); - public static native long[] LDKCVecTempl_RouteHint_arr_info(long vec_ptr); - public static native long LDKCVecTempl_RouteHint_new(long[] elems); - // extern const void (*C2Tuple_HTLCOutputInCommitmentSignatureZ_free)(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ); - public static native void C2Tuple_HTLCOutputInCommitmentSignatureZ_free(long arg); - // extern const void (*C2Tuple_OutPointScriptZ_free)(LDKC2Tuple_OutPointScriptZ); - public static native void C2Tuple_OutPointScriptZ_free(long arg); - // extern const void (*C2Tuple_SignatureCVec_SignatureZZ_free)(LDKC2Tuple_SignatureCVec_SignatureZZ); - public static native void C2Tuple_SignatureCVec_SignatureZZ_free(long arg); - // extern const void (*C2Tuple_TxidCVec_TxOutZZ_free)(LDKC2Tuple_TxidCVec_TxOutZZ); - public static native void C2Tuple_TxidCVec_TxOutZZ_free(long arg); - // extern const void (*C2Tuple_u64u64Z_free)(LDKC2Tuple_u64u64Z); - public static native void C2Tuple_u64u64Z_free(long arg); - // extern const void (*C2Tuple_usizeTransactionZ_free)(LDKC2Tuple_usizeTransactionZ); - public static native void C2Tuple_usizeTransactionZ_free(long arg); - // extern const void (*C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free)(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ); - public static native void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(long arg); - // extern const void (*CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free)(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ); - public static native void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(long arg); - // extern const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok)(LDKC2Tuple_SignatureCVec_SignatureZZ); - public static native long CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(long arg); - // extern const void (*CResult_CVec_SignatureZNoneZ_free)(LDKCResult_CVec_SignatureZNoneZ); - public static native void CResult_CVec_SignatureZNoneZ_free(long arg); - // extern const LDKCResult_CVec_SignatureZNoneZ (*CResult_CVec_SignatureZNoneZ_ok)(LDKCVec_SignatureZ); - public static native long CResult_CVec_SignatureZNoneZ_ok(byte[][] arg); - // extern const LDKCResult_CVec_u8ZPeerHandleErrorZ (*CResult_CVec_u8ZPeerHandleErrorZ_err)(LDKPeerHandleError); - public static native long CResult_CVec_u8ZPeerHandleErrorZ_err(long arg); - // extern const void (*CResult_CVec_u8ZPeerHandleErrorZ_free)(LDKCResult_CVec_u8ZPeerHandleErrorZ); - public static native void CResult_CVec_u8ZPeerHandleErrorZ_free(long arg); - // extern const LDKCResult_CVec_u8ZPeerHandleErrorZ (*CResult_CVec_u8ZPeerHandleErrorZ_ok)(LDKCVec_u8Z); - public static native long CResult_CVec_u8ZPeerHandleErrorZ_ok(byte[] arg); - // extern const LDKCResult_NoneAPIErrorZ (*CResult_NoneAPIErrorZ_err)(LDKAPIError); - public static native long CResult_NoneAPIErrorZ_err(long arg); - // extern const void (*CResult_NoneAPIErrorZ_free)(LDKCResult_NoneAPIErrorZ); - public static native void CResult_NoneAPIErrorZ_free(long arg); - // extern const LDKCResult_NoneChannelMonitorUpdateErrZ (*CResult_NoneChannelMonitorUpdateErrZ_err)(LDKChannelMonitorUpdateErr); - public static native long CResult_NoneChannelMonitorUpdateErrZ_err(LDKChannelMonitorUpdateErr arg); - // extern const void (*CResult_NoneChannelMonitorUpdateErrZ_free)(LDKCResult_NoneChannelMonitorUpdateErrZ); - public static native void CResult_NoneChannelMonitorUpdateErrZ_free(long arg); - // extern const LDKCResult_NoneMonitorUpdateErrorZ (*CResult_NoneMonitorUpdateErrorZ_err)(LDKMonitorUpdateError); - public static native long CResult_NoneMonitorUpdateErrorZ_err(long arg); - // extern const void (*CResult_NoneMonitorUpdateErrorZ_free)(LDKCResult_NoneMonitorUpdateErrorZ); - public static native void CResult_NoneMonitorUpdateErrorZ_free(long arg); - // extern const LDKCResult_NonePaymentSendFailureZ (*CResult_NonePaymentSendFailureZ_err)(LDKPaymentSendFailure); - public static native long CResult_NonePaymentSendFailureZ_err(long arg); - // extern const void (*CResult_NonePaymentSendFailureZ_free)(LDKCResult_NonePaymentSendFailureZ); - public static native void CResult_NonePaymentSendFailureZ_free(long arg); - // extern const LDKCResult_NonePeerHandleErrorZ (*CResult_NonePeerHandleErrorZ_err)(LDKPeerHandleError); - public static native long CResult_NonePeerHandleErrorZ_err(long arg); - // extern const void (*CResult_NonePeerHandleErrorZ_free)(LDKCResult_NonePeerHandleErrorZ); - public static native void CResult_NonePeerHandleErrorZ_free(long arg); - // extern const LDKCResult_PublicKeySecpErrorZ (*CResult_PublicKeySecpErrorZ_err)(LDKSecp256k1Error); - public static native long CResult_PublicKeySecpErrorZ_err(LDKSecp256k1Error arg); - // extern const void (*CResult_PublicKeySecpErrorZ_free)(LDKCResult_PublicKeySecpErrorZ); - public static native void CResult_PublicKeySecpErrorZ_free(long arg); - // extern const LDKCResult_PublicKeySecpErrorZ (*CResult_PublicKeySecpErrorZ_ok)(LDKPublicKey); - public static native long CResult_PublicKeySecpErrorZ_ok(byte[] arg); - // extern const LDKCResult_RouteLightningErrorZ (*CResult_RouteLightningErrorZ_err)(LDKLightningError); - public static native long CResult_RouteLightningErrorZ_err(long arg); - // extern const void (*CResult_RouteLightningErrorZ_free)(LDKCResult_RouteLightningErrorZ); - public static native void CResult_RouteLightningErrorZ_free(long arg); - // extern const LDKCResult_RouteLightningErrorZ (*CResult_RouteLightningErrorZ_ok)(LDKRoute); - public static native long CResult_RouteLightningErrorZ_ok(long arg); - // extern const LDKCResult_SecretKeySecpErrorZ (*CResult_SecretKeySecpErrorZ_err)(LDKSecp256k1Error); - public static native long CResult_SecretKeySecpErrorZ_err(LDKSecp256k1Error arg); - // extern const void (*CResult_SecretKeySecpErrorZ_free)(LDKCResult_SecretKeySecpErrorZ); - public static native void CResult_SecretKeySecpErrorZ_free(long arg); - // extern const LDKCResult_SecretKeySecpErrorZ (*CResult_SecretKeySecpErrorZ_ok)(LDKSecretKey); - public static native long CResult_SecretKeySecpErrorZ_ok(byte[] arg); - // extern const void (*CResult_SignatureNoneZ_free)(LDKCResult_SignatureNoneZ); - public static native void CResult_SignatureNoneZ_free(long arg); - // extern const LDKCResult_SignatureNoneZ (*CResult_SignatureNoneZ_ok)(LDKSignature); - public static native long CResult_SignatureNoneZ_ok(byte[] arg); - // extern const LDKCResult_TxCreationKeysSecpErrorZ (*CResult_TxCreationKeysSecpErrorZ_err)(LDKSecp256k1Error); - public static native long CResult_TxCreationKeysSecpErrorZ_err(LDKSecp256k1Error arg); - // extern const void (*CResult_TxCreationKeysSecpErrorZ_free)(LDKCResult_TxCreationKeysSecpErrorZ); - public static native void CResult_TxCreationKeysSecpErrorZ_free(long arg); - // extern const LDKCResult_TxCreationKeysSecpErrorZ (*CResult_TxCreationKeysSecpErrorZ_ok)(LDKTxCreationKeys); - public static native long CResult_TxCreationKeysSecpErrorZ_ok(long arg); - // extern const LDKCResult_TxOutAccessErrorZ (*CResult_TxOutAccessErrorZ_err)(LDKAccessError); - public static native long CResult_TxOutAccessErrorZ_err(LDKAccessError arg); - // extern const void (*CResult_TxOutAccessErrorZ_free)(LDKCResult_TxOutAccessErrorZ); - public static native void CResult_TxOutAccessErrorZ_free(long arg); - // extern const LDKCResult_TxOutAccessErrorZ (*CResult_TxOutAccessErrorZ_ok)(LDKTxOut); - public static native long CResult_TxOutAccessErrorZ_ok(long arg); - // extern const LDKCResult_boolLightningErrorZ (*CResult_boolLightningErrorZ_err)(LDKLightningError); - public static native long CResult_boolLightningErrorZ_err(long arg); - // extern const void (*CResult_boolLightningErrorZ_free)(LDKCResult_boolLightningErrorZ); - public static native void CResult_boolLightningErrorZ_free(long arg); - // extern const LDKCResult_boolLightningErrorZ (*CResult_boolLightningErrorZ_ok)(bool); - public static native long CResult_boolLightningErrorZ_ok(boolean arg); - // extern const LDKCResult_boolPeerHandleErrorZ (*CResult_boolPeerHandleErrorZ_err)(LDKPeerHandleError); - public static native long CResult_boolPeerHandleErrorZ_err(long arg); - // extern const void (*CResult_boolPeerHandleErrorZ_free)(LDKCResult_boolPeerHandleErrorZ); - public static native void CResult_boolPeerHandleErrorZ_free(long arg); - // extern const LDKCResult_boolPeerHandleErrorZ (*CResult_boolPeerHandleErrorZ_ok)(bool); - public static native long CResult_boolPeerHandleErrorZ_ok(boolean arg); - // extern const void (*CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free)(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ); - public static native void CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(long[] arg); - // extern const void (*CVec_C2Tuple_TxidCVec_TxOutZZZ_free)(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ); - public static native void CVec_C2Tuple_TxidCVec_TxOutZZZ_free(long[] arg); - // extern const void (*CVec_C2Tuple_usizeTransactionZZ_free)(LDKCVec_C2Tuple_usizeTransactionZZ); - public static native void CVec_C2Tuple_usizeTransactionZZ_free(long[] arg); - // extern const void (*CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free)(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ); - public static native void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(long[] arg); - // extern const void (*CVec_CVec_RouteHopZZ_free)(LDKCVec_CVec_RouteHopZZ); - public static native void CVec_CVec_RouteHopZZ_free(long[][] arg); - // extern const void (*CVec_ChannelDetailsZ_free)(LDKCVec_ChannelDetailsZ); - public static native void CVec_ChannelDetailsZ_free(long[] arg); - // extern const void (*CVec_ChannelMonitorZ_free)(LDKCVec_ChannelMonitorZ); - public static native void CVec_ChannelMonitorZ_free(long[] arg); - // extern const void (*CVec_EventZ_free)(LDKCVec_EventZ); - public static native void CVec_EventZ_free(long[] arg); - // extern const void (*CVec_HTLCOutputInCommitmentZ_free)(LDKCVec_HTLCOutputInCommitmentZ); - public static native void CVec_HTLCOutputInCommitmentZ_free(long[] arg); - // extern const void (*CVec_MessageSendEventZ_free)(LDKCVec_MessageSendEventZ); - public static native void CVec_MessageSendEventZ_free(long[] arg); - // extern const void (*CVec_MonitorEventZ_free)(LDKCVec_MonitorEventZ); - public static native void CVec_MonitorEventZ_free(long[] arg); - // extern const void (*CVec_NetAddressZ_free)(LDKCVec_NetAddressZ); - public static native void CVec_NetAddressZ_free(long[] arg); - // extern const void (*CVec_NodeAnnouncementZ_free)(LDKCVec_NodeAnnouncementZ); - public static native void CVec_NodeAnnouncementZ_free(long[] arg); - // extern const void (*CVec_PublicKeyZ_free)(LDKCVec_PublicKeyZ); - public static native void CVec_PublicKeyZ_free(byte[][] arg); - // extern const void (*CVec_RouteHintZ_free)(LDKCVec_RouteHintZ); - public static native void CVec_RouteHintZ_free(long[] arg); - // extern const void (*CVec_RouteHopZ_free)(LDKCVec_RouteHopZ); - public static native void CVec_RouteHopZ_free(long[] arg); - // extern const void (*CVec_SignatureZ_free)(LDKCVec_SignatureZ); - public static native void CVec_SignatureZ_free(byte[][] arg); - // extern const void (*CVec_SpendableOutputDescriptorZ_free)(LDKCVec_SpendableOutputDescriptorZ); - public static native void CVec_SpendableOutputDescriptorZ_free(long[] arg); - // extern const void (*CVec_TransactionZ_free)(LDKCVec_TransactionZ); - public static native void CVec_TransactionZ_free(byte[][] arg); - // extern const void (*CVec_TxOutZ_free)(LDKCVec_TxOutZ); - public static native void CVec_TxOutZ_free(long[] arg); - // extern const void (*CVec_UpdateAddHTLCZ_free)(LDKCVec_UpdateAddHTLCZ); - public static native void CVec_UpdateAddHTLCZ_free(long[] arg); - // extern const void (*CVec_UpdateFailHTLCZ_free)(LDKCVec_UpdateFailHTLCZ); - public static native void CVec_UpdateFailHTLCZ_free(long[] arg); - // extern const void (*CVec_UpdateFailMalformedHTLCZ_free)(LDKCVec_UpdateFailMalformedHTLCZ); - public static native void CVec_UpdateFailMalformedHTLCZ_free(long[] arg); - // extern const void (*CVec_UpdateFulfillHTLCZ_free)(LDKCVec_UpdateFulfillHTLCZ); - public static native void CVec_UpdateFulfillHTLCZ_free(long[] arg); - // extern const void (*CVec_u64Z_free)(LDKCVec_u64Z); - public static native void CVec_u64Z_free(long[] arg); - // extern const void (*CVec_u8Z_free)(LDKCVec_u8Z); - public static native void CVec_u8Z_free(byte[] arg); - // void Transaction_free(LDKTransaction _res); + // void Transaction_free(struct LDKTransaction _res); public static native void Transaction_free(byte[] _res); - // void TxOut_free(LDKTxOut _res); + // void TxOut_free(struct LDKTxOut _res); public static native void TxOut_free(long _res); - // LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, LDKTransaction b); + // struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig); + public static native long TxOut_clone(long orig); + // void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res); + public static native void CVec_SpendableOutputDescriptorZ_free(long[] _res); + // void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res); + public static native void CVec_MessageSendEventZ_free(long[] _res); + // void CVec_EventZ_free(struct LDKCVec_EventZ _res); + public static native void CVec_EventZ_free(long[] _res); + // void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res); + public static native void C2Tuple_usizeTransactionZ_free(long _res); + // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); public static native long C2Tuple_usizeTransactionZ_new(long a, byte[] b); - // LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void); + // void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res); + public static native void CVec_C2Tuple_usizeTransactionZZ_free(long[] _res); + // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void); public static native long CResult_NoneChannelMonitorUpdateErrZ_ok(); - // LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void); + // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e); + public static native long CResult_NoneChannelMonitorUpdateErrZ_err(LDKChannelMonitorUpdateErr e); + // void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res); + public static native void CResult_NoneChannelMonitorUpdateErrZ_free(long _res); + // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); + public static native void CVec_MonitorEventZ_free(long[] _res); + // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o); + public static native long CResult_ChannelMonitorUpdateDecodeErrorZ_ok(long o); + // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ChannelMonitorUpdateDecodeErrorZ_err(long e); + // void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res); + public static native void CResult_ChannelMonitorUpdateDecodeErrorZ_free(long _res); + // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void); public static native long CResult_NoneMonitorUpdateErrorZ_ok(); - // LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(LDKOutPoint a, LDKCVec_u8Z b); + // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e); + public static native long CResult_NoneMonitorUpdateErrorZ_err(long e); + // void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res); + public static native void CResult_NoneMonitorUpdateErrorZ_free(long _res); + // void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res); + public static native void C2Tuple_OutPointScriptZ_free(long _res); + // struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b); public static native long C2Tuple_OutPointScriptZ_new(long a, byte[] b); - // LDKC2Tuple_TxidCVec_TxOutZZ C2Tuple_TxidCVec_TxOutZZ_new(LDKThirtyTwoBytes a, LDKCVec_TxOutZ b); - public static native long C2Tuple_TxidCVec_TxOutZZ_new(byte[] a, long[] b); - // LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b); + // void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); + public static native void CVec_TransactionZ_free(byte[][] _res); + // void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res); + public static native void C2Tuple_u32TxOutZ_free(long _res); + // struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b); + public static native long C2Tuple_u32TxOutZ_new(int a, long b); + // void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res); + public static native void CVec_C2Tuple_u32TxOutZZ_free(long[] _res); + // void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res); + public static native void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(long _res); + // struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b); + public static native long C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(byte[] a, long[] b); + // void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res); + public static native void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(long[] _res); + // void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res); + public static native void C2Tuple_BlockHashChannelMonitorZ_free(long _res); + // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b); + public static native long C2Tuple_BlockHashChannelMonitorZ_new(byte[] a, long b); + // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o); + public static native long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(long o); + // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(long e); + // void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res); + public static native void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(long _res); + // void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res); + public static native void C2Tuple_u64u64Z_free(long _res); + // struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b); public static native long C2Tuple_u64u64Z_new(long a, long b); - // LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(LDKSignature a, LDKCVec_SignatureZ b); + // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o); + public static native long CResult_SpendableOutputDescriptorDecodeErrorZ_ok(long o); + // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_SpendableOutputDescriptorDecodeErrorZ_err(long e); + // void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res); + public static native void CResult_SpendableOutputDescriptorDecodeErrorZ_free(long _res); + // void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res); + public static native void CVec_SignatureZ_free(byte[][] _res); + // void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res); + public static native void C2Tuple_SignatureCVec_SignatureZZ_free(long _res); + // struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b); public static native long C2Tuple_SignatureCVec_SignatureZZ_new(byte[] a, byte[][] b); - // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void); + // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o); + public static native long CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(long o); + // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void); public static native long CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); - // LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void); + // void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res); + public static native void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(long _res); + // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o); + public static native long CResult_SignatureNoneZ_ok(byte[] o); + // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void); public static native long CResult_SignatureNoneZ_err(); - // LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void); + // void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res); + public static native void CResult_SignatureNoneZ_free(long _res); + // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o); + public static native long CResult_CVec_SignatureZNoneZ_ok(byte[][] o); + // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void); public static native long CResult_CVec_SignatureZNoneZ_err(); - // LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); + // void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res); + public static native void CResult_CVec_SignatureZNoneZ_free(long _res); + // struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_ok(struct LDKChannelKeys o); + public static native long CResult_ChanKeySignerDecodeErrorZ_ok(long o); + // struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ChanKeySignerDecodeErrorZ_err(long e); + // void CResult_ChanKeySignerDecodeErrorZ_free(struct LDKCResult_ChanKeySignerDecodeErrorZ _res); + public static native void CResult_ChanKeySignerDecodeErrorZ_free(long _res); + // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_ok(struct LDKInMemoryChannelKeys o); + public static native long CResult_InMemoryChannelKeysDecodeErrorZ_ok(long o); + // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_InMemoryChannelKeysDecodeErrorZ_err(long e); + // void CResult_InMemoryChannelKeysDecodeErrorZ_free(struct LDKCResult_InMemoryChannelKeysDecodeErrorZ _res); + public static native void CResult_InMemoryChannelKeysDecodeErrorZ_free(long _res); + // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o); + public static native long CResult_TxOutAccessErrorZ_ok(long o); + // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e); + public static native long CResult_TxOutAccessErrorZ_err(LDKAccessError e); + // void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); + public static native void CResult_TxOutAccessErrorZ_free(long _res); + // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); public static native long CResult_NoneAPIErrorZ_ok(); - // LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); + // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); + public static native long CResult_NoneAPIErrorZ_err(long e); + // void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); + public static native void CResult_NoneAPIErrorZ_free(long _res); + // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); + public static native void CVec_ChannelDetailsZ_free(long[] _res); + // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); public static native long CResult_NonePaymentSendFailureZ_ok(); - // LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(LDKChannelAnnouncement a, LDKChannelUpdate b, LDKChannelUpdate c); + // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e); + public static native long CResult_NonePaymentSendFailureZ_err(long e); + // void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res); + public static native void CResult_NonePaymentSendFailureZ_free(long _res); + // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); + public static native void CVec_NetAddressZ_free(long[] _res); + // void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); + public static native void CVec_ChannelMonitorZ_free(long[] _res); + // void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res); + public static native void C2Tuple_BlockHashChannelManagerZ_free(long _res); + // struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); + public static native long C2Tuple_BlockHashChannelManagerZ_new(byte[] a, long b); + // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o); + public static native long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(long o); + // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(long e); + // void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res); + public static native void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(long _res); + // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o); + public static native long CResult_NetAddressu8Z_ok(long o); + // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e); + public static native long CResult_NetAddressu8Z_err(byte e); + // void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res); + public static native void CResult_NetAddressu8Z_free(long _res); + // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o); + public static native long CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(long o); + // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_CResult_NetAddressu8ZDecodeErrorZ_err(long e); + // void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res); + public static native void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(long _res); + // void CVec_u64Z_free(struct LDKCVec_u64Z _res); + public static native void CVec_u64Z_free(long[] _res); + // void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res); + public static native void CVec_UpdateAddHTLCZ_free(long[] _res); + // void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res); + public static native void CVec_UpdateFulfillHTLCZ_free(long[] _res); + // void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res); + public static native void CVec_UpdateFailHTLCZ_free(long[] _res); + // void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res); + public static native void CVec_UpdateFailMalformedHTLCZ_free(long[] _res); + // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o); + public static native long CResult_boolLightningErrorZ_ok(boolean o); + // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e); + public static native long CResult_boolLightningErrorZ_err(long e); + // void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); + public static native void CResult_boolLightningErrorZ_free(long _res); + // void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res); + public static native void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(long _res); + // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(long a, long b, long c); - // LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void); + // void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res); + public static native void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(long[] _res); + // void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res); + public static native void CVec_NodeAnnouncementZ_free(long[] _res); + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); + public static native long CResult_NoneLightningErrorZ_ok(); + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); + public static native long CResult_NoneLightningErrorZ_err(long e); + // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); + public static native void CResult_NoneLightningErrorZ_free(long _res); + // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o); + public static native long CResult_ChannelReestablishDecodeErrorZ_ok(long o); + // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ChannelReestablishDecodeErrorZ_err(long e); + // void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res); + public static native void CResult_ChannelReestablishDecodeErrorZ_free(long _res); + // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o); + public static native long CResult_InitDecodeErrorZ_ok(long o); + // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_InitDecodeErrorZ_err(long e); + // void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res); + public static native void CResult_InitDecodeErrorZ_free(long _res); + // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o); + public static native long CResult_PingDecodeErrorZ_ok(long o); + // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_PingDecodeErrorZ_err(long e); + // void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res); + public static native void CResult_PingDecodeErrorZ_free(long _res); + // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o); + public static native long CResult_PongDecodeErrorZ_ok(long o); + // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_PongDecodeErrorZ_err(long e); + // void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res); + public static native void CResult_PongDecodeErrorZ_free(long _res); + // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o); + public static native long CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(long o); + // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(long e); + // void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res); + public static native void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(long _res); + // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o); + public static native long CResult_UnsignedChannelUpdateDecodeErrorZ_ok(long o); + // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_UnsignedChannelUpdateDecodeErrorZ_err(long e); + // void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res); + public static native void CResult_UnsignedChannelUpdateDecodeErrorZ_free(long _res); + // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o); + public static native long CResult_ErrorMessageDecodeErrorZ_ok(long o); + // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ErrorMessageDecodeErrorZ_err(long e); + // void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res); + public static native void CResult_ErrorMessageDecodeErrorZ_free(long _res); + // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o); + public static native long CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(long o); + // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(long e); + // void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res); + public static native void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(long _res); + // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o); + public static native long CResult_QueryShortChannelIdsDecodeErrorZ_ok(long o); + // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_QueryShortChannelIdsDecodeErrorZ_err(long e); + // void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res); + public static native void CResult_QueryShortChannelIdsDecodeErrorZ_free(long _res); + // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o); + public static native long CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(long o); + // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(long e); + // void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res); + public static native void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(long _res); + // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o); + public static native long CResult_QueryChannelRangeDecodeErrorZ_ok(long o); + // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_QueryChannelRangeDecodeErrorZ_err(long e); + // void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res); + public static native void CResult_QueryChannelRangeDecodeErrorZ_free(long _res); + // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o); + public static native long CResult_ReplyChannelRangeDecodeErrorZ_ok(long o); + // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ReplyChannelRangeDecodeErrorZ_err(long e); + // void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res); + public static native void CResult_ReplyChannelRangeDecodeErrorZ_free(long _res); + // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o); + public static native long CResult_GossipTimestampFilterDecodeErrorZ_ok(long o); + // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_GossipTimestampFilterDecodeErrorZ_err(long e); + // void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res); + public static native void CResult_GossipTimestampFilterDecodeErrorZ_free(long _res); + // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); + public static native void CVec_PublicKeyZ_free(byte[][] _res); + // void CVec_u8Z_free(struct LDKCVec_u8Z _res); + public static native void CVec_u8Z_free(byte[] _res); + // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o); + public static native long CResult_CVec_u8ZPeerHandleErrorZ_ok(byte[] o); + // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e); + public static native long CResult_CVec_u8ZPeerHandleErrorZ_err(long e); + // void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res); + public static native void CResult_CVec_u8ZPeerHandleErrorZ_free(long _res); + // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void); public static native long CResult_NonePeerHandleErrorZ_ok(); - // LDKC2Tuple_HTLCOutputInCommitmentSignatureZ C2Tuple_HTLCOutputInCommitmentSignatureZ_new(LDKHTLCOutputInCommitment a, LDKSignature b); - public static native long C2Tuple_HTLCOutputInCommitmentSignatureZ_new(long a, byte[] b); - // void Event_free(LDKEvent this_ptr); + // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e); + public static native long CResult_NonePeerHandleErrorZ_err(long e); + // void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res); + public static native void CResult_NonePeerHandleErrorZ_free(long _res); + // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o); + public static native long CResult_boolPeerHandleErrorZ_ok(boolean o); + // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e); + public static native long CResult_boolPeerHandleErrorZ_err(long e); + // void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res); + public static native void CResult_boolPeerHandleErrorZ_free(long _res); + // struct LDKCResult_SecretKeySecpErrorZ CResult_SecretKeySecpErrorZ_ok(struct LDKSecretKey o); + public static native long CResult_SecretKeySecpErrorZ_ok(byte[] o); + // struct LDKCResult_SecretKeySecpErrorZ CResult_SecretKeySecpErrorZ_err(enum LDKSecp256k1Error e); + public static native long CResult_SecretKeySecpErrorZ_err(LDKSecp256k1Error e); + // void CResult_SecretKeySecpErrorZ_free(struct LDKCResult_SecretKeySecpErrorZ _res); + public static native void CResult_SecretKeySecpErrorZ_free(long _res); + // struct LDKCResult_PublicKeySecpErrorZ CResult_PublicKeySecpErrorZ_ok(struct LDKPublicKey o); + public static native long CResult_PublicKeySecpErrorZ_ok(byte[] o); + // struct LDKCResult_PublicKeySecpErrorZ CResult_PublicKeySecpErrorZ_err(enum LDKSecp256k1Error e); + public static native long CResult_PublicKeySecpErrorZ_err(LDKSecp256k1Error e); + // void CResult_PublicKeySecpErrorZ_free(struct LDKCResult_PublicKeySecpErrorZ _res); + public static native void CResult_PublicKeySecpErrorZ_free(long _res); + // struct LDKCResult_TxCreationKeysSecpErrorZ CResult_TxCreationKeysSecpErrorZ_ok(struct LDKTxCreationKeys o); + public static native long CResult_TxCreationKeysSecpErrorZ_ok(long o); + // struct LDKCResult_TxCreationKeysSecpErrorZ CResult_TxCreationKeysSecpErrorZ_err(enum LDKSecp256k1Error e); + public static native long CResult_TxCreationKeysSecpErrorZ_err(LDKSecp256k1Error e); + // void CResult_TxCreationKeysSecpErrorZ_free(struct LDKCResult_TxCreationKeysSecpErrorZ _res); + public static native void CResult_TxCreationKeysSecpErrorZ_free(long _res); + // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o); + public static native long CResult_TrustedCommitmentTransactionNoneZ_ok(long o); + // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void); + public static native long CResult_TrustedCommitmentTransactionNoneZ_err(); + // void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res); + public static native void CResult_TrustedCommitmentTransactionNoneZ_free(long _res); + // void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res); + public static native void CVec_RouteHopZ_free(long[] _res); + // void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res); + public static native void CVec_CVec_RouteHopZZ_free(long[][] _res); + // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o); + public static native long CResult_RouteDecodeErrorZ_ok(long o); + // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_RouteDecodeErrorZ_err(long e); + // void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res); + public static native void CResult_RouteDecodeErrorZ_free(long _res); + // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); + public static native void CVec_RouteHintZ_free(long[] _res); + // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); + public static native long CResult_RouteLightningErrorZ_ok(long o); + // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e); + public static native long CResult_RouteLightningErrorZ_err(long e); + // void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); + public static native void CResult_RouteLightningErrorZ_free(long _res); + // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o); + public static native long CResult_RoutingFeesDecodeErrorZ_ok(long o); + // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_RoutingFeesDecodeErrorZ_err(long e); + // void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); + public static native void CResult_RoutingFeesDecodeErrorZ_free(long _res); + // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o); + public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_ok(long o); + // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_err(long e); + // void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); + public static native void CResult_NodeAnnouncementInfoDecodeErrorZ_free(long _res); + // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); + public static native long CResult_NodeInfoDecodeErrorZ_ok(long o); + // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_NodeInfoDecodeErrorZ_err(long e); + // void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); + public static native void CResult_NodeInfoDecodeErrorZ_free(long _res); + // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o); + public static native long CResult_NetworkGraphDecodeErrorZ_ok(long o); + // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_NetworkGraphDecodeErrorZ_err(long e); + // void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); + public static native void CResult_NetworkGraphDecodeErrorZ_free(long _res); + // void Event_free(struct LDKEvent this_ptr); public static native void Event_free(long this_ptr); - // LDKEvent Event_clone(const LDKEvent *orig); + // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); public static native long Event_clone(long orig); - // void MessageSendEvent_free(LDKMessageSendEvent this_ptr); + // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); + public static native byte[] Event_write(long obj); + // void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr); public static native void MessageSendEvent_free(long this_ptr); - // LDKMessageSendEvent MessageSendEvent_clone(const LDKMessageSendEvent *orig); + // struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig); public static native long MessageSendEvent_clone(long orig); - // void MessageSendEventsProvider_free(LDKMessageSendEventsProvider this_ptr); + // void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr); public static native void MessageSendEventsProvider_free(long this_ptr); - // void EventsProvider_free(LDKEventsProvider this_ptr); + // void EventsProvider_free(struct LDKEventsProvider this_ptr); public static native void EventsProvider_free(long this_ptr); - // void APIError_free(LDKAPIError this_ptr); + // void APIError_free(struct LDKAPIError this_ptr); public static native void APIError_free(long this_ptr); - // LDKAPIError APIError_clone(const LDKAPIError *orig); + // struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig); public static native long APIError_clone(long orig); - // LDKLevel Level_clone(const LDKLevel *orig); + // enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig); public static native LDKLevel Level_clone(long orig); - // MUST_USE_RES LDKLevel Level_max(void); + // MUST_USE_RES enum LDKLevel Level_max(void); public static native LDKLevel Level_max(); - // void Logger_free(LDKLogger this_ptr); + // void Logger_free(struct LDKLogger this_ptr); public static native void Logger_free(long this_ptr); - // void ChannelHandshakeConfig_free(LDKChannelHandshakeConfig this_ptr); + // void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_ptr); public static native void ChannelHandshakeConfig_free(long this_ptr); - // LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const LDKChannelHandshakeConfig *orig); + // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); public static native long ChannelHandshakeConfig_clone(long orig); - // uint32_t ChannelHandshakeConfig_get_minimum_depth(const LDKChannelHandshakeConfig *this_ptr); + // uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); public static native int ChannelHandshakeConfig_get_minimum_depth(long this_ptr); - // void ChannelHandshakeConfig_set_minimum_depth(LDKChannelHandshakeConfig *this_ptr, uint32_t val); + // void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val); public static native void ChannelHandshakeConfig_set_minimum_depth(long this_ptr, int val); - // uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const LDKChannelHandshakeConfig *this_ptr); + // uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); public static native short ChannelHandshakeConfig_get_our_to_self_delay(long this_ptr); - // void ChannelHandshakeConfig_set_our_to_self_delay(LDKChannelHandshakeConfig *this_ptr, uint16_t val); + // void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val); public static native void ChannelHandshakeConfig_set_our_to_self_delay(long this_ptr, short val); - // uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const LDKChannelHandshakeConfig *this_ptr); + // uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); public static native long ChannelHandshakeConfig_get_our_htlc_minimum_msat(long this_ptr); - // void ChannelHandshakeConfig_set_our_htlc_minimum_msat(LDKChannelHandshakeConfig *this_ptr, uint64_t val); + // void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelHandshakeConfig_set_our_htlc_minimum_msat(long this_ptr, long val); - // MUST_USE_RES LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg); + // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg); public static native long ChannelHandshakeConfig_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg); - // MUST_USE_RES LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void); + // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void); public static native long ChannelHandshakeConfig_default(); - // void ChannelHandshakeLimits_free(LDKChannelHandshakeLimits this_ptr); + // void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_ptr); public static native void ChannelHandshakeLimits_free(long this_ptr); - // LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const LDKChannelHandshakeLimits *orig); + // struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig); public static native long ChannelHandshakeLimits_clone(long orig); - // uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const LDKChannelHandshakeLimits *this_ptr); + // uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native long ChannelHandshakeLimits_get_min_funding_satoshis(long this_ptr); - // void ChannelHandshakeLimits_set_min_funding_satoshis(LDKChannelHandshakeLimits *this_ptr, uint64_t val); + // void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelHandshakeLimits_set_min_funding_satoshis(long this_ptr, long val); - // uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const LDKChannelHandshakeLimits *this_ptr); + // uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native long ChannelHandshakeLimits_get_max_htlc_minimum_msat(long this_ptr); - // void ChannelHandshakeLimits_set_max_htlc_minimum_msat(LDKChannelHandshakeLimits *this_ptr, uint64_t val); + // void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelHandshakeLimits_set_max_htlc_minimum_msat(long this_ptr, long val); - // uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const LDKChannelHandshakeLimits *this_ptr); + // uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native long ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(long this_ptr); - // void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(LDKChannelHandshakeLimits *this_ptr, uint64_t val); + // void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(long this_ptr, long val); - // uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const LDKChannelHandshakeLimits *this_ptr); + // uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native long ChannelHandshakeLimits_get_max_channel_reserve_satoshis(long this_ptr); - // void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(LDKChannelHandshakeLimits *this_ptr, uint64_t val); + // void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(long this_ptr, long val); - // uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const LDKChannelHandshakeLimits *this_ptr); + // uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native short ChannelHandshakeLimits_get_min_max_accepted_htlcs(long this_ptr); - // void ChannelHandshakeLimits_set_min_max_accepted_htlcs(LDKChannelHandshakeLimits *this_ptr, uint16_t val); + // void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val); public static native void ChannelHandshakeLimits_set_min_max_accepted_htlcs(long this_ptr, short val); - // uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const LDKChannelHandshakeLimits *this_ptr); + // uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native long ChannelHandshakeLimits_get_min_dust_limit_satoshis(long this_ptr); - // void ChannelHandshakeLimits_set_min_dust_limit_satoshis(LDKChannelHandshakeLimits *this_ptr, uint64_t val); + // void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelHandshakeLimits_set_min_dust_limit_satoshis(long this_ptr, long val); - // uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const LDKChannelHandshakeLimits *this_ptr); + // uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native long ChannelHandshakeLimits_get_max_dust_limit_satoshis(long this_ptr); - // void ChannelHandshakeLimits_set_max_dust_limit_satoshis(LDKChannelHandshakeLimits *this_ptr, uint64_t val); + // void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelHandshakeLimits_set_max_dust_limit_satoshis(long this_ptr, long val); - // uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const LDKChannelHandshakeLimits *this_ptr); + // uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native int ChannelHandshakeLimits_get_max_minimum_depth(long this_ptr); - // void ChannelHandshakeLimits_set_max_minimum_depth(LDKChannelHandshakeLimits *this_ptr, uint32_t val); + // void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val); public static native void ChannelHandshakeLimits_set_max_minimum_depth(long this_ptr, int val); - // bool ChannelHandshakeLimits_get_force_announced_channel_preference(const LDKChannelHandshakeLimits *this_ptr); + // bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native boolean ChannelHandshakeLimits_get_force_announced_channel_preference(long this_ptr); - // void ChannelHandshakeLimits_set_force_announced_channel_preference(LDKChannelHandshakeLimits *this_ptr, bool val); + // void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val); public static native void ChannelHandshakeLimits_set_force_announced_channel_preference(long this_ptr, boolean val); - // uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const LDKChannelHandshakeLimits *this_ptr); + // uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native short ChannelHandshakeLimits_get_their_to_self_delay(long this_ptr); - // void ChannelHandshakeLimits_set_their_to_self_delay(LDKChannelHandshakeLimits *this_ptr, uint16_t val); + // void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val); public static native void ChannelHandshakeLimits_set_their_to_self_delay(long this_ptr, short val); - // MUST_USE_RES LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint64_t min_dust_limit_satoshis_arg, uint64_t max_dust_limit_satoshis_arg, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg); + // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint64_t min_dust_limit_satoshis_arg, uint64_t max_dust_limit_satoshis_arg, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg); public static native long ChannelHandshakeLimits_new(long min_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, long min_dust_limit_satoshis_arg, long max_dust_limit_satoshis_arg, int max_minimum_depth_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg); - // MUST_USE_RES LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void); + // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void); public static native long ChannelHandshakeLimits_default(); - // void ChannelConfig_free(LDKChannelConfig this_ptr); + // void ChannelConfig_free(struct LDKChannelConfig this_ptr); public static native void ChannelConfig_free(long this_ptr); - // LDKChannelConfig ChannelConfig_clone(const LDKChannelConfig *orig); + // struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig); public static native long ChannelConfig_clone(long orig); - // uint32_t ChannelConfig_get_fee_proportional_millionths(const LDKChannelConfig *this_ptr); + // uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr); public static native int ChannelConfig_get_fee_proportional_millionths(long this_ptr); - // void ChannelConfig_set_fee_proportional_millionths(LDKChannelConfig *this_ptr, uint32_t val); + // void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val); public static native void ChannelConfig_set_fee_proportional_millionths(long this_ptr, int val); - // bool ChannelConfig_get_announced_channel(const LDKChannelConfig *this_ptr); + // bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr); public static native boolean ChannelConfig_get_announced_channel(long this_ptr); - // void ChannelConfig_set_announced_channel(LDKChannelConfig *this_ptr, bool val); + // void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val); public static native void ChannelConfig_set_announced_channel(long this_ptr, boolean val); - // bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const LDKChannelConfig *this_ptr); + // bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr); public static native boolean ChannelConfig_get_commit_upfront_shutdown_pubkey(long this_ptr); - // void ChannelConfig_set_commit_upfront_shutdown_pubkey(LDKChannelConfig *this_ptr, bool val); + // void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val); public static native void ChannelConfig_set_commit_upfront_shutdown_pubkey(long this_ptr, boolean val); - // MUST_USE_RES LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg); + // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg); public static native long ChannelConfig_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg); - // MUST_USE_RES LDKChannelConfig ChannelConfig_default(void); + // MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void); public static native long ChannelConfig_default(); - // LDKCVec_u8Z ChannelConfig_write(const LDKChannelConfig *obj); + // struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj); public static native byte[] ChannelConfig_write(long obj); - // LDKChannelConfig ChannelConfig_read(LDKu8slice ser); + // struct LDKChannelConfig ChannelConfig_read(struct LDKu8slice ser); public static native long ChannelConfig_read(byte[] ser); - // void UserConfig_free(LDKUserConfig this_ptr); + // void UserConfig_free(struct LDKUserConfig this_ptr); public static native void UserConfig_free(long this_ptr); - // LDKUserConfig UserConfig_clone(const LDKUserConfig *orig); + // struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); public static native long UserConfig_clone(long orig); - // LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const LDKUserConfig *this_ptr); + // struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr); public static native long UserConfig_get_own_channel_config(long this_ptr); - // void UserConfig_set_own_channel_config(LDKUserConfig *this_ptr, LDKChannelHandshakeConfig val); + // void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val); public static native void UserConfig_set_own_channel_config(long this_ptr, long val); - // LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const LDKUserConfig *this_ptr); + // struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr); public static native long UserConfig_get_peer_channel_config_limits(long this_ptr); - // void UserConfig_set_peer_channel_config_limits(LDKUserConfig *this_ptr, LDKChannelHandshakeLimits val); + // void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val); public static native void UserConfig_set_peer_channel_config_limits(long this_ptr, long val); - // LDKChannelConfig UserConfig_get_channel_options(const LDKUserConfig *this_ptr); + // struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr); public static native long UserConfig_get_channel_options(long this_ptr); - // void UserConfig_set_channel_options(LDKUserConfig *this_ptr, LDKChannelConfig val); + // void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val); public static native void UserConfig_set_channel_options(long this_ptr, long val); - // MUST_USE_RES LDKUserConfig UserConfig_new(LDKChannelHandshakeConfig own_channel_config_arg, LDKChannelHandshakeLimits peer_channel_config_limits_arg, LDKChannelConfig channel_options_arg); + // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg); public static native long UserConfig_new(long own_channel_config_arg, long peer_channel_config_limits_arg, long channel_options_arg); - // MUST_USE_RES LDKUserConfig UserConfig_default(void); + // MUST_USE_RES struct LDKUserConfig UserConfig_default(void); public static native long UserConfig_default(); - // LDKAccessError AccessError_clone(const LDKAccessError *orig); + // enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig); public static native LDKAccessError AccessError_clone(long orig); - // void Access_free(LDKAccess this_ptr); + // void Access_free(struct LDKAccess this_ptr); public static native void Access_free(long this_ptr); - // void Watch_free(LDKWatch this_ptr); + // void Watch_free(struct LDKWatch this_ptr); public static native void Watch_free(long this_ptr); - // void Filter_free(LDKFilter this_ptr); + // void Filter_free(struct LDKFilter this_ptr); public static native void Filter_free(long this_ptr); - // void BroadcasterInterface_free(LDKBroadcasterInterface this_ptr); + // void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr); public static native void BroadcasterInterface_free(long this_ptr); - // LDKConfirmationTarget ConfirmationTarget_clone(const LDKConfirmationTarget *orig); + // enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig); public static native LDKConfirmationTarget ConfirmationTarget_clone(long orig); - // void FeeEstimator_free(LDKFeeEstimator this_ptr); + // void FeeEstimator_free(struct LDKFeeEstimator this_ptr); public static native void FeeEstimator_free(long this_ptr); - // void ChainMonitor_free(LDKChainMonitor this_ptr); + // void ChainMonitor_free(struct LDKChainMonitor this_ptr); public static native void ChainMonitor_free(long this_ptr); - // void ChainMonitor_block_connected(const LDKChainMonitor *this_arg, const uint8_t (*header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height); + // void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height); public static native void ChainMonitor_block_connected(long this_arg, byte[] header, long[] txdata, int height); - // void ChainMonitor_block_disconnected(const LDKChainMonitor *this_arg, const uint8_t (*header)[80], uint32_t disconnected_height); + // void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height); public static native void ChainMonitor_block_disconnected(long this_arg, byte[] header, int disconnected_height); - // MUST_USE_RES LDKChainMonitor ChainMonitor_new(LDKFilter *chain_source, LDKBroadcasterInterface broadcaster, LDKLogger logger, LDKFeeEstimator feeest); - public static native long ChainMonitor_new(long chain_source, long broadcaster, long logger, long feeest); - // LDKWatch ChainMonitor_as_Watch(const LDKChainMonitor *this_arg); + // MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister); + public static native long ChainMonitor_new(long chain_source, long broadcaster, long logger, long feeest, long persister); + // struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg); public static native long ChainMonitor_as_Watch(long this_arg); - // LDKEventsProvider ChainMonitor_as_EventsProvider(const LDKChainMonitor *this_arg); + // struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg); public static native long ChainMonitor_as_EventsProvider(long this_arg); - // void ChannelMonitorUpdate_free(LDKChannelMonitorUpdate this_ptr); + // void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_ptr); public static native void ChannelMonitorUpdate_free(long this_ptr); - // LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const LDKChannelMonitorUpdate *orig); + // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); public static native long ChannelMonitorUpdate_clone(long orig); - // uint64_t ChannelMonitorUpdate_get_update_id(const LDKChannelMonitorUpdate *this_ptr); + // uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr); public static native long ChannelMonitorUpdate_get_update_id(long this_ptr); - // void ChannelMonitorUpdate_set_update_id(LDKChannelMonitorUpdate *this_ptr, uint64_t val); + // void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelMonitorUpdate_set_update_id(long this_ptr, long val); - // LDKCVec_u8Z ChannelMonitorUpdate_write(const LDKChannelMonitorUpdate *this_ptr); - public static native byte[] ChannelMonitorUpdate_write(long this_ptr); - // LDKChannelMonitorUpdate ChannelMonitorUpdate_read(LDKu8slice ser); + // struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj); + public static native byte[] ChannelMonitorUpdate_write(long obj); + // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser); public static native long ChannelMonitorUpdate_read(byte[] ser); - // LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const LDKChannelMonitorUpdateErr *orig); + // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig); public static native LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(long orig); - // void MonitorUpdateError_free(LDKMonitorUpdateError this_ptr); + // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_ptr); public static native void MonitorUpdateError_free(long this_ptr); - // void MonitorEvent_free(LDKMonitorEvent this_ptr); + // void MonitorEvent_free(struct LDKMonitorEvent this_ptr); public static native void MonitorEvent_free(long this_ptr); - // LDKMonitorEvent MonitorEvent_clone(const LDKMonitorEvent *orig); + // struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig); public static native long MonitorEvent_clone(long orig); - // void HTLCUpdate_free(LDKHTLCUpdate this_ptr); + // void HTLCUpdate_free(struct LDKHTLCUpdate this_ptr); public static native void HTLCUpdate_free(long this_ptr); - // LDKHTLCUpdate HTLCUpdate_clone(const LDKHTLCUpdate *orig); + // struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig); public static native long HTLCUpdate_clone(long orig); - // LDKCVec_u8Z HTLCUpdate_write(const LDKHTLCUpdate *obj); + // struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj); public static native byte[] HTLCUpdate_write(long obj); - // LDKHTLCUpdate HTLCUpdate_read(LDKu8slice ser); + // struct LDKHTLCUpdate HTLCUpdate_read(struct LDKu8slice ser); public static native long HTLCUpdate_read(byte[] ser); - // void ChannelMonitor_free(LDKChannelMonitor this_ptr); + // void ChannelMonitor_free(struct LDKChannelMonitor this_ptr); public static native void ChannelMonitor_free(long this_ptr); - // LDKCVec_u8Z ChannelMonitor_write(const LDKChannelMonitor *this_ptr); - public static native byte[] ChannelMonitor_write(long this_ptr); - // MUST_USE_RES LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(LDKChannelMonitor *this_arg, LDKChannelMonitorUpdate updates, const LDKBroadcasterInterface *broadcaster, const LDKLogger *logger); - public static native long ChannelMonitor_update_monitor(long this_arg, long updates, long broadcaster, long logger); - // MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const LDKChannelMonitor *this_arg); + // struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj); + public static native byte[] ChannelMonitor_write(long obj); + // MUST_USE_RES struct LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger); + public static native long ChannelMonitor_update_monitor(long this_arg, long updates, long broadcaster, long fee_estimator, long logger); + // MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg); public static native long ChannelMonitor_get_latest_update_id(long this_arg); - // MUST_USE_RES LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const LDKChannelMonitor *this_arg); + // MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg); public static native long ChannelMonitor_get_funding_txo(long this_arg); - // MUST_USE_RES LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(LDKChannelMonitor *this_arg); + // MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(struct LDKChannelMonitor *NONNULL_PTR this_arg); public static native long[] ChannelMonitor_get_and_clear_pending_monitor_events(long this_arg); - // MUST_USE_RES LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(LDKChannelMonitor *this_arg); + // MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(struct LDKChannelMonitor *NONNULL_PTR this_arg); public static native long[] ChannelMonitor_get_and_clear_pending_events(long this_arg); - // MUST_USE_RES LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(LDKChannelMonitor *this_arg, const LDKLogger *logger); + // MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger); public static native byte[][] ChannelMonitor_get_latest_holder_commitment_txn(long this_arg, long logger); - // MUST_USE_RES LDKCVec_C2Tuple_TxidCVec_TxOutZZZ ChannelMonitor_block_connected(LDKChannelMonitor *this_arg, const uint8_t (*header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, LDKBroadcasterInterface broadcaster, LDKFeeEstimator fee_estimator, LDKLogger logger); + // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_block_connected(struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); public static native long[] ChannelMonitor_block_connected(long this_arg, byte[] header, long[] txdata, int height, long broadcaster, long fee_estimator, long logger); - // void ChannelMonitor_block_disconnected(LDKChannelMonitor *this_arg, const uint8_t (*header)[80], uint32_t height, LDKBroadcasterInterface broadcaster, LDKFeeEstimator fee_estimator, LDKLogger logger); + // void ChannelMonitor_block_disconnected(struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); public static native void ChannelMonitor_block_disconnected(long this_arg, byte[] header, int height, long broadcaster, long fee_estimator, long logger); - // void OutPoint_free(LDKOutPoint this_ptr); + // void Persist_free(struct LDKPersist this_ptr); + public static native void Persist_free(long this_ptr); + // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg); + public static native long C2Tuple_BlockHashChannelMonitorZ_read(byte[] ser, long arg); + // void OutPoint_free(struct LDKOutPoint this_ptr); public static native void OutPoint_free(long this_ptr); - // LDKOutPoint OutPoint_clone(const LDKOutPoint *orig); + // struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig); public static native long OutPoint_clone(long orig); - // const uint8_t (*OutPoint_get_txid(const LDKOutPoint *this_ptr))[32]; + // const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32]; public static native byte[] OutPoint_get_txid(long this_ptr); - // void OutPoint_set_txid(LDKOutPoint *this_ptr, LDKThirtyTwoBytes val); + // void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void OutPoint_set_txid(long this_ptr, byte[] val); - // uint16_t OutPoint_get_index(const LDKOutPoint *this_ptr); + // uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr); public static native short OutPoint_get_index(long this_ptr); - // void OutPoint_set_index(LDKOutPoint *this_ptr, uint16_t val); + // void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val); public static native void OutPoint_set_index(long this_ptr, short val); - // MUST_USE_RES LDKOutPoint OutPoint_new(LDKThirtyTwoBytes txid_arg, uint16_t index_arg); + // MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg); public static native long OutPoint_new(byte[] txid_arg, short index_arg); - // MUST_USE_RES LDKThirtyTwoBytes OutPoint_to_channel_id(const LDKOutPoint *this_arg); + // MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg); public static native byte[] OutPoint_to_channel_id(long this_arg); - // LDKCVec_u8Z OutPoint_write(const LDKOutPoint *obj); + // struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj); public static native byte[] OutPoint_write(long obj); - // LDKOutPoint OutPoint_read(LDKu8slice ser); + // struct LDKOutPoint OutPoint_read(struct LDKu8slice ser); public static native long OutPoint_read(byte[] ser); - // void SpendableOutputDescriptor_free(LDKSpendableOutputDescriptor this_ptr); + // void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr); public static native void SpendableOutputDescriptor_free(long this_ptr); - // LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const LDKSpendableOutputDescriptor *orig); + // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig); public static native long SpendableOutputDescriptor_clone(long orig); - // LDKChannelKeys ChannelKeys_clone(const LDKChannelKeys *orig); + // struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj); + public static native byte[] SpendableOutputDescriptor_write(long obj); + // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser); + public static native long SpendableOutputDescriptor_read(byte[] ser); + // struct LDKChannelKeys ChannelKeys_clone(const struct LDKChannelKeys *NONNULL_PTR orig); public static native long ChannelKeys_clone(long orig); - // void ChannelKeys_free(LDKChannelKeys this_ptr); + // void ChannelKeys_free(struct LDKChannelKeys this_ptr); public static native void ChannelKeys_free(long this_ptr); - // void KeysInterface_free(LDKKeysInterface this_ptr); + // void KeysInterface_free(struct LDKKeysInterface this_ptr); public static native void KeysInterface_free(long this_ptr); - // void InMemoryChannelKeys_free(LDKInMemoryChannelKeys this_ptr); + // void InMemoryChannelKeys_free(struct LDKInMemoryChannelKeys this_ptr); public static native void InMemoryChannelKeys_free(long this_ptr); - // LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const LDKInMemoryChannelKeys *orig); + // struct LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const struct LDKInMemoryChannelKeys *NONNULL_PTR orig); public static native long InMemoryChannelKeys_clone(long orig); - // const uint8_t (*InMemoryChannelKeys_get_funding_key(const LDKInMemoryChannelKeys *this_ptr))[32]; + // const uint8_t (*InMemoryChannelKeys_get_funding_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; public static native byte[] InMemoryChannelKeys_get_funding_key(long this_ptr); - // void InMemoryChannelKeys_set_funding_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); + // void InMemoryChannelKeys_set_funding_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val); public static native void InMemoryChannelKeys_set_funding_key(long this_ptr, byte[] val); - // const uint8_t (*InMemoryChannelKeys_get_revocation_base_key(const LDKInMemoryChannelKeys *this_ptr))[32]; + // const uint8_t (*InMemoryChannelKeys_get_revocation_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; public static native byte[] InMemoryChannelKeys_get_revocation_base_key(long this_ptr); - // void InMemoryChannelKeys_set_revocation_base_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); + // void InMemoryChannelKeys_set_revocation_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val); public static native void InMemoryChannelKeys_set_revocation_base_key(long this_ptr, byte[] val); - // const uint8_t (*InMemoryChannelKeys_get_payment_key(const LDKInMemoryChannelKeys *this_ptr))[32]; + // const uint8_t (*InMemoryChannelKeys_get_payment_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; public static native byte[] InMemoryChannelKeys_get_payment_key(long this_ptr); - // void InMemoryChannelKeys_set_payment_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); + // void InMemoryChannelKeys_set_payment_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val); public static native void InMemoryChannelKeys_set_payment_key(long this_ptr, byte[] val); - // const uint8_t (*InMemoryChannelKeys_get_delayed_payment_base_key(const LDKInMemoryChannelKeys *this_ptr))[32]; + // const uint8_t (*InMemoryChannelKeys_get_delayed_payment_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; public static native byte[] InMemoryChannelKeys_get_delayed_payment_base_key(long this_ptr); - // void InMemoryChannelKeys_set_delayed_payment_base_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); + // void InMemoryChannelKeys_set_delayed_payment_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val); public static native void InMemoryChannelKeys_set_delayed_payment_base_key(long this_ptr, byte[] val); - // const uint8_t (*InMemoryChannelKeys_get_htlc_base_key(const LDKInMemoryChannelKeys *this_ptr))[32]; + // const uint8_t (*InMemoryChannelKeys_get_htlc_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; public static native byte[] InMemoryChannelKeys_get_htlc_base_key(long this_ptr); - // void InMemoryChannelKeys_set_htlc_base_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); + // void InMemoryChannelKeys_set_htlc_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val); public static native void InMemoryChannelKeys_set_htlc_base_key(long this_ptr, byte[] val); - // const uint8_t (*InMemoryChannelKeys_get_commitment_seed(const LDKInMemoryChannelKeys *this_ptr))[32]; + // const uint8_t (*InMemoryChannelKeys_get_commitment_seed(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; public static native byte[] InMemoryChannelKeys_get_commitment_seed(long this_ptr); - // void InMemoryChannelKeys_set_commitment_seed(LDKInMemoryChannelKeys *this_ptr, LDKThirtyTwoBytes val); + // void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void InMemoryChannelKeys_set_commitment_seed(long this_ptr, byte[] val); - // MUST_USE_RES LDKInMemoryChannelKeys InMemoryChannelKeys_new(LDKSecretKey funding_key, LDKSecretKey revocation_base_key, LDKSecretKey payment_key, LDKSecretKey delayed_payment_base_key, LDKSecretKey htlc_base_key, LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, LDKC2Tuple_u64u64Z key_derivation_params); + // MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKC2Tuple_u64u64Z key_derivation_params); public static native long InMemoryChannelKeys_new(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, long key_derivation_params); - // MUST_USE_RES LDKChannelPublicKeys InMemoryChannelKeys_counterparty_pubkeys(const LDKInMemoryChannelKeys *this_arg); + // MUST_USE_RES struct LDKChannelPublicKeys InMemoryChannelKeys_counterparty_pubkeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); public static native long InMemoryChannelKeys_counterparty_pubkeys(long this_arg); - // MUST_USE_RES uint16_t InMemoryChannelKeys_counterparty_selected_contest_delay(const LDKInMemoryChannelKeys *this_arg); + // MUST_USE_RES uint16_t InMemoryChannelKeys_counterparty_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); public static native short InMemoryChannelKeys_counterparty_selected_contest_delay(long this_arg); - // MUST_USE_RES uint16_t InMemoryChannelKeys_holder_selected_contest_delay(const LDKInMemoryChannelKeys *this_arg); + // MUST_USE_RES uint16_t InMemoryChannelKeys_holder_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); public static native short InMemoryChannelKeys_holder_selected_contest_delay(long this_arg); - // LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const LDKInMemoryChannelKeys *this_arg); + // MUST_USE_RES bool InMemoryChannelKeys_is_outbound(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); + public static native boolean InMemoryChannelKeys_is_outbound(long this_arg); + // MUST_USE_RES struct LDKOutPoint InMemoryChannelKeys_funding_outpoint(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); + public static native long InMemoryChannelKeys_funding_outpoint(long this_arg); + // MUST_USE_RES struct LDKChannelTransactionParameters InMemoryChannelKeys_get_channel_parameters(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); + public static native long InMemoryChannelKeys_get_channel_parameters(long this_arg); + // struct LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); public static native long InMemoryChannelKeys_as_ChannelKeys(long this_arg); - // LDKCVec_u8Z InMemoryChannelKeys_write(const LDKInMemoryChannelKeys *this_ptr); - public static native byte[] InMemoryChannelKeys_write(long this_ptr); - // LDKInMemoryChannelKeys InMemoryChannelKeys_read(LDKu8slice ser); + // struct LDKCVec_u8Z InMemoryChannelKeys_write(const struct LDKInMemoryChannelKeys *NONNULL_PTR obj); + public static native byte[] InMemoryChannelKeys_write(long obj); + // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ InMemoryChannelKeys_read(struct LDKu8slice ser); public static native long InMemoryChannelKeys_read(byte[] ser); - // void KeysManager_free(LDKKeysManager this_ptr); + // void KeysManager_free(struct LDKKeysManager this_ptr); public static native void KeysManager_free(long this_ptr); - // MUST_USE_RES LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], LDKNetwork network, uint64_t starting_time_secs, uint32_t starting_time_nanos); + // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], enum LDKNetwork network, uint64_t starting_time_secs, uint32_t starting_time_nanos); public static native long KeysManager_new(byte[] seed, LDKNetwork network, long starting_time_secs, int starting_time_nanos); - // MUST_USE_RES LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const LDKKeysManager *this_arg, uint64_t channel_value_satoshis, uint64_t params_1, uint64_t params_2); + // MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, uint64_t params_1, uint64_t params_2); public static native long KeysManager_derive_channel_keys(long this_arg, long channel_value_satoshis, long params_1, long params_2); - // LDKKeysInterface KeysManager_as_KeysInterface(const LDKKeysManager *this_arg); + // struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg); public static native long KeysManager_as_KeysInterface(long this_arg); - // void ChannelManager_free(LDKChannelManager this_ptr); + // void ChannelManager_free(struct LDKChannelManager this_ptr); public static native void ChannelManager_free(long this_ptr); - // void ChannelDetails_free(LDKChannelDetails this_ptr); + // void ChannelDetails_free(struct LDKChannelDetails this_ptr); public static native void ChannelDetails_free(long this_ptr); - // LDKChannelDetails ChannelDetails_clone(const LDKChannelDetails *orig); + // struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); public static native long ChannelDetails_clone(long orig); - // const uint8_t (*ChannelDetails_get_channel_id(const LDKChannelDetails *this_ptr))[32]; + // const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32]; public static native byte[] ChannelDetails_get_channel_id(long this_ptr); - // void ChannelDetails_set_channel_id(LDKChannelDetails *this_ptr, LDKThirtyTwoBytes val); + // 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); - // LDKPublicKey ChannelDetails_get_remote_network_id(const LDKChannelDetails *this_ptr); + // 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(LDKChannelDetails *this_ptr, LDKPublicKey val); + // void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void ChannelDetails_set_remote_network_id(long this_ptr, byte[] val); - // LDKInitFeatures ChannelDetails_get_counterparty_features(const LDKChannelDetails *this_ptr); + // struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_counterparty_features(long this_ptr); - // void ChannelDetails_set_counterparty_features(LDKChannelDetails *this_ptr, LDKInitFeatures val); + // void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val); public static native void ChannelDetails_set_counterparty_features(long this_ptr, long val); - // uint64_t ChannelDetails_get_channel_value_satoshis(const LDKChannelDetails *this_ptr); + // uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_channel_value_satoshis(long this_ptr); - // void ChannelDetails_set_channel_value_satoshis(LDKChannelDetails *this_ptr, uint64_t val); + // void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelDetails_set_channel_value_satoshis(long this_ptr, long val); - // uint64_t ChannelDetails_get_user_id(const LDKChannelDetails *this_ptr); + // uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_user_id(long this_ptr); - // void ChannelDetails_set_user_id(LDKChannelDetails *this_ptr, uint64_t val); + // void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelDetails_set_user_id(long this_ptr, long val); - // uint64_t ChannelDetails_get_outbound_capacity_msat(const LDKChannelDetails *this_ptr); + // uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_outbound_capacity_msat(long this_ptr); - // void ChannelDetails_set_outbound_capacity_msat(LDKChannelDetails *this_ptr, uint64_t val); + // void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelDetails_set_outbound_capacity_msat(long this_ptr, long val); - // uint64_t ChannelDetails_get_inbound_capacity_msat(const LDKChannelDetails *this_ptr); + // uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_inbound_capacity_msat(long this_ptr); - // void ChannelDetails_set_inbound_capacity_msat(LDKChannelDetails *this_ptr, uint64_t val); + // void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelDetails_set_inbound_capacity_msat(long this_ptr, long val); - // bool ChannelDetails_get_is_live(const LDKChannelDetails *this_ptr); + // bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native boolean ChannelDetails_get_is_live(long this_ptr); - // void ChannelDetails_set_is_live(LDKChannelDetails *this_ptr, bool val); + // void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); public static native void ChannelDetails_set_is_live(long this_ptr, boolean val); - // void PaymentSendFailure_free(LDKPaymentSendFailure this_ptr); + // void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr); public static native void PaymentSendFailure_free(long this_ptr); - // MUST_USE_RES LDKChannelManager ChannelManager_new(LDKNetwork network, LDKFeeEstimator fee_est, LDKWatch chain_monitor, LDKBroadcasterInterface tx_broadcaster, LDKLogger logger, LDKKeysInterface keys_manager, LDKUserConfig config, uintptr_t current_blockchain_height); + // MUST_USE_RES struct LDKChannelManager ChannelManager_new(enum LDKNetwork network, struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, uintptr_t current_blockchain_height); public static native long ChannelManager_new(LDKNetwork network, long fee_est, long chain_monitor, long tx_broadcaster, long logger, long keys_manager, long config, long current_blockchain_height); - // MUST_USE_RES LDKCResult_NoneAPIErrorZ ChannelManager_create_channel(const LDKChannelManager *this_arg, LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_id, LDKUserConfig override_config); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_id, struct LDKUserConfig override_config); public static native long ChannelManager_create_channel(long this_arg, byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_id, long override_config); - // MUST_USE_RES LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const LDKChannelManager *this_arg); + // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long[] ChannelManager_list_channels(long this_arg); - // MUST_USE_RES LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const LDKChannelManager *this_arg); + // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long[] ChannelManager_list_usable_channels(long this_arg); - // MUST_USE_RES LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const LDKChannelManager *this_arg, const uint8_t (*channel_id)[32]); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]); public static native long ChannelManager_close_channel(long this_arg, byte[] channel_id); - // void ChannelManager_force_close_channel(const LDKChannelManager *this_arg, const uint8_t (*channel_id)[32]); + // void ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]); public static native void ChannelManager_force_close_channel(long this_arg, byte[] channel_id); - // void ChannelManager_force_close_all_channels(const LDKChannelManager *this_arg); + // void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native void ChannelManager_force_close_all_channels(long this_arg); - // MUST_USE_RES LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const LDKChannelManager *this_arg, const LDKRoute *route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret); + // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret); public static native long ChannelManager_send_payment(long this_arg, long route, byte[] payment_hash, byte[] payment_secret); - // void ChannelManager_funding_transaction_generated(const LDKChannelManager *this_arg, const uint8_t (*temporary_channel_id)[32], LDKOutPoint funding_txo); + // void ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKOutPoint funding_txo); public static native void ChannelManager_funding_transaction_generated(long this_arg, byte[] temporary_channel_id, long funding_txo); - // void ChannelManager_broadcast_node_announcement(const LDKChannelManager *this_arg, LDKThreeBytes rgb, LDKThirtyTwoBytes alias, LDKCVec_NetAddressZ addresses); + // void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses); public static native void ChannelManager_broadcast_node_announcement(long this_arg, byte[] rgb, byte[] alias, long[] addresses); - // void ChannelManager_process_pending_htlc_forwards(const LDKChannelManager *this_arg); + // void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native void ChannelManager_process_pending_htlc_forwards(long this_arg); - // void ChannelManager_timer_chan_freshness_every_min(const LDKChannelManager *this_arg); + // void ChannelManager_timer_chan_freshness_every_min(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native void ChannelManager_timer_chan_freshness_every_min(long this_arg); - // MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const LDKChannelManager *this_arg, const uint8_t (*payment_hash)[32], LDKThirtyTwoBytes payment_secret); + // MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKThirtyTwoBytes payment_secret); public static native boolean ChannelManager_fail_htlc_backwards(long this_arg, byte[] payment_hash, byte[] payment_secret); - // MUST_USE_RES bool ChannelManager_claim_funds(const LDKChannelManager *this_arg, LDKThirtyTwoBytes payment_preimage, LDKThirtyTwoBytes payment_secret, uint64_t expected_amount); + // MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t expected_amount); public static native boolean ChannelManager_claim_funds(long this_arg, byte[] payment_preimage, byte[] payment_secret, long expected_amount); - // MUST_USE_RES LDKPublicKey ChannelManager_get_our_node_id(const LDKChannelManager *this_arg); + // MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native byte[] ChannelManager_get_our_node_id(long this_arg); - // void ChannelManager_channel_monitor_updated(const LDKChannelManager *this_arg, const LDKOutPoint *funding_txo, uint64_t highest_applied_update_id); + // void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR funding_txo, uint64_t highest_applied_update_id); public static native void ChannelManager_channel_monitor_updated(long this_arg, long funding_txo, long highest_applied_update_id); - // LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const LDKChannelManager *this_arg); + // struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long ChannelManager_as_MessageSendEventsProvider(long this_arg); - // LDKEventsProvider ChannelManager_as_EventsProvider(const LDKChannelManager *this_arg); + // struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long ChannelManager_as_EventsProvider(long this_arg); - // void ChannelManager_block_connected(const LDKChannelManager *this_arg, const uint8_t (*header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height); + // void ChannelManager_block_connected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height); public static native void ChannelManager_block_connected(long this_arg, byte[] header, long[] txdata, int height); - // void ChannelManager_block_disconnected(const LDKChannelManager *this_arg, const uint8_t (*header)[80]); + // void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]); public static native void ChannelManager_block_disconnected(long this_arg, byte[] header); - // LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const LDKChannelManager *this_arg); + // struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long ChannelManager_as_ChannelMessageHandler(long this_arg); - // LDKCVec_u8Z ChannelManager_write(const LDKChannelManager *this_ptr); - public static native byte[] ChannelManager_write(long this_ptr); - // void ChannelManagerReadArgs_free(LDKChannelManagerReadArgs this_ptr); + // struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj); + public static native byte[] ChannelManager_write(long obj); + // void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_ptr); public static native void ChannelManagerReadArgs_free(long this_ptr); - // const LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const LDKChannelManagerReadArgs *this_ptr); + // const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); public static native long ChannelManagerReadArgs_get_keys_manager(long this_ptr); - // void ChannelManagerReadArgs_set_keys_manager(LDKChannelManagerReadArgs *this_ptr, LDKKeysInterface val); + // void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val); public static native void ChannelManagerReadArgs_set_keys_manager(long this_ptr, long val); - // const LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const LDKChannelManagerReadArgs *this_ptr); + // const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); public static native long ChannelManagerReadArgs_get_fee_estimator(long this_ptr); - // void ChannelManagerReadArgs_set_fee_estimator(LDKChannelManagerReadArgs *this_ptr, LDKFeeEstimator val); + // void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val); public static native void ChannelManagerReadArgs_set_fee_estimator(long this_ptr, long val); - // const LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const LDKChannelManagerReadArgs *this_ptr); + // const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); public static native long ChannelManagerReadArgs_get_chain_monitor(long this_ptr); - // void ChannelManagerReadArgs_set_chain_monitor(LDKChannelManagerReadArgs *this_ptr, LDKWatch val); + // void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val); public static native void ChannelManagerReadArgs_set_chain_monitor(long this_ptr, long val); - // const LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const LDKChannelManagerReadArgs *this_ptr); + // const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); public static native long ChannelManagerReadArgs_get_tx_broadcaster(long this_ptr); - // void ChannelManagerReadArgs_set_tx_broadcaster(LDKChannelManagerReadArgs *this_ptr, LDKBroadcasterInterface val); + // void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val); public static native void ChannelManagerReadArgs_set_tx_broadcaster(long this_ptr, long val); - // const LDKLogger *ChannelManagerReadArgs_get_logger(const LDKChannelManagerReadArgs *this_ptr); + // const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); public static native long ChannelManagerReadArgs_get_logger(long this_ptr); - // void ChannelManagerReadArgs_set_logger(LDKChannelManagerReadArgs *this_ptr, LDKLogger val); + // void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val); public static native void ChannelManagerReadArgs_set_logger(long this_ptr, long val); - // LDKUserConfig ChannelManagerReadArgs_get_default_config(const LDKChannelManagerReadArgs *this_ptr); + // struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); public static native long ChannelManagerReadArgs_get_default_config(long this_ptr); - // void ChannelManagerReadArgs_set_default_config(LDKChannelManagerReadArgs *this_ptr, LDKUserConfig val); + // void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val); public static native void ChannelManagerReadArgs_set_default_config(long this_ptr, long val); - // MUST_USE_RES LDKChannelManagerReadArgs ChannelManagerReadArgs_new(LDKKeysInterface keys_manager, LDKFeeEstimator fee_estimator, LDKWatch chain_monitor, LDKBroadcasterInterface tx_broadcaster, LDKLogger logger, LDKUserConfig default_config, LDKCVec_ChannelMonitorZ channel_monitors); + // MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKKeysInterface keys_manager, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors); public static native long ChannelManagerReadArgs_new(long keys_manager, long fee_estimator, long chain_monitor, long tx_broadcaster, long logger, long default_config, long[] channel_monitors); - // void DecodeError_free(LDKDecodeError this_ptr); + // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg); + public static native long C2Tuple_BlockHashChannelManagerZ_read(byte[] ser, long arg); + // void DecodeError_free(struct LDKDecodeError this_ptr); public static native void DecodeError_free(long this_ptr); - // void Init_free(LDKInit this_ptr); + // void Init_free(struct LDKInit this_ptr); public static native void Init_free(long this_ptr); - // LDKInit Init_clone(const LDKInit *orig); + // struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig); public static native long Init_clone(long orig); - // void ErrorMessage_free(LDKErrorMessage this_ptr); + // void ErrorMessage_free(struct LDKErrorMessage this_ptr); public static native void ErrorMessage_free(long this_ptr); - // LDKErrorMessage ErrorMessage_clone(const LDKErrorMessage *orig); + // struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig); public static native long ErrorMessage_clone(long orig); - // const uint8_t (*ErrorMessage_get_channel_id(const LDKErrorMessage *this_ptr))[32]; + // const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32]; public static native byte[] ErrorMessage_get_channel_id(long this_ptr); - // void ErrorMessage_set_channel_id(LDKErrorMessage *this_ptr, LDKThirtyTwoBytes val); + // void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void ErrorMessage_set_channel_id(long this_ptr, byte[] val); - // LDKStr ErrorMessage_get_data(const LDKErrorMessage *this_ptr); + // struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr); public static native String ErrorMessage_get_data(long this_ptr); - // void ErrorMessage_set_data(LDKErrorMessage *this_ptr, LDKCVec_u8Z val); + // void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); public static native void ErrorMessage_set_data(long this_ptr, byte[] val); - // MUST_USE_RES LDKErrorMessage ErrorMessage_new(LDKThirtyTwoBytes channel_id_arg, LDKCVec_u8Z data_arg); + // MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg); public static native long ErrorMessage_new(byte[] channel_id_arg, byte[] data_arg); - // void Ping_free(LDKPing this_ptr); + // void Ping_free(struct LDKPing this_ptr); public static native void Ping_free(long this_ptr); - // LDKPing Ping_clone(const LDKPing *orig); + // struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig); public static native long Ping_clone(long orig); - // uint16_t Ping_get_ponglen(const LDKPing *this_ptr); + // uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr); public static native short Ping_get_ponglen(long this_ptr); - // void Ping_set_ponglen(LDKPing *this_ptr, uint16_t val); + // void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val); public static native void Ping_set_ponglen(long this_ptr, short val); - // uint16_t Ping_get_byteslen(const LDKPing *this_ptr); + // uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr); public static native short Ping_get_byteslen(long this_ptr); - // void Ping_set_byteslen(LDKPing *this_ptr, uint16_t val); + // void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val); public static native void Ping_set_byteslen(long this_ptr, short val); - // MUST_USE_RES LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg); + // MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg); public static native long Ping_new(short ponglen_arg, short byteslen_arg); - // void Pong_free(LDKPong this_ptr); + // void Pong_free(struct LDKPong this_ptr); public static native void Pong_free(long this_ptr); - // LDKPong Pong_clone(const LDKPong *orig); + // struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig); public static native long Pong_clone(long orig); - // uint16_t Pong_get_byteslen(const LDKPong *this_ptr); + // uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr); public static native short Pong_get_byteslen(long this_ptr); - // void Pong_set_byteslen(LDKPong *this_ptr, uint16_t val); + // void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val); public static native void Pong_set_byteslen(long this_ptr, short val); - // MUST_USE_RES LDKPong Pong_new(uint16_t byteslen_arg); + // MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg); public static native long Pong_new(short byteslen_arg); - // void OpenChannel_free(LDKOpenChannel this_ptr); + // void OpenChannel_free(struct LDKOpenChannel this_ptr); public static native void OpenChannel_free(long this_ptr); - // LDKOpenChannel OpenChannel_clone(const LDKOpenChannel *orig); + // struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig); public static native long OpenChannel_clone(long orig); - // const uint8_t (*OpenChannel_get_chain_hash(const LDKOpenChannel *this_ptr))[32]; + // const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; public static native byte[] OpenChannel_get_chain_hash(long this_ptr); - // void OpenChannel_set_chain_hash(LDKOpenChannel *this_ptr, LDKThirtyTwoBytes val); + // void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void OpenChannel_set_chain_hash(long this_ptr, byte[] val); - // const uint8_t (*OpenChannel_get_temporary_channel_id(const LDKOpenChannel *this_ptr))[32]; + // const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; public static native byte[] OpenChannel_get_temporary_channel_id(long this_ptr); - // void OpenChannel_set_temporary_channel_id(LDKOpenChannel *this_ptr, LDKThirtyTwoBytes val); + // void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void OpenChannel_set_temporary_channel_id(long this_ptr, byte[] val); - // uint64_t OpenChannel_get_funding_satoshis(const LDKOpenChannel *this_ptr); + // uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native long OpenChannel_get_funding_satoshis(long this_ptr); - // void OpenChannel_set_funding_satoshis(LDKOpenChannel *this_ptr, uint64_t val); + // void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); public static native void OpenChannel_set_funding_satoshis(long this_ptr, long val); - // uint64_t OpenChannel_get_push_msat(const LDKOpenChannel *this_ptr); + // uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native long OpenChannel_get_push_msat(long this_ptr); - // void OpenChannel_set_push_msat(LDKOpenChannel *this_ptr, uint64_t val); + // void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); public static native void OpenChannel_set_push_msat(long this_ptr, long val); - // uint64_t OpenChannel_get_dust_limit_satoshis(const LDKOpenChannel *this_ptr); + // uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native long OpenChannel_get_dust_limit_satoshis(long this_ptr); - // void OpenChannel_set_dust_limit_satoshis(LDKOpenChannel *this_ptr, uint64_t val); + // void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); public static native void OpenChannel_set_dust_limit_satoshis(long this_ptr, long val); - // uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const LDKOpenChannel *this_ptr); + // uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native long OpenChannel_get_max_htlc_value_in_flight_msat(long this_ptr); - // void OpenChannel_set_max_htlc_value_in_flight_msat(LDKOpenChannel *this_ptr, uint64_t val); + // void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); public static native void OpenChannel_set_max_htlc_value_in_flight_msat(long this_ptr, long val); - // uint64_t OpenChannel_get_channel_reserve_satoshis(const LDKOpenChannel *this_ptr); + // uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native long OpenChannel_get_channel_reserve_satoshis(long this_ptr); - // void OpenChannel_set_channel_reserve_satoshis(LDKOpenChannel *this_ptr, uint64_t val); + // void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); public static native void OpenChannel_set_channel_reserve_satoshis(long this_ptr, long val); - // uint64_t OpenChannel_get_htlc_minimum_msat(const LDKOpenChannel *this_ptr); + // uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native long OpenChannel_get_htlc_minimum_msat(long this_ptr); - // void OpenChannel_set_htlc_minimum_msat(LDKOpenChannel *this_ptr, uint64_t val); + // void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); public static native void OpenChannel_set_htlc_minimum_msat(long this_ptr, long val); - // uint32_t OpenChannel_get_feerate_per_kw(const LDKOpenChannel *this_ptr); + // uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native int OpenChannel_get_feerate_per_kw(long this_ptr); - // void OpenChannel_set_feerate_per_kw(LDKOpenChannel *this_ptr, uint32_t val); + // void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val); public static native void OpenChannel_set_feerate_per_kw(long this_ptr, int val); - // uint16_t OpenChannel_get_to_self_delay(const LDKOpenChannel *this_ptr); + // uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native short OpenChannel_get_to_self_delay(long this_ptr); - // void OpenChannel_set_to_self_delay(LDKOpenChannel *this_ptr, uint16_t val); + // void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val); public static native void OpenChannel_set_to_self_delay(long this_ptr, short val); - // uint16_t OpenChannel_get_max_accepted_htlcs(const LDKOpenChannel *this_ptr); + // uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native short OpenChannel_get_max_accepted_htlcs(long this_ptr); - // void OpenChannel_set_max_accepted_htlcs(LDKOpenChannel *this_ptr, uint16_t val); + // void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val); public static native void OpenChannel_set_max_accepted_htlcs(long this_ptr, short val); - // LDKPublicKey OpenChannel_get_funding_pubkey(const LDKOpenChannel *this_ptr); + // struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native byte[] OpenChannel_get_funding_pubkey(long this_ptr); - // void OpenChannel_set_funding_pubkey(LDKOpenChannel *this_ptr, LDKPublicKey val); + // void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void OpenChannel_set_funding_pubkey(long this_ptr, byte[] val); - // LDKPublicKey OpenChannel_get_revocation_basepoint(const LDKOpenChannel *this_ptr); + // struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native byte[] OpenChannel_get_revocation_basepoint(long this_ptr); - // void OpenChannel_set_revocation_basepoint(LDKOpenChannel *this_ptr, LDKPublicKey val); + // void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void OpenChannel_set_revocation_basepoint(long this_ptr, byte[] val); - // LDKPublicKey OpenChannel_get_payment_point(const LDKOpenChannel *this_ptr); + // struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native byte[] OpenChannel_get_payment_point(long this_ptr); - // void OpenChannel_set_payment_point(LDKOpenChannel *this_ptr, LDKPublicKey val); + // void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void OpenChannel_set_payment_point(long this_ptr, byte[] val); - // LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const LDKOpenChannel *this_ptr); + // struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native byte[] OpenChannel_get_delayed_payment_basepoint(long this_ptr); - // void OpenChannel_set_delayed_payment_basepoint(LDKOpenChannel *this_ptr, LDKPublicKey val); + // void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void OpenChannel_set_delayed_payment_basepoint(long this_ptr, byte[] val); - // LDKPublicKey OpenChannel_get_htlc_basepoint(const LDKOpenChannel *this_ptr); + // struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native byte[] OpenChannel_get_htlc_basepoint(long this_ptr); - // void OpenChannel_set_htlc_basepoint(LDKOpenChannel *this_ptr, LDKPublicKey val); + // void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void OpenChannel_set_htlc_basepoint(long this_ptr, byte[] val); - // LDKPublicKey OpenChannel_get_first_per_commitment_point(const LDKOpenChannel *this_ptr); + // struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native byte[] OpenChannel_get_first_per_commitment_point(long this_ptr); - // void OpenChannel_set_first_per_commitment_point(LDKOpenChannel *this_ptr, LDKPublicKey val); + // void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void OpenChannel_set_first_per_commitment_point(long this_ptr, byte[] val); - // uint8_t OpenChannel_get_channel_flags(const LDKOpenChannel *this_ptr); + // uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr); public static native byte OpenChannel_get_channel_flags(long this_ptr); - // void OpenChannel_set_channel_flags(LDKOpenChannel *this_ptr, uint8_t val); + // void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val); public static native void OpenChannel_set_channel_flags(long this_ptr, byte val); - // void AcceptChannel_free(LDKAcceptChannel this_ptr); + // void AcceptChannel_free(struct LDKAcceptChannel this_ptr); public static native void AcceptChannel_free(long this_ptr); - // LDKAcceptChannel AcceptChannel_clone(const LDKAcceptChannel *orig); + // struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig); public static native long AcceptChannel_clone(long orig); - // const uint8_t (*AcceptChannel_get_temporary_channel_id(const LDKAcceptChannel *this_ptr))[32]; + // const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32]; public static native byte[] AcceptChannel_get_temporary_channel_id(long this_ptr); - // void AcceptChannel_set_temporary_channel_id(LDKAcceptChannel *this_ptr, LDKThirtyTwoBytes val); + // void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void AcceptChannel_set_temporary_channel_id(long this_ptr, byte[] val); - // uint64_t AcceptChannel_get_dust_limit_satoshis(const LDKAcceptChannel *this_ptr); + // uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native long AcceptChannel_get_dust_limit_satoshis(long this_ptr); - // void AcceptChannel_set_dust_limit_satoshis(LDKAcceptChannel *this_ptr, uint64_t val); + // void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); public static native void AcceptChannel_set_dust_limit_satoshis(long this_ptr, long val); - // uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const LDKAcceptChannel *this_ptr); + // uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native long AcceptChannel_get_max_htlc_value_in_flight_msat(long this_ptr); - // void AcceptChannel_set_max_htlc_value_in_flight_msat(LDKAcceptChannel *this_ptr, uint64_t val); + // void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); public static native void AcceptChannel_set_max_htlc_value_in_flight_msat(long this_ptr, long val); - // uint64_t AcceptChannel_get_channel_reserve_satoshis(const LDKAcceptChannel *this_ptr); + // uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native long AcceptChannel_get_channel_reserve_satoshis(long this_ptr); - // void AcceptChannel_set_channel_reserve_satoshis(LDKAcceptChannel *this_ptr, uint64_t val); + // void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); public static native void AcceptChannel_set_channel_reserve_satoshis(long this_ptr, long val); - // uint64_t AcceptChannel_get_htlc_minimum_msat(const LDKAcceptChannel *this_ptr); + // uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native long AcceptChannel_get_htlc_minimum_msat(long this_ptr); - // void AcceptChannel_set_htlc_minimum_msat(LDKAcceptChannel *this_ptr, uint64_t val); + // void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); public static native void AcceptChannel_set_htlc_minimum_msat(long this_ptr, long val); - // uint32_t AcceptChannel_get_minimum_depth(const LDKAcceptChannel *this_ptr); + // uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native int AcceptChannel_get_minimum_depth(long this_ptr); - // void AcceptChannel_set_minimum_depth(LDKAcceptChannel *this_ptr, uint32_t val); + // void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val); public static native void AcceptChannel_set_minimum_depth(long this_ptr, int val); - // uint16_t AcceptChannel_get_to_self_delay(const LDKAcceptChannel *this_ptr); + // uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native short AcceptChannel_get_to_self_delay(long this_ptr); - // void AcceptChannel_set_to_self_delay(LDKAcceptChannel *this_ptr, uint16_t val); + // void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val); public static native void AcceptChannel_set_to_self_delay(long this_ptr, short val); - // uint16_t AcceptChannel_get_max_accepted_htlcs(const LDKAcceptChannel *this_ptr); + // uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native short AcceptChannel_get_max_accepted_htlcs(long this_ptr); - // void AcceptChannel_set_max_accepted_htlcs(LDKAcceptChannel *this_ptr, uint16_t val); + // void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val); public static native void AcceptChannel_set_max_accepted_htlcs(long this_ptr, short val); - // LDKPublicKey AcceptChannel_get_funding_pubkey(const LDKAcceptChannel *this_ptr); + // struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native byte[] AcceptChannel_get_funding_pubkey(long this_ptr); - // void AcceptChannel_set_funding_pubkey(LDKAcceptChannel *this_ptr, LDKPublicKey val); + // void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void AcceptChannel_set_funding_pubkey(long this_ptr, byte[] val); - // LDKPublicKey AcceptChannel_get_revocation_basepoint(const LDKAcceptChannel *this_ptr); + // struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native byte[] AcceptChannel_get_revocation_basepoint(long this_ptr); - // void AcceptChannel_set_revocation_basepoint(LDKAcceptChannel *this_ptr, LDKPublicKey val); + // void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void AcceptChannel_set_revocation_basepoint(long this_ptr, byte[] val); - // LDKPublicKey AcceptChannel_get_payment_point(const LDKAcceptChannel *this_ptr); + // struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native byte[] AcceptChannel_get_payment_point(long this_ptr); - // void AcceptChannel_set_payment_point(LDKAcceptChannel *this_ptr, LDKPublicKey val); + // void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void AcceptChannel_set_payment_point(long this_ptr, byte[] val); - // LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const LDKAcceptChannel *this_ptr); + // struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native byte[] AcceptChannel_get_delayed_payment_basepoint(long this_ptr); - // void AcceptChannel_set_delayed_payment_basepoint(LDKAcceptChannel *this_ptr, LDKPublicKey val); + // void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void AcceptChannel_set_delayed_payment_basepoint(long this_ptr, byte[] val); - // LDKPublicKey AcceptChannel_get_htlc_basepoint(const LDKAcceptChannel *this_ptr); + // struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native byte[] AcceptChannel_get_htlc_basepoint(long this_ptr); - // void AcceptChannel_set_htlc_basepoint(LDKAcceptChannel *this_ptr, LDKPublicKey val); + // void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void AcceptChannel_set_htlc_basepoint(long this_ptr, byte[] val); - // LDKPublicKey AcceptChannel_get_first_per_commitment_point(const LDKAcceptChannel *this_ptr); + // struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); public static native byte[] AcceptChannel_get_first_per_commitment_point(long this_ptr); - // void AcceptChannel_set_first_per_commitment_point(LDKAcceptChannel *this_ptr, LDKPublicKey val); + // void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void AcceptChannel_set_first_per_commitment_point(long this_ptr, byte[] val); - // void FundingCreated_free(LDKFundingCreated this_ptr); + // void FundingCreated_free(struct LDKFundingCreated this_ptr); public static native void FundingCreated_free(long this_ptr); - // LDKFundingCreated FundingCreated_clone(const LDKFundingCreated *orig); + // struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig); public static native long FundingCreated_clone(long orig); - // const uint8_t (*FundingCreated_get_temporary_channel_id(const LDKFundingCreated *this_ptr))[32]; + // const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; public static native byte[] FundingCreated_get_temporary_channel_id(long this_ptr); - // void FundingCreated_set_temporary_channel_id(LDKFundingCreated *this_ptr, LDKThirtyTwoBytes val); + // void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void FundingCreated_set_temporary_channel_id(long this_ptr, byte[] val); - // const uint8_t (*FundingCreated_get_funding_txid(const LDKFundingCreated *this_ptr))[32]; + // const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; public static native byte[] FundingCreated_get_funding_txid(long this_ptr); - // void FundingCreated_set_funding_txid(LDKFundingCreated *this_ptr, LDKThirtyTwoBytes val); + // void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void FundingCreated_set_funding_txid(long this_ptr, byte[] val); - // uint16_t FundingCreated_get_funding_output_index(const LDKFundingCreated *this_ptr); + // uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr); public static native short FundingCreated_get_funding_output_index(long this_ptr); - // void FundingCreated_set_funding_output_index(LDKFundingCreated *this_ptr, uint16_t val); + // void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val); public static native void FundingCreated_set_funding_output_index(long this_ptr, short val); - // LDKSignature FundingCreated_get_signature(const LDKFundingCreated *this_ptr); + // struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr); public static native byte[] FundingCreated_get_signature(long this_ptr); - // void FundingCreated_set_signature(LDKFundingCreated *this_ptr, LDKSignature val); + // void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void FundingCreated_set_signature(long this_ptr, byte[] val); - // MUST_USE_RES LDKFundingCreated FundingCreated_new(LDKThirtyTwoBytes temporary_channel_id_arg, LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, LDKSignature signature_arg); + // MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKSignature signature_arg); public static native long FundingCreated_new(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg); - // void FundingSigned_free(LDKFundingSigned this_ptr); + // void FundingSigned_free(struct LDKFundingSigned this_ptr); public static native void FundingSigned_free(long this_ptr); - // LDKFundingSigned FundingSigned_clone(const LDKFundingSigned *orig); + // struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig); public static native long FundingSigned_clone(long orig); - // const uint8_t (*FundingSigned_get_channel_id(const LDKFundingSigned *this_ptr))[32]; + // const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32]; public static native byte[] FundingSigned_get_channel_id(long this_ptr); - // void FundingSigned_set_channel_id(LDKFundingSigned *this_ptr, LDKThirtyTwoBytes val); + // void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void FundingSigned_set_channel_id(long this_ptr, byte[] val); - // LDKSignature FundingSigned_get_signature(const LDKFundingSigned *this_ptr); + // struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr); public static native byte[] FundingSigned_get_signature(long this_ptr); - // void FundingSigned_set_signature(LDKFundingSigned *this_ptr, LDKSignature val); + // void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void FundingSigned_set_signature(long this_ptr, byte[] val); - // MUST_USE_RES LDKFundingSigned FundingSigned_new(LDKThirtyTwoBytes channel_id_arg, LDKSignature signature_arg); + // MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg); public static native long FundingSigned_new(byte[] channel_id_arg, byte[] signature_arg); - // void FundingLocked_free(LDKFundingLocked this_ptr); + // void FundingLocked_free(struct LDKFundingLocked this_ptr); public static native void FundingLocked_free(long this_ptr); - // LDKFundingLocked FundingLocked_clone(const LDKFundingLocked *orig); + // struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig); public static native long FundingLocked_clone(long orig); - // const uint8_t (*FundingLocked_get_channel_id(const LDKFundingLocked *this_ptr))[32]; + // const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32]; public static native byte[] FundingLocked_get_channel_id(long this_ptr); - // void FundingLocked_set_channel_id(LDKFundingLocked *this_ptr, LDKThirtyTwoBytes val); + // void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void FundingLocked_set_channel_id(long this_ptr, byte[] val); - // LDKPublicKey FundingLocked_get_next_per_commitment_point(const LDKFundingLocked *this_ptr); + // struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr); public static native byte[] FundingLocked_get_next_per_commitment_point(long this_ptr); - // void FundingLocked_set_next_per_commitment_point(LDKFundingLocked *this_ptr, LDKPublicKey val); + // void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void FundingLocked_set_next_per_commitment_point(long this_ptr, byte[] val); - // MUST_USE_RES LDKFundingLocked FundingLocked_new(LDKThirtyTwoBytes channel_id_arg, LDKPublicKey next_per_commitment_point_arg); + // MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg); public static native long FundingLocked_new(byte[] channel_id_arg, byte[] next_per_commitment_point_arg); - // void Shutdown_free(LDKShutdown this_ptr); + // void Shutdown_free(struct LDKShutdown this_ptr); public static native void Shutdown_free(long this_ptr); - // LDKShutdown Shutdown_clone(const LDKShutdown *orig); + // struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig); public static native long Shutdown_clone(long orig); - // const uint8_t (*Shutdown_get_channel_id(const LDKShutdown *this_ptr))[32]; + // const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32]; public static native byte[] Shutdown_get_channel_id(long this_ptr); - // void Shutdown_set_channel_id(LDKShutdown *this_ptr, LDKThirtyTwoBytes val); + // void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void Shutdown_set_channel_id(long this_ptr, byte[] val); - // LDKu8slice Shutdown_get_scriptpubkey(const LDKShutdown *this_ptr); + // struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr); public static native byte[] Shutdown_get_scriptpubkey(long this_ptr); - // void Shutdown_set_scriptpubkey(LDKShutdown *this_ptr, LDKCVec_u8Z val); + // void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); public static native void Shutdown_set_scriptpubkey(long this_ptr, byte[] val); - // MUST_USE_RES LDKShutdown Shutdown_new(LDKThirtyTwoBytes channel_id_arg, LDKCVec_u8Z scriptpubkey_arg); + // MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg); public static native long Shutdown_new(byte[] channel_id_arg, byte[] scriptpubkey_arg); - // void ClosingSigned_free(LDKClosingSigned this_ptr); + // void ClosingSigned_free(struct LDKClosingSigned this_ptr); public static native void ClosingSigned_free(long this_ptr); - // LDKClosingSigned ClosingSigned_clone(const LDKClosingSigned *orig); + // struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig); public static native long ClosingSigned_clone(long orig); - // const uint8_t (*ClosingSigned_get_channel_id(const LDKClosingSigned *this_ptr))[32]; + // const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32]; public static native byte[] ClosingSigned_get_channel_id(long this_ptr); - // void ClosingSigned_set_channel_id(LDKClosingSigned *this_ptr, LDKThirtyTwoBytes val); + // void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void ClosingSigned_set_channel_id(long this_ptr, byte[] val); - // uint64_t ClosingSigned_get_fee_satoshis(const LDKClosingSigned *this_ptr); + // uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr); public static native long ClosingSigned_get_fee_satoshis(long this_ptr); - // void ClosingSigned_set_fee_satoshis(LDKClosingSigned *this_ptr, uint64_t val); + // void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val); public static native void ClosingSigned_set_fee_satoshis(long this_ptr, long val); - // LDKSignature ClosingSigned_get_signature(const LDKClosingSigned *this_ptr); + // struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr); public static native byte[] ClosingSigned_get_signature(long this_ptr); - // void ClosingSigned_set_signature(LDKClosingSigned *this_ptr, LDKSignature val); + // void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void ClosingSigned_set_signature(long this_ptr, byte[] val); - // MUST_USE_RES LDKClosingSigned ClosingSigned_new(LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, LDKSignature signature_arg); + // MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg); public static native long ClosingSigned_new(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg); - // void UpdateAddHTLC_free(LDKUpdateAddHTLC this_ptr); + // void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr); public static native void UpdateAddHTLC_free(long this_ptr); - // LDKUpdateAddHTLC UpdateAddHTLC_clone(const LDKUpdateAddHTLC *orig); + // struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig); public static native long UpdateAddHTLC_clone(long orig); - // const uint8_t (*UpdateAddHTLC_get_channel_id(const LDKUpdateAddHTLC *this_ptr))[32]; + // const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32]; public static native byte[] UpdateAddHTLC_get_channel_id(long this_ptr); - // void UpdateAddHTLC_set_channel_id(LDKUpdateAddHTLC *this_ptr, LDKThirtyTwoBytes val); + // void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void UpdateAddHTLC_set_channel_id(long this_ptr, byte[] val); - // uint64_t UpdateAddHTLC_get_htlc_id(const LDKUpdateAddHTLC *this_ptr); + // uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); public static native long UpdateAddHTLC_get_htlc_id(long this_ptr); - // void UpdateAddHTLC_set_htlc_id(LDKUpdateAddHTLC *this_ptr, uint64_t val); + // void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val); public static native void UpdateAddHTLC_set_htlc_id(long this_ptr, long val); - // uint64_t UpdateAddHTLC_get_amount_msat(const LDKUpdateAddHTLC *this_ptr); + // uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); public static native long UpdateAddHTLC_get_amount_msat(long this_ptr); - // void UpdateAddHTLC_set_amount_msat(LDKUpdateAddHTLC *this_ptr, uint64_t val); + // void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val); public static native void UpdateAddHTLC_set_amount_msat(long this_ptr, long val); - // const uint8_t (*UpdateAddHTLC_get_payment_hash(const LDKUpdateAddHTLC *this_ptr))[32]; + // const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32]; public static native byte[] UpdateAddHTLC_get_payment_hash(long this_ptr); - // void UpdateAddHTLC_set_payment_hash(LDKUpdateAddHTLC *this_ptr, LDKThirtyTwoBytes val); + // void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void UpdateAddHTLC_set_payment_hash(long this_ptr, byte[] val); - // uint32_t UpdateAddHTLC_get_cltv_expiry(const LDKUpdateAddHTLC *this_ptr); + // uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); public static native int UpdateAddHTLC_get_cltv_expiry(long this_ptr); - // void UpdateAddHTLC_set_cltv_expiry(LDKUpdateAddHTLC *this_ptr, uint32_t val); + // void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val); public static native void UpdateAddHTLC_set_cltv_expiry(long this_ptr, int val); - // void UpdateFulfillHTLC_free(LDKUpdateFulfillHTLC this_ptr); + // void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr); public static native void UpdateFulfillHTLC_free(long this_ptr); - // LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const LDKUpdateFulfillHTLC *orig); + // struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig); public static native long UpdateFulfillHTLC_clone(long orig); - // const uint8_t (*UpdateFulfillHTLC_get_channel_id(const LDKUpdateFulfillHTLC *this_ptr))[32]; + // const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32]; public static native byte[] UpdateFulfillHTLC_get_channel_id(long this_ptr); - // void UpdateFulfillHTLC_set_channel_id(LDKUpdateFulfillHTLC *this_ptr, LDKThirtyTwoBytes val); + // void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void UpdateFulfillHTLC_set_channel_id(long this_ptr, byte[] val); - // uint64_t UpdateFulfillHTLC_get_htlc_id(const LDKUpdateFulfillHTLC *this_ptr); + // uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr); public static native long UpdateFulfillHTLC_get_htlc_id(long this_ptr); - // void UpdateFulfillHTLC_set_htlc_id(LDKUpdateFulfillHTLC *this_ptr, uint64_t val); + // void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val); public static native void UpdateFulfillHTLC_set_htlc_id(long this_ptr, long val); - // const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const LDKUpdateFulfillHTLC *this_ptr))[32]; + // const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32]; public static native byte[] UpdateFulfillHTLC_get_payment_preimage(long this_ptr); - // void UpdateFulfillHTLC_set_payment_preimage(LDKUpdateFulfillHTLC *this_ptr, LDKThirtyTwoBytes val); + // void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void UpdateFulfillHTLC_set_payment_preimage(long this_ptr, byte[] val); - // MUST_USE_RES LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, LDKThirtyTwoBytes payment_preimage_arg); + // MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg); public static native long UpdateFulfillHTLC_new(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg); - // void UpdateFailHTLC_free(LDKUpdateFailHTLC this_ptr); + // void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr); public static native void UpdateFailHTLC_free(long this_ptr); - // LDKUpdateFailHTLC UpdateFailHTLC_clone(const LDKUpdateFailHTLC *orig); + // struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig); public static native long UpdateFailHTLC_clone(long orig); - // const uint8_t (*UpdateFailHTLC_get_channel_id(const LDKUpdateFailHTLC *this_ptr))[32]; + // const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32]; public static native byte[] UpdateFailHTLC_get_channel_id(long this_ptr); - // void UpdateFailHTLC_set_channel_id(LDKUpdateFailHTLC *this_ptr, LDKThirtyTwoBytes val); + // void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void UpdateFailHTLC_set_channel_id(long this_ptr, byte[] val); - // uint64_t UpdateFailHTLC_get_htlc_id(const LDKUpdateFailHTLC *this_ptr); + // uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr); public static native long UpdateFailHTLC_get_htlc_id(long this_ptr); - // void UpdateFailHTLC_set_htlc_id(LDKUpdateFailHTLC *this_ptr, uint64_t val); + // void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val); public static native void UpdateFailHTLC_set_htlc_id(long this_ptr, long val); - // void UpdateFailMalformedHTLC_free(LDKUpdateFailMalformedHTLC this_ptr); + // void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr); public static native void UpdateFailMalformedHTLC_free(long this_ptr); - // LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const LDKUpdateFailMalformedHTLC *orig); + // struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig); public static native long UpdateFailMalformedHTLC_clone(long orig); - // const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const LDKUpdateFailMalformedHTLC *this_ptr))[32]; + // const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32]; public static native byte[] UpdateFailMalformedHTLC_get_channel_id(long this_ptr); - // void UpdateFailMalformedHTLC_set_channel_id(LDKUpdateFailMalformedHTLC *this_ptr, LDKThirtyTwoBytes val); + // void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void UpdateFailMalformedHTLC_set_channel_id(long this_ptr, byte[] val); - // uint64_t UpdateFailMalformedHTLC_get_htlc_id(const LDKUpdateFailMalformedHTLC *this_ptr); + // uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr); public static native long UpdateFailMalformedHTLC_get_htlc_id(long this_ptr); - // void UpdateFailMalformedHTLC_set_htlc_id(LDKUpdateFailMalformedHTLC *this_ptr, uint64_t val); + // void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val); public static native void UpdateFailMalformedHTLC_set_htlc_id(long this_ptr, long val); - // uint16_t UpdateFailMalformedHTLC_get_failure_code(const LDKUpdateFailMalformedHTLC *this_ptr); + // uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr); public static native short UpdateFailMalformedHTLC_get_failure_code(long this_ptr); - // void UpdateFailMalformedHTLC_set_failure_code(LDKUpdateFailMalformedHTLC *this_ptr, uint16_t val); + // void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val); public static native void UpdateFailMalformedHTLC_set_failure_code(long this_ptr, short val); - // void CommitmentSigned_free(LDKCommitmentSigned this_ptr); + // void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr); public static native void CommitmentSigned_free(long this_ptr); - // LDKCommitmentSigned CommitmentSigned_clone(const LDKCommitmentSigned *orig); + // struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); public static native long CommitmentSigned_clone(long orig); - // const uint8_t (*CommitmentSigned_get_channel_id(const LDKCommitmentSigned *this_ptr))[32]; + // const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32]; public static native byte[] CommitmentSigned_get_channel_id(long this_ptr); - // void CommitmentSigned_set_channel_id(LDKCommitmentSigned *this_ptr, LDKThirtyTwoBytes val); + // void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void CommitmentSigned_set_channel_id(long this_ptr, byte[] val); - // LDKSignature CommitmentSigned_get_signature(const LDKCommitmentSigned *this_ptr); + // struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); public static native byte[] CommitmentSigned_get_signature(long this_ptr); - // void CommitmentSigned_set_signature(LDKCommitmentSigned *this_ptr, LDKSignature val); + // void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void CommitmentSigned_set_signature(long this_ptr, byte[] val); - // void CommitmentSigned_set_htlc_signatures(LDKCommitmentSigned *this_ptr, LDKCVec_SignatureZ val); + // void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val); public static native void CommitmentSigned_set_htlc_signatures(long this_ptr, byte[][] val); - // MUST_USE_RES LDKCommitmentSigned CommitmentSigned_new(LDKThirtyTwoBytes channel_id_arg, LDKSignature signature_arg, LDKCVec_SignatureZ htlc_signatures_arg); + // MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg); public static native long CommitmentSigned_new(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg); - // void RevokeAndACK_free(LDKRevokeAndACK this_ptr); + // void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr); public static native void RevokeAndACK_free(long this_ptr); - // LDKRevokeAndACK RevokeAndACK_clone(const LDKRevokeAndACK *orig); + // struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig); public static native long RevokeAndACK_clone(long orig); - // const uint8_t (*RevokeAndACK_get_channel_id(const LDKRevokeAndACK *this_ptr))[32]; + // const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; public static native byte[] RevokeAndACK_get_channel_id(long this_ptr); - // void RevokeAndACK_set_channel_id(LDKRevokeAndACK *this_ptr, LDKThirtyTwoBytes val); + // void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void RevokeAndACK_set_channel_id(long this_ptr, byte[] val); - // const uint8_t (*RevokeAndACK_get_per_commitment_secret(const LDKRevokeAndACK *this_ptr))[32]; + // const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; public static native byte[] RevokeAndACK_get_per_commitment_secret(long this_ptr); - // void RevokeAndACK_set_per_commitment_secret(LDKRevokeAndACK *this_ptr, LDKThirtyTwoBytes val); + // void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void RevokeAndACK_set_per_commitment_secret(long this_ptr, byte[] val); - // LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const LDKRevokeAndACK *this_ptr); + // struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr); public static native byte[] RevokeAndACK_get_next_per_commitment_point(long this_ptr); - // void RevokeAndACK_set_next_per_commitment_point(LDKRevokeAndACK *this_ptr, LDKPublicKey val); + // void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void RevokeAndACK_set_next_per_commitment_point(long this_ptr, byte[] val); - // MUST_USE_RES LDKRevokeAndACK RevokeAndACK_new(LDKThirtyTwoBytes channel_id_arg, LDKThirtyTwoBytes per_commitment_secret_arg, LDKPublicKey next_per_commitment_point_arg); + // MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg); public static native long RevokeAndACK_new(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg); - // void UpdateFee_free(LDKUpdateFee this_ptr); + // void UpdateFee_free(struct LDKUpdateFee this_ptr); public static native void UpdateFee_free(long this_ptr); - // LDKUpdateFee UpdateFee_clone(const LDKUpdateFee *orig); + // struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig); public static native long UpdateFee_clone(long orig); - // const uint8_t (*UpdateFee_get_channel_id(const LDKUpdateFee *this_ptr))[32]; + // const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32]; public static native byte[] UpdateFee_get_channel_id(long this_ptr); - // void UpdateFee_set_channel_id(LDKUpdateFee *this_ptr, LDKThirtyTwoBytes val); + // void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void UpdateFee_set_channel_id(long this_ptr, byte[] val); - // uint32_t UpdateFee_get_feerate_per_kw(const LDKUpdateFee *this_ptr); + // uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr); public static native int UpdateFee_get_feerate_per_kw(long this_ptr); - // void UpdateFee_set_feerate_per_kw(LDKUpdateFee *this_ptr, uint32_t val); + // void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val); public static native void UpdateFee_set_feerate_per_kw(long this_ptr, int val); - // MUST_USE_RES LDKUpdateFee UpdateFee_new(LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg); + // MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg); public static native long UpdateFee_new(byte[] channel_id_arg, int feerate_per_kw_arg); - // void DataLossProtect_free(LDKDataLossProtect this_ptr); + // void DataLossProtect_free(struct LDKDataLossProtect this_ptr); public static native void DataLossProtect_free(long this_ptr); - // LDKDataLossProtect DataLossProtect_clone(const LDKDataLossProtect *orig); + // struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig); public static native long DataLossProtect_clone(long orig); - // const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const LDKDataLossProtect *this_ptr))[32]; + // const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32]; public static native byte[] DataLossProtect_get_your_last_per_commitment_secret(long this_ptr); - // void DataLossProtect_set_your_last_per_commitment_secret(LDKDataLossProtect *this_ptr, LDKThirtyTwoBytes val); + // void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void DataLossProtect_set_your_last_per_commitment_secret(long this_ptr, byte[] val); - // LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const LDKDataLossProtect *this_ptr); + // struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr); public static native byte[] DataLossProtect_get_my_current_per_commitment_point(long this_ptr); - // void DataLossProtect_set_my_current_per_commitment_point(LDKDataLossProtect *this_ptr, LDKPublicKey val); + // void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void DataLossProtect_set_my_current_per_commitment_point(long this_ptr, byte[] val); - // MUST_USE_RES LDKDataLossProtect DataLossProtect_new(LDKThirtyTwoBytes your_last_per_commitment_secret_arg, LDKPublicKey my_current_per_commitment_point_arg); + // MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg); public static native long DataLossProtect_new(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg); - // void ChannelReestablish_free(LDKChannelReestablish this_ptr); + // void ChannelReestablish_free(struct LDKChannelReestablish this_ptr); public static native void ChannelReestablish_free(long this_ptr); - // LDKChannelReestablish ChannelReestablish_clone(const LDKChannelReestablish *orig); + // struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig); public static native long ChannelReestablish_clone(long orig); - // const uint8_t (*ChannelReestablish_get_channel_id(const LDKChannelReestablish *this_ptr))[32]; + // const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32]; public static native byte[] ChannelReestablish_get_channel_id(long this_ptr); - // void ChannelReestablish_set_channel_id(LDKChannelReestablish *this_ptr, LDKThirtyTwoBytes val); + // void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void ChannelReestablish_set_channel_id(long this_ptr, byte[] val); - // uint64_t ChannelReestablish_get_next_local_commitment_number(const LDKChannelReestablish *this_ptr); + // uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); public static native long ChannelReestablish_get_next_local_commitment_number(long this_ptr); - // void ChannelReestablish_set_next_local_commitment_number(LDKChannelReestablish *this_ptr, uint64_t val); + // void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelReestablish_set_next_local_commitment_number(long this_ptr, long val); - // uint64_t ChannelReestablish_get_next_remote_commitment_number(const LDKChannelReestablish *this_ptr); + // uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); public static native long ChannelReestablish_get_next_remote_commitment_number(long this_ptr); - // void ChannelReestablish_set_next_remote_commitment_number(LDKChannelReestablish *this_ptr, uint64_t val); + // void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelReestablish_set_next_remote_commitment_number(long this_ptr, long val); - // void AnnouncementSignatures_free(LDKAnnouncementSignatures this_ptr); + // void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr); public static native void AnnouncementSignatures_free(long this_ptr); - // LDKAnnouncementSignatures AnnouncementSignatures_clone(const LDKAnnouncementSignatures *orig); + // struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig); public static native long AnnouncementSignatures_clone(long orig); - // const uint8_t (*AnnouncementSignatures_get_channel_id(const LDKAnnouncementSignatures *this_ptr))[32]; + // const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32]; public static native byte[] AnnouncementSignatures_get_channel_id(long this_ptr); - // void AnnouncementSignatures_set_channel_id(LDKAnnouncementSignatures *this_ptr, LDKThirtyTwoBytes val); + // void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void AnnouncementSignatures_set_channel_id(long this_ptr, byte[] val); - // uint64_t AnnouncementSignatures_get_short_channel_id(const LDKAnnouncementSignatures *this_ptr); + // uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); public static native long AnnouncementSignatures_get_short_channel_id(long this_ptr); - // void AnnouncementSignatures_set_short_channel_id(LDKAnnouncementSignatures *this_ptr, uint64_t val); + // void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val); public static native void AnnouncementSignatures_set_short_channel_id(long this_ptr, long val); - // LDKSignature AnnouncementSignatures_get_node_signature(const LDKAnnouncementSignatures *this_ptr); + // struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); public static native byte[] AnnouncementSignatures_get_node_signature(long this_ptr); - // void AnnouncementSignatures_set_node_signature(LDKAnnouncementSignatures *this_ptr, LDKSignature val); + // void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void AnnouncementSignatures_set_node_signature(long this_ptr, byte[] val); - // LDKSignature AnnouncementSignatures_get_bitcoin_signature(const LDKAnnouncementSignatures *this_ptr); + // struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); public static native byte[] AnnouncementSignatures_get_bitcoin_signature(long this_ptr); - // void AnnouncementSignatures_set_bitcoin_signature(LDKAnnouncementSignatures *this_ptr, LDKSignature val); + // void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void AnnouncementSignatures_set_bitcoin_signature(long this_ptr, byte[] val); - // MUST_USE_RES LDKAnnouncementSignatures AnnouncementSignatures_new(LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, LDKSignature node_signature_arg, LDKSignature bitcoin_signature_arg); + // MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKSignature node_signature_arg, struct LDKSignature bitcoin_signature_arg); public static native long AnnouncementSignatures_new(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg); - // void NetAddress_free(LDKNetAddress this_ptr); + // void NetAddress_free(struct LDKNetAddress this_ptr); public static native void NetAddress_free(long this_ptr); - // LDKNetAddress NetAddress_clone(const LDKNetAddress *orig); + // struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig); public static native long NetAddress_clone(long orig); - // void UnsignedNodeAnnouncement_free(LDKUnsignedNodeAnnouncement this_ptr); + // struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj); + public static native byte[] NetAddress_write(long obj); + // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser); + public static native long Result_read(byte[] ser); + // void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_ptr); public static native void UnsignedNodeAnnouncement_free(long this_ptr); - // LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const LDKUnsignedNodeAnnouncement *orig); + // struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig); public static native long UnsignedNodeAnnouncement_clone(long orig); - // LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const LDKUnsignedNodeAnnouncement *this_ptr); + // struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); public static native long UnsignedNodeAnnouncement_get_features(long this_ptr); - // void UnsignedNodeAnnouncement_set_features(LDKUnsignedNodeAnnouncement *this_ptr, LDKNodeFeatures val); + // void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); public static native void UnsignedNodeAnnouncement_set_features(long this_ptr, long val); - // uint32_t UnsignedNodeAnnouncement_get_timestamp(const LDKUnsignedNodeAnnouncement *this_ptr); + // uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); public static native int UnsignedNodeAnnouncement_get_timestamp(long this_ptr); - // void UnsignedNodeAnnouncement_set_timestamp(LDKUnsignedNodeAnnouncement *this_ptr, uint32_t val); + // void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val); public static native void UnsignedNodeAnnouncement_set_timestamp(long this_ptr, int val); - // LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const LDKUnsignedNodeAnnouncement *this_ptr); + // struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); public static native byte[] UnsignedNodeAnnouncement_get_node_id(long this_ptr); - // void UnsignedNodeAnnouncement_set_node_id(LDKUnsignedNodeAnnouncement *this_ptr, LDKPublicKey val); + // void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void UnsignedNodeAnnouncement_set_node_id(long this_ptr, byte[] val); - // const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const LDKUnsignedNodeAnnouncement *this_ptr))[3]; + // const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3]; public static native byte[] UnsignedNodeAnnouncement_get_rgb(long this_ptr); - // void UnsignedNodeAnnouncement_set_rgb(LDKUnsignedNodeAnnouncement *this_ptr, LDKThreeBytes val); + // void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val); public static native void UnsignedNodeAnnouncement_set_rgb(long this_ptr, byte[] val); - // const uint8_t (*UnsignedNodeAnnouncement_get_alias(const LDKUnsignedNodeAnnouncement *this_ptr))[32]; + // const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32]; public static native byte[] UnsignedNodeAnnouncement_get_alias(long this_ptr); - // void UnsignedNodeAnnouncement_set_alias(LDKUnsignedNodeAnnouncement *this_ptr, LDKThirtyTwoBytes val); + // void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void UnsignedNodeAnnouncement_set_alias(long this_ptr, byte[] val); - // void UnsignedNodeAnnouncement_set_addresses(LDKUnsignedNodeAnnouncement *this_ptr, LDKCVec_NetAddressZ val); + // void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val); public static native void UnsignedNodeAnnouncement_set_addresses(long this_ptr, long[] val); - // void NodeAnnouncement_free(LDKNodeAnnouncement this_ptr); + // void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr); public static native void NodeAnnouncement_free(long this_ptr); - // LDKNodeAnnouncement NodeAnnouncement_clone(const LDKNodeAnnouncement *orig); + // struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig); public static native long NodeAnnouncement_clone(long orig); - // LDKSignature NodeAnnouncement_get_signature(const LDKNodeAnnouncement *this_ptr); + // struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr); public static native byte[] NodeAnnouncement_get_signature(long this_ptr); - // void NodeAnnouncement_set_signature(LDKNodeAnnouncement *this_ptr, LDKSignature val); + // void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void NodeAnnouncement_set_signature(long this_ptr, byte[] val); - // LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const LDKNodeAnnouncement *this_ptr); + // struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr); public static native long NodeAnnouncement_get_contents(long this_ptr); - // void NodeAnnouncement_set_contents(LDKNodeAnnouncement *this_ptr, LDKUnsignedNodeAnnouncement val); + // void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val); public static native void NodeAnnouncement_set_contents(long this_ptr, long val); - // MUST_USE_RES LDKNodeAnnouncement NodeAnnouncement_new(LDKSignature signature_arg, LDKUnsignedNodeAnnouncement contents_arg); + // MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg); public static native long NodeAnnouncement_new(byte[] signature_arg, long contents_arg); - // void UnsignedChannelAnnouncement_free(LDKUnsignedChannelAnnouncement this_ptr); + // void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr); public static native void UnsignedChannelAnnouncement_free(long this_ptr); - // LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const LDKUnsignedChannelAnnouncement *orig); + // struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig); public static native long UnsignedChannelAnnouncement_clone(long orig); - // LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const LDKUnsignedChannelAnnouncement *this_ptr); + // struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); public static native long UnsignedChannelAnnouncement_get_features(long this_ptr); - // void UnsignedChannelAnnouncement_set_features(LDKUnsignedChannelAnnouncement *this_ptr, LDKChannelFeatures val); + // void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); public static native void UnsignedChannelAnnouncement_set_features(long this_ptr, long val); - // const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const LDKUnsignedChannelAnnouncement *this_ptr))[32]; + // const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32]; public static native byte[] UnsignedChannelAnnouncement_get_chain_hash(long this_ptr); - // void UnsignedChannelAnnouncement_set_chain_hash(LDKUnsignedChannelAnnouncement *this_ptr, LDKThirtyTwoBytes val); + // void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void UnsignedChannelAnnouncement_set_chain_hash(long this_ptr, byte[] val); - // uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const LDKUnsignedChannelAnnouncement *this_ptr); + // uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); public static native long UnsignedChannelAnnouncement_get_short_channel_id(long this_ptr); - // void UnsignedChannelAnnouncement_set_short_channel_id(LDKUnsignedChannelAnnouncement *this_ptr, uint64_t val); + // void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val); public static native void UnsignedChannelAnnouncement_set_short_channel_id(long this_ptr, long val); - // LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const LDKUnsignedChannelAnnouncement *this_ptr); + // struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); public static native byte[] UnsignedChannelAnnouncement_get_node_id_1(long this_ptr); - // void UnsignedChannelAnnouncement_set_node_id_1(LDKUnsignedChannelAnnouncement *this_ptr, LDKPublicKey val); + // void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void UnsignedChannelAnnouncement_set_node_id_1(long this_ptr, byte[] val); - // LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const LDKUnsignedChannelAnnouncement *this_ptr); + // struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); public static native byte[] UnsignedChannelAnnouncement_get_node_id_2(long this_ptr); - // void UnsignedChannelAnnouncement_set_node_id_2(LDKUnsignedChannelAnnouncement *this_ptr, LDKPublicKey val); + // void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void UnsignedChannelAnnouncement_set_node_id_2(long this_ptr, byte[] val); - // LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const LDKUnsignedChannelAnnouncement *this_ptr); + // struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); public static native byte[] UnsignedChannelAnnouncement_get_bitcoin_key_1(long this_ptr); - // void UnsignedChannelAnnouncement_set_bitcoin_key_1(LDKUnsignedChannelAnnouncement *this_ptr, LDKPublicKey val); + // void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void UnsignedChannelAnnouncement_set_bitcoin_key_1(long this_ptr, byte[] val); - // LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const LDKUnsignedChannelAnnouncement *this_ptr); + // struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); public static native byte[] UnsignedChannelAnnouncement_get_bitcoin_key_2(long this_ptr); - // void UnsignedChannelAnnouncement_set_bitcoin_key_2(LDKUnsignedChannelAnnouncement *this_ptr, LDKPublicKey val); + // void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void UnsignedChannelAnnouncement_set_bitcoin_key_2(long this_ptr, byte[] val); - // void ChannelAnnouncement_free(LDKChannelAnnouncement this_ptr); + // void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr); public static native void ChannelAnnouncement_free(long this_ptr); - // LDKChannelAnnouncement ChannelAnnouncement_clone(const LDKChannelAnnouncement *orig); + // struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig); public static native long ChannelAnnouncement_clone(long orig); - // LDKSignature ChannelAnnouncement_get_node_signature_1(const LDKChannelAnnouncement *this_ptr); + // struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); public static native byte[] ChannelAnnouncement_get_node_signature_1(long this_ptr); - // void ChannelAnnouncement_set_node_signature_1(LDKChannelAnnouncement *this_ptr, LDKSignature val); + // void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void ChannelAnnouncement_set_node_signature_1(long this_ptr, byte[] val); - // LDKSignature ChannelAnnouncement_get_node_signature_2(const LDKChannelAnnouncement *this_ptr); + // struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); public static native byte[] ChannelAnnouncement_get_node_signature_2(long this_ptr); - // void ChannelAnnouncement_set_node_signature_2(LDKChannelAnnouncement *this_ptr, LDKSignature val); + // void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void ChannelAnnouncement_set_node_signature_2(long this_ptr, byte[] val); - // LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const LDKChannelAnnouncement *this_ptr); + // struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); public static native byte[] ChannelAnnouncement_get_bitcoin_signature_1(long this_ptr); - // void ChannelAnnouncement_set_bitcoin_signature_1(LDKChannelAnnouncement *this_ptr, LDKSignature val); + // void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void ChannelAnnouncement_set_bitcoin_signature_1(long this_ptr, byte[] val); - // LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const LDKChannelAnnouncement *this_ptr); + // struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); public static native byte[] ChannelAnnouncement_get_bitcoin_signature_2(long this_ptr); - // void ChannelAnnouncement_set_bitcoin_signature_2(LDKChannelAnnouncement *this_ptr, LDKSignature val); + // void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void ChannelAnnouncement_set_bitcoin_signature_2(long this_ptr, byte[] val); - // LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const LDKChannelAnnouncement *this_ptr); + // struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); public static native long ChannelAnnouncement_get_contents(long this_ptr); - // void ChannelAnnouncement_set_contents(LDKChannelAnnouncement *this_ptr, LDKUnsignedChannelAnnouncement val); + // void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val); public static native void ChannelAnnouncement_set_contents(long this_ptr, long val); - // MUST_USE_RES LDKChannelAnnouncement ChannelAnnouncement_new(LDKSignature node_signature_1_arg, LDKSignature node_signature_2_arg, LDKSignature bitcoin_signature_1_arg, LDKSignature bitcoin_signature_2_arg, LDKUnsignedChannelAnnouncement contents_arg); + // MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKSignature node_signature_1_arg, struct LDKSignature node_signature_2_arg, struct LDKSignature bitcoin_signature_1_arg, struct LDKSignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg); public static native long ChannelAnnouncement_new(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, long contents_arg); - // void UnsignedChannelUpdate_free(LDKUnsignedChannelUpdate this_ptr); + // void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr); public static native void UnsignedChannelUpdate_free(long this_ptr); - // LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const LDKUnsignedChannelUpdate *orig); + // struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); public static native long UnsignedChannelUpdate_clone(long orig); - // const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const LDKUnsignedChannelUpdate *this_ptr))[32]; + // const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32]; public static native byte[] UnsignedChannelUpdate_get_chain_hash(long this_ptr); - // void UnsignedChannelUpdate_set_chain_hash(LDKUnsignedChannelUpdate *this_ptr, LDKThirtyTwoBytes val); + // void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void UnsignedChannelUpdate_set_chain_hash(long this_ptr, byte[] val); - // uint64_t UnsignedChannelUpdate_get_short_channel_id(const LDKUnsignedChannelUpdate *this_ptr); + // uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); public static native long UnsignedChannelUpdate_get_short_channel_id(long this_ptr); - // void UnsignedChannelUpdate_set_short_channel_id(LDKUnsignedChannelUpdate *this_ptr, uint64_t val); + // void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val); public static native void UnsignedChannelUpdate_set_short_channel_id(long this_ptr, long val); - // uint32_t UnsignedChannelUpdate_get_timestamp(const LDKUnsignedChannelUpdate *this_ptr); + // uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); public static native int UnsignedChannelUpdate_get_timestamp(long this_ptr); - // void UnsignedChannelUpdate_set_timestamp(LDKUnsignedChannelUpdate *this_ptr, uint32_t val); + // void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); public static native void UnsignedChannelUpdate_set_timestamp(long this_ptr, int val); - // uint8_t UnsignedChannelUpdate_get_flags(const LDKUnsignedChannelUpdate *this_ptr); + // uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); public static native byte UnsignedChannelUpdate_get_flags(long this_ptr); - // void UnsignedChannelUpdate_set_flags(LDKUnsignedChannelUpdate *this_ptr, uint8_t val); + // void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val); public static native void UnsignedChannelUpdate_set_flags(long this_ptr, byte val); - // uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const LDKUnsignedChannelUpdate *this_ptr); + // uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); public static native short UnsignedChannelUpdate_get_cltv_expiry_delta(long this_ptr); - // void UnsignedChannelUpdate_set_cltv_expiry_delta(LDKUnsignedChannelUpdate *this_ptr, uint16_t val); + // void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val); public static native void UnsignedChannelUpdate_set_cltv_expiry_delta(long this_ptr, short val); - // uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const LDKUnsignedChannelUpdate *this_ptr); + // uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); public static native long UnsignedChannelUpdate_get_htlc_minimum_msat(long this_ptr); - // void UnsignedChannelUpdate_set_htlc_minimum_msat(LDKUnsignedChannelUpdate *this_ptr, uint64_t val); + // void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val); public static native void UnsignedChannelUpdate_set_htlc_minimum_msat(long this_ptr, long val); - // uint32_t UnsignedChannelUpdate_get_fee_base_msat(const LDKUnsignedChannelUpdate *this_ptr); + // uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); public static native int UnsignedChannelUpdate_get_fee_base_msat(long this_ptr); - // void UnsignedChannelUpdate_set_fee_base_msat(LDKUnsignedChannelUpdate *this_ptr, uint32_t val); + // void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); public static native void UnsignedChannelUpdate_set_fee_base_msat(long this_ptr, int val); - // uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const LDKUnsignedChannelUpdate *this_ptr); + // uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); public static native int UnsignedChannelUpdate_get_fee_proportional_millionths(long this_ptr); - // void UnsignedChannelUpdate_set_fee_proportional_millionths(LDKUnsignedChannelUpdate *this_ptr, uint32_t val); + // void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); public static native void UnsignedChannelUpdate_set_fee_proportional_millionths(long this_ptr, int val); - // void ChannelUpdate_free(LDKChannelUpdate this_ptr); + // void ChannelUpdate_free(struct LDKChannelUpdate this_ptr); public static native void ChannelUpdate_free(long this_ptr); - // LDKChannelUpdate ChannelUpdate_clone(const LDKChannelUpdate *orig); + // struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig); public static native long ChannelUpdate_clone(long orig); - // LDKSignature ChannelUpdate_get_signature(const LDKChannelUpdate *this_ptr); + // struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr); public static native byte[] ChannelUpdate_get_signature(long this_ptr); - // void ChannelUpdate_set_signature(LDKChannelUpdate *this_ptr, LDKSignature val); + // void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void ChannelUpdate_set_signature(long this_ptr, byte[] val); - // LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const LDKChannelUpdate *this_ptr); + // struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr); public static native long ChannelUpdate_get_contents(long this_ptr); - // void ChannelUpdate_set_contents(LDKChannelUpdate *this_ptr, LDKUnsignedChannelUpdate val); + // void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val); public static native void ChannelUpdate_set_contents(long this_ptr, long val); - // MUST_USE_RES LDKChannelUpdate ChannelUpdate_new(LDKSignature signature_arg, LDKUnsignedChannelUpdate contents_arg); + // MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg); public static native long ChannelUpdate_new(byte[] signature_arg, long contents_arg); - // void QueryChannelRange_free(LDKQueryChannelRange this_ptr); + // void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr); public static native void QueryChannelRange_free(long this_ptr); - // LDKQueryChannelRange QueryChannelRange_clone(const LDKQueryChannelRange *orig); + // struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig); public static native long QueryChannelRange_clone(long orig); - // const uint8_t (*QueryChannelRange_get_chain_hash(const LDKQueryChannelRange *this_ptr))[32]; + // const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32]; public static native byte[] QueryChannelRange_get_chain_hash(long this_ptr); - // void QueryChannelRange_set_chain_hash(LDKQueryChannelRange *this_ptr, LDKThirtyTwoBytes val); + // void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void QueryChannelRange_set_chain_hash(long this_ptr, byte[] val); - // uint32_t QueryChannelRange_get_first_blocknum(const LDKQueryChannelRange *this_ptr); + // uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr); public static native int QueryChannelRange_get_first_blocknum(long this_ptr); - // void QueryChannelRange_set_first_blocknum(LDKQueryChannelRange *this_ptr, uint32_t val); + // void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val); public static native void QueryChannelRange_set_first_blocknum(long this_ptr, int val); - // uint32_t QueryChannelRange_get_number_of_blocks(const LDKQueryChannelRange *this_ptr); + // uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr); public static native int QueryChannelRange_get_number_of_blocks(long this_ptr); - // void QueryChannelRange_set_number_of_blocks(LDKQueryChannelRange *this_ptr, uint32_t val); + // void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val); public static native void QueryChannelRange_set_number_of_blocks(long this_ptr, int val); - // MUST_USE_RES LDKQueryChannelRange QueryChannelRange_new(LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg); + // MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg); public static native long QueryChannelRange_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg); - // void ReplyChannelRange_free(LDKReplyChannelRange this_ptr); + // void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr); public static native void ReplyChannelRange_free(long this_ptr); - // LDKReplyChannelRange ReplyChannelRange_clone(const LDKReplyChannelRange *orig); + // struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig); public static native long ReplyChannelRange_clone(long orig); - // const uint8_t (*ReplyChannelRange_get_chain_hash(const LDKReplyChannelRange *this_ptr))[32]; + // const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32]; public static native byte[] ReplyChannelRange_get_chain_hash(long this_ptr); - // void ReplyChannelRange_set_chain_hash(LDKReplyChannelRange *this_ptr, LDKThirtyTwoBytes val); + // void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void ReplyChannelRange_set_chain_hash(long this_ptr, byte[] val); - // uint32_t ReplyChannelRange_get_first_blocknum(const LDKReplyChannelRange *this_ptr); + // uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); public static native int ReplyChannelRange_get_first_blocknum(long this_ptr); - // void ReplyChannelRange_set_first_blocknum(LDKReplyChannelRange *this_ptr, uint32_t val); + // void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val); public static native void ReplyChannelRange_set_first_blocknum(long this_ptr, int val); - // uint32_t ReplyChannelRange_get_number_of_blocks(const LDKReplyChannelRange *this_ptr); + // uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); public static native int ReplyChannelRange_get_number_of_blocks(long this_ptr); - // void ReplyChannelRange_set_number_of_blocks(LDKReplyChannelRange *this_ptr, uint32_t val); + // void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val); public static native void ReplyChannelRange_set_number_of_blocks(long this_ptr, int val); - // bool ReplyChannelRange_get_full_information(const LDKReplyChannelRange *this_ptr); + // bool ReplyChannelRange_get_full_information(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); public static native boolean ReplyChannelRange_get_full_information(long this_ptr); - // void ReplyChannelRange_set_full_information(LDKReplyChannelRange *this_ptr, bool val); + // void ReplyChannelRange_set_full_information(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val); public static native void ReplyChannelRange_set_full_information(long this_ptr, boolean val); - // void ReplyChannelRange_set_short_channel_ids(LDKReplyChannelRange *this_ptr, LDKCVec_u64Z val); + // void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); public static native void ReplyChannelRange_set_short_channel_ids(long this_ptr, long[] val); - // MUST_USE_RES LDKReplyChannelRange ReplyChannelRange_new(LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool full_information_arg, LDKCVec_u64Z short_channel_ids_arg); + // MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool full_information_arg, struct LDKCVec_u64Z short_channel_ids_arg); public static native long ReplyChannelRange_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean full_information_arg, long[] short_channel_ids_arg); - // void QueryShortChannelIds_free(LDKQueryShortChannelIds this_ptr); + // void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr); public static native void QueryShortChannelIds_free(long this_ptr); - // LDKQueryShortChannelIds QueryShortChannelIds_clone(const LDKQueryShortChannelIds *orig); + // struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig); public static native long QueryShortChannelIds_clone(long orig); - // const uint8_t (*QueryShortChannelIds_get_chain_hash(const LDKQueryShortChannelIds *this_ptr))[32]; + // const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32]; public static native byte[] QueryShortChannelIds_get_chain_hash(long this_ptr); - // void QueryShortChannelIds_set_chain_hash(LDKQueryShortChannelIds *this_ptr, LDKThirtyTwoBytes val); + // void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void QueryShortChannelIds_set_chain_hash(long this_ptr, byte[] val); - // void QueryShortChannelIds_set_short_channel_ids(LDKQueryShortChannelIds *this_ptr, LDKCVec_u64Z val); + // void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); public static native void QueryShortChannelIds_set_short_channel_ids(long this_ptr, long[] val); - // MUST_USE_RES LDKQueryShortChannelIds QueryShortChannelIds_new(LDKThirtyTwoBytes chain_hash_arg, LDKCVec_u64Z short_channel_ids_arg); + // MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg); public static native long QueryShortChannelIds_new(byte[] chain_hash_arg, long[] short_channel_ids_arg); - // void ReplyShortChannelIdsEnd_free(LDKReplyShortChannelIdsEnd this_ptr); + // void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr); public static native void ReplyShortChannelIdsEnd_free(long this_ptr); - // LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const LDKReplyShortChannelIdsEnd *orig); + // struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig); public static native long ReplyShortChannelIdsEnd_clone(long orig); - // const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const LDKReplyShortChannelIdsEnd *this_ptr))[32]; + // const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32]; public static native byte[] ReplyShortChannelIdsEnd_get_chain_hash(long this_ptr); - // void ReplyShortChannelIdsEnd_set_chain_hash(LDKReplyShortChannelIdsEnd *this_ptr, LDKThirtyTwoBytes val); + // void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void ReplyShortChannelIdsEnd_set_chain_hash(long this_ptr, byte[] val); - // bool ReplyShortChannelIdsEnd_get_full_information(const LDKReplyShortChannelIdsEnd *this_ptr); + // bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr); public static native boolean ReplyShortChannelIdsEnd_get_full_information(long this_ptr); - // void ReplyShortChannelIdsEnd_set_full_information(LDKReplyShortChannelIdsEnd *this_ptr, bool val); + // void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val); public static native void ReplyShortChannelIdsEnd_set_full_information(long this_ptr, boolean val); - // MUST_USE_RES LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg); + // MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg); public static native long ReplyShortChannelIdsEnd_new(byte[] chain_hash_arg, boolean full_information_arg); - // void GossipTimestampFilter_free(LDKGossipTimestampFilter this_ptr); + // void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr); public static native void GossipTimestampFilter_free(long this_ptr); - // LDKGossipTimestampFilter GossipTimestampFilter_clone(const LDKGossipTimestampFilter *orig); + // struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig); public static native long GossipTimestampFilter_clone(long orig); - // const uint8_t (*GossipTimestampFilter_get_chain_hash(const LDKGossipTimestampFilter *this_ptr))[32]; + // const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32]; public static native byte[] GossipTimestampFilter_get_chain_hash(long this_ptr); - // void GossipTimestampFilter_set_chain_hash(LDKGossipTimestampFilter *this_ptr, LDKThirtyTwoBytes val); + // void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void GossipTimestampFilter_set_chain_hash(long this_ptr, byte[] val); - // uint32_t GossipTimestampFilter_get_first_timestamp(const LDKGossipTimestampFilter *this_ptr); + // uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr); public static native int GossipTimestampFilter_get_first_timestamp(long this_ptr); - // void GossipTimestampFilter_set_first_timestamp(LDKGossipTimestampFilter *this_ptr, uint32_t val); + // void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val); public static native void GossipTimestampFilter_set_first_timestamp(long this_ptr, int val); - // uint32_t GossipTimestampFilter_get_timestamp_range(const LDKGossipTimestampFilter *this_ptr); + // uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr); public static native int GossipTimestampFilter_get_timestamp_range(long this_ptr); - // void GossipTimestampFilter_set_timestamp_range(LDKGossipTimestampFilter *this_ptr, uint32_t val); + // void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val); public static native void GossipTimestampFilter_set_timestamp_range(long this_ptr, int val); - // MUST_USE_RES LDKGossipTimestampFilter GossipTimestampFilter_new(LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg); + // MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg); public static native long GossipTimestampFilter_new(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg); - // void ErrorAction_free(LDKErrorAction this_ptr); + // void ErrorAction_free(struct LDKErrorAction this_ptr); public static native void ErrorAction_free(long this_ptr); - // LDKErrorAction ErrorAction_clone(const LDKErrorAction *orig); + // struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig); public static native long ErrorAction_clone(long orig); - // void LightningError_free(LDKLightningError this_ptr); + // void LightningError_free(struct LDKLightningError this_ptr); public static native void LightningError_free(long this_ptr); - // LDKStr LightningError_get_err(const LDKLightningError *this_ptr); + // struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr); public static native String LightningError_get_err(long this_ptr); - // void LightningError_set_err(LDKLightningError *this_ptr, LDKCVec_u8Z val); + // void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); public static native void LightningError_set_err(long this_ptr, byte[] val); - // LDKErrorAction LightningError_get_action(const LDKLightningError *this_ptr); + // struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr); public static native long LightningError_get_action(long this_ptr); - // void LightningError_set_action(LDKLightningError *this_ptr, LDKErrorAction val); + // void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val); public static native void LightningError_set_action(long this_ptr, long val); - // MUST_USE_RES LDKLightningError LightningError_new(LDKCVec_u8Z err_arg, LDKErrorAction action_arg); + // MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg); public static native long LightningError_new(byte[] err_arg, long action_arg); - // void CommitmentUpdate_free(LDKCommitmentUpdate this_ptr); + // void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr); public static native void CommitmentUpdate_free(long this_ptr); - // LDKCommitmentUpdate CommitmentUpdate_clone(const LDKCommitmentUpdate *orig); + // struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig); public static native long CommitmentUpdate_clone(long orig); - // void CommitmentUpdate_set_update_add_htlcs(LDKCommitmentUpdate *this_ptr, LDKCVec_UpdateAddHTLCZ val); + // void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val); public static native void CommitmentUpdate_set_update_add_htlcs(long this_ptr, long[] val); - // void CommitmentUpdate_set_update_fulfill_htlcs(LDKCommitmentUpdate *this_ptr, LDKCVec_UpdateFulfillHTLCZ val); + // void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val); public static native void CommitmentUpdate_set_update_fulfill_htlcs(long this_ptr, long[] val); - // void CommitmentUpdate_set_update_fail_htlcs(LDKCommitmentUpdate *this_ptr, LDKCVec_UpdateFailHTLCZ val); + // void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val); public static native void CommitmentUpdate_set_update_fail_htlcs(long this_ptr, long[] val); - // void CommitmentUpdate_set_update_fail_malformed_htlcs(LDKCommitmentUpdate *this_ptr, LDKCVec_UpdateFailMalformedHTLCZ val); + // void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val); public static native void CommitmentUpdate_set_update_fail_malformed_htlcs(long this_ptr, long[] val); - // LDKUpdateFee CommitmentUpdate_get_update_fee(const LDKCommitmentUpdate *this_ptr); + // struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); public static native long CommitmentUpdate_get_update_fee(long this_ptr); - // void CommitmentUpdate_set_update_fee(LDKCommitmentUpdate *this_ptr, LDKUpdateFee val); + // void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val); public static native void CommitmentUpdate_set_update_fee(long this_ptr, long val); - // LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const LDKCommitmentUpdate *this_ptr); + // struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); public static native long CommitmentUpdate_get_commitment_signed(long this_ptr); - // void CommitmentUpdate_set_commitment_signed(LDKCommitmentUpdate *this_ptr, LDKCommitmentSigned val); + // void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val); public static native void CommitmentUpdate_set_commitment_signed(long this_ptr, long val); - // MUST_USE_RES LDKCommitmentUpdate CommitmentUpdate_new(LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, LDKUpdateFee update_fee_arg, LDKCommitmentSigned commitment_signed_arg); + // MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg); public static native long CommitmentUpdate_new(long[] update_add_htlcs_arg, long[] update_fulfill_htlcs_arg, long[] update_fail_htlcs_arg, long[] update_fail_malformed_htlcs_arg, long update_fee_arg, long commitment_signed_arg); - // void HTLCFailChannelUpdate_free(LDKHTLCFailChannelUpdate this_ptr); + // void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr); public static native void HTLCFailChannelUpdate_free(long this_ptr); - // LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const LDKHTLCFailChannelUpdate *orig); + // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig); public static native long HTLCFailChannelUpdate_clone(long orig); - // void ChannelMessageHandler_free(LDKChannelMessageHandler this_ptr); + // void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr); public static native void ChannelMessageHandler_free(long this_ptr); - // void RoutingMessageHandler_free(LDKRoutingMessageHandler this_ptr); + // void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr); public static native void RoutingMessageHandler_free(long this_ptr); - // LDKCVec_u8Z AcceptChannel_write(const LDKAcceptChannel *obj); + // struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj); public static native byte[] AcceptChannel_write(long obj); - // LDKAcceptChannel AcceptChannel_read(LDKu8slice ser); + // struct LDKAcceptChannel AcceptChannel_read(struct LDKu8slice ser); public static native long AcceptChannel_read(byte[] ser); - // LDKCVec_u8Z AnnouncementSignatures_write(const LDKAnnouncementSignatures *obj); + // struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj); public static native byte[] AnnouncementSignatures_write(long obj); - // LDKAnnouncementSignatures AnnouncementSignatures_read(LDKu8slice ser); + // struct LDKAnnouncementSignatures AnnouncementSignatures_read(struct LDKu8slice ser); public static native long AnnouncementSignatures_read(byte[] ser); - // LDKCVec_u8Z ChannelReestablish_write(const LDKChannelReestablish *this_ptr); - public static native byte[] ChannelReestablish_write(long this_ptr); - // LDKChannelReestablish ChannelReestablish_read(LDKu8slice ser); + // struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj); + public static native byte[] ChannelReestablish_write(long obj); + // struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser); public static native long ChannelReestablish_read(byte[] ser); - // LDKCVec_u8Z ClosingSigned_write(const LDKClosingSigned *obj); + // struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj); public static native byte[] ClosingSigned_write(long obj); - // LDKClosingSigned ClosingSigned_read(LDKu8slice ser); + // struct LDKClosingSigned ClosingSigned_read(struct LDKu8slice ser); public static native long ClosingSigned_read(byte[] ser); - // LDKCVec_u8Z CommitmentSigned_write(const LDKCommitmentSigned *obj); + // struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj); public static native byte[] CommitmentSigned_write(long obj); - // LDKCommitmentSigned CommitmentSigned_read(LDKu8slice ser); + // struct LDKCommitmentSigned CommitmentSigned_read(struct LDKu8slice ser); public static native long CommitmentSigned_read(byte[] ser); - // LDKCVec_u8Z FundingCreated_write(const LDKFundingCreated *obj); + // struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj); public static native byte[] FundingCreated_write(long obj); - // LDKFundingCreated FundingCreated_read(LDKu8slice ser); + // struct LDKFundingCreated FundingCreated_read(struct LDKu8slice ser); public static native long FundingCreated_read(byte[] ser); - // LDKCVec_u8Z FundingSigned_write(const LDKFundingSigned *obj); + // struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj); public static native byte[] FundingSigned_write(long obj); - // LDKFundingSigned FundingSigned_read(LDKu8slice ser); + // struct LDKFundingSigned FundingSigned_read(struct LDKu8slice ser); public static native long FundingSigned_read(byte[] ser); - // LDKCVec_u8Z FundingLocked_write(const LDKFundingLocked *obj); + // struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj); public static native byte[] FundingLocked_write(long obj); - // LDKFundingLocked FundingLocked_read(LDKu8slice ser); + // struct LDKFundingLocked FundingLocked_read(struct LDKu8slice ser); public static native long FundingLocked_read(byte[] ser); - // LDKCVec_u8Z Init_write(const LDKInit *this_ptr); - public static native byte[] Init_write(long this_ptr); - // LDKInit Init_read(LDKu8slice ser); + // struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj); + public static native byte[] Init_write(long obj); + // struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser); public static native long Init_read(byte[] ser); - // LDKCVec_u8Z OpenChannel_write(const LDKOpenChannel *obj); + // struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj); public static native byte[] OpenChannel_write(long obj); - // LDKOpenChannel OpenChannel_read(LDKu8slice ser); + // struct LDKOpenChannel OpenChannel_read(struct LDKu8slice ser); public static native long OpenChannel_read(byte[] ser); - // LDKCVec_u8Z RevokeAndACK_write(const LDKRevokeAndACK *obj); + // struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj); public static native byte[] RevokeAndACK_write(long obj); - // LDKRevokeAndACK RevokeAndACK_read(LDKu8slice ser); + // struct LDKRevokeAndACK RevokeAndACK_read(struct LDKu8slice ser); public static native long RevokeAndACK_read(byte[] ser); - // LDKCVec_u8Z Shutdown_write(const LDKShutdown *obj); + // struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj); public static native byte[] Shutdown_write(long obj); - // LDKShutdown Shutdown_read(LDKu8slice ser); + // struct LDKShutdown Shutdown_read(struct LDKu8slice ser); public static native long Shutdown_read(byte[] ser); - // LDKCVec_u8Z UpdateFailHTLC_write(const LDKUpdateFailHTLC *obj); + // struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj); public static native byte[] UpdateFailHTLC_write(long obj); - // LDKUpdateFailHTLC UpdateFailHTLC_read(LDKu8slice ser); + // struct LDKUpdateFailHTLC UpdateFailHTLC_read(struct LDKu8slice ser); public static native long UpdateFailHTLC_read(byte[] ser); - // LDKCVec_u8Z UpdateFailMalformedHTLC_write(const LDKUpdateFailMalformedHTLC *obj); + // struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj); public static native byte[] UpdateFailMalformedHTLC_write(long obj); - // LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_read(LDKu8slice ser); + // struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_read(struct LDKu8slice ser); public static native long UpdateFailMalformedHTLC_read(byte[] ser); - // LDKCVec_u8Z UpdateFee_write(const LDKUpdateFee *obj); + // struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj); public static native byte[] UpdateFee_write(long obj); - // LDKUpdateFee UpdateFee_read(LDKu8slice ser); + // struct LDKUpdateFee UpdateFee_read(struct LDKu8slice ser); public static native long UpdateFee_read(byte[] ser); - // LDKCVec_u8Z UpdateFulfillHTLC_write(const LDKUpdateFulfillHTLC *obj); + // struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj); public static native byte[] UpdateFulfillHTLC_write(long obj); - // LDKUpdateFulfillHTLC UpdateFulfillHTLC_read(LDKu8slice ser); + // struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_read(struct LDKu8slice ser); public static native long UpdateFulfillHTLC_read(byte[] ser); - // LDKCVec_u8Z UpdateAddHTLC_write(const LDKUpdateAddHTLC *obj); + // struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj); public static native byte[] UpdateAddHTLC_write(long obj); - // LDKUpdateAddHTLC UpdateAddHTLC_read(LDKu8slice ser); + // struct LDKUpdateAddHTLC UpdateAddHTLC_read(struct LDKu8slice ser); public static native long UpdateAddHTLC_read(byte[] ser); - // LDKCVec_u8Z Ping_write(const LDKPing *this_ptr); - public static native byte[] Ping_write(long this_ptr); - // LDKPing Ping_read(LDKu8slice ser); + // struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj); + public static native byte[] Ping_write(long obj); + // struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser); public static native long Ping_read(byte[] ser); - // LDKCVec_u8Z Pong_write(const LDKPong *this_ptr); - public static native byte[] Pong_write(long this_ptr); - // LDKPong Pong_read(LDKu8slice ser); + // struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj); + public static native byte[] Pong_write(long obj); + // struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser); public static native long Pong_read(byte[] ser); - // LDKCVec_u8Z UnsignedChannelAnnouncement_write(const LDKUnsignedChannelAnnouncement *this_ptr); - public static native byte[] UnsignedChannelAnnouncement_write(long this_ptr); - // LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_read(LDKu8slice ser); + // struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj); + public static native byte[] UnsignedChannelAnnouncement_write(long obj); + // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser); public static native long UnsignedChannelAnnouncement_read(byte[] ser); - // LDKCVec_u8Z ChannelAnnouncement_write(const LDKChannelAnnouncement *obj); + // struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj); public static native byte[] ChannelAnnouncement_write(long obj); - // LDKChannelAnnouncement ChannelAnnouncement_read(LDKu8slice ser); + // struct LDKChannelAnnouncement ChannelAnnouncement_read(struct LDKu8slice ser); public static native long ChannelAnnouncement_read(byte[] ser); - // LDKCVec_u8Z UnsignedChannelUpdate_write(const LDKUnsignedChannelUpdate *this_ptr); - public static native byte[] UnsignedChannelUpdate_write(long this_ptr); - // LDKUnsignedChannelUpdate UnsignedChannelUpdate_read(LDKu8slice ser); + // struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj); + public static native byte[] UnsignedChannelUpdate_write(long obj); + // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser); public static native long UnsignedChannelUpdate_read(byte[] ser); - // LDKCVec_u8Z ChannelUpdate_write(const LDKChannelUpdate *obj); + // struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj); public static native byte[] ChannelUpdate_write(long obj); - // LDKChannelUpdate ChannelUpdate_read(LDKu8slice ser); + // struct LDKChannelUpdate ChannelUpdate_read(struct LDKu8slice ser); public static native long ChannelUpdate_read(byte[] ser); - // LDKCVec_u8Z ErrorMessage_write(const LDKErrorMessage *this_ptr); - public static native byte[] ErrorMessage_write(long this_ptr); - // LDKErrorMessage ErrorMessage_read(LDKu8slice ser); + // struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj); + public static native byte[] ErrorMessage_write(long obj); + // struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser); public static native long ErrorMessage_read(byte[] ser); - // LDKCVec_u8Z UnsignedNodeAnnouncement_write(const LDKUnsignedNodeAnnouncement *this_ptr); - public static native byte[] UnsignedNodeAnnouncement_write(long this_ptr); - // LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_read(LDKu8slice ser); + // struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj); + public static native byte[] UnsignedNodeAnnouncement_write(long obj); + // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser); public static native long UnsignedNodeAnnouncement_read(byte[] ser); - // LDKCVec_u8Z NodeAnnouncement_write(const LDKNodeAnnouncement *obj); + // struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj); public static native byte[] NodeAnnouncement_write(long obj); - // LDKNodeAnnouncement NodeAnnouncement_read(LDKu8slice ser); + // struct LDKNodeAnnouncement NodeAnnouncement_read(struct LDKu8slice ser); public static native long NodeAnnouncement_read(byte[] ser); - // LDKQueryShortChannelIds QueryShortChannelIds_read(LDKu8slice ser); + // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser); public static native long QueryShortChannelIds_read(byte[] ser); - // LDKCVec_u8Z QueryShortChannelIds_write(const LDKQueryShortChannelIds *this_ptr); - public static native byte[] QueryShortChannelIds_write(long this_ptr); - // LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_read(LDKu8slice ser); + // struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj); + public static native byte[] QueryShortChannelIds_write(long obj); + // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser); public static native long ReplyShortChannelIdsEnd_read(byte[] ser); - // LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const LDKReplyShortChannelIdsEnd *this_ptr); - public static native byte[] ReplyShortChannelIdsEnd_write(long this_ptr); - // LDKQueryChannelRange QueryChannelRange_read(LDKu8slice ser); + // struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj); + public static native byte[] ReplyShortChannelIdsEnd_write(long obj); + // struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser); public static native long QueryChannelRange_read(byte[] ser); - // LDKCVec_u8Z QueryChannelRange_write(const LDKQueryChannelRange *this_ptr); - public static native byte[] QueryChannelRange_write(long this_ptr); - // LDKReplyChannelRange ReplyChannelRange_read(LDKu8slice ser); + // struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj); + public static native byte[] QueryChannelRange_write(long obj); + // struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser); public static native long ReplyChannelRange_read(byte[] ser); - // LDKCVec_u8Z ReplyChannelRange_write(const LDKReplyChannelRange *this_ptr); - public static native byte[] ReplyChannelRange_write(long this_ptr); - // LDKGossipTimestampFilter GossipTimestampFilter_read(LDKu8slice ser); + // struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj); + public static native byte[] ReplyChannelRange_write(long obj); + // struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser); public static native long GossipTimestampFilter_read(byte[] ser); - // LDKCVec_u8Z GossipTimestampFilter_write(const LDKGossipTimestampFilter *this_ptr); - public static native byte[] GossipTimestampFilter_write(long this_ptr); - // void MessageHandler_free(LDKMessageHandler this_ptr); + // struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj); + public static native byte[] GossipTimestampFilter_write(long obj); + // void MessageHandler_free(struct LDKMessageHandler this_ptr); public static native void MessageHandler_free(long this_ptr); - // const LDKChannelMessageHandler *MessageHandler_get_chan_handler(const LDKMessageHandler *this_ptr); + // const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr); public static native long MessageHandler_get_chan_handler(long this_ptr); - // void MessageHandler_set_chan_handler(LDKMessageHandler *this_ptr, LDKChannelMessageHandler val); + // void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val); public static native void MessageHandler_set_chan_handler(long this_ptr, long val); - // const LDKRoutingMessageHandler *MessageHandler_get_route_handler(const LDKMessageHandler *this_ptr); + // const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr); public static native long MessageHandler_get_route_handler(long this_ptr); - // void MessageHandler_set_route_handler(LDKMessageHandler *this_ptr, LDKRoutingMessageHandler val); + // void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val); public static native void MessageHandler_set_route_handler(long this_ptr, long val); - // MUST_USE_RES LDKMessageHandler MessageHandler_new(LDKChannelMessageHandler chan_handler_arg, LDKRoutingMessageHandler route_handler_arg); + // MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg); public static native long MessageHandler_new(long chan_handler_arg, long route_handler_arg); - // LDKSocketDescriptor SocketDescriptor_clone(const LDKSocketDescriptor *orig); + // struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig); public static native long SocketDescriptor_clone(long orig); - // void SocketDescriptor_free(LDKSocketDescriptor this_ptr); + // void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr); public static native void SocketDescriptor_free(long this_ptr); - // void PeerHandleError_free(LDKPeerHandleError this_ptr); + // void PeerHandleError_free(struct LDKPeerHandleError this_ptr); public static native void PeerHandleError_free(long this_ptr); - // bool PeerHandleError_get_no_connection_possible(const LDKPeerHandleError *this_ptr); + // bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr); public static native boolean PeerHandleError_get_no_connection_possible(long this_ptr); - // void PeerHandleError_set_no_connection_possible(LDKPeerHandleError *this_ptr, bool val); + // void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val); public static native void PeerHandleError_set_no_connection_possible(long this_ptr, boolean val); - // MUST_USE_RES LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg); + // MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg); public static native long PeerHandleError_new(boolean no_connection_possible_arg); - // void PeerManager_free(LDKPeerManager this_ptr); + // void PeerManager_free(struct LDKPeerManager this_ptr); public static native void PeerManager_free(long this_ptr); - // MUST_USE_RES LDKPeerManager PeerManager_new(LDKMessageHandler message_handler, LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], LDKLogger logger); + // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger); public static native long PeerManager_new(long message_handler, byte[] our_node_secret, byte[] ephemeral_random_data, long logger); - // MUST_USE_RES LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const LDKPeerManager *this_arg); + // MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg); public static native byte[][] PeerManager_get_peer_node_ids(long this_arg); - // MUST_USE_RES LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const LDKPeerManager *this_arg, LDKPublicKey their_node_id, LDKSocketDescriptor descriptor); + // MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor); public static native long PeerManager_new_outbound_connection(long this_arg, byte[] their_node_id, long descriptor); - // MUST_USE_RES LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const LDKPeerManager *this_arg, LDKSocketDescriptor descriptor); + // MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor); public static native long PeerManager_new_inbound_connection(long this_arg, long descriptor); - // MUST_USE_RES LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const LDKPeerManager *this_arg, LDKSocketDescriptor *descriptor); + // MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor); public static native long PeerManager_write_buffer_space_avail(long this_arg, long descriptor); - // MUST_USE_RES LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const LDKPeerManager *this_arg, LDKSocketDescriptor *peer_descriptor, LDKu8slice data); + // MUST_USE_RES struct LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR peer_descriptor, struct LDKu8slice data); public static native long PeerManager_read_event(long this_arg, long peer_descriptor, byte[] data); - // void PeerManager_process_events(const LDKPeerManager *this_arg); + // void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg); public static native void PeerManager_process_events(long this_arg); - // void PeerManager_socket_disconnected(const LDKPeerManager *this_arg, const LDKSocketDescriptor *descriptor); + // void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor); public static native void PeerManager_socket_disconnected(long this_arg, long descriptor); - // void PeerManager_timer_tick_occured(const LDKPeerManager *this_arg); + // void PeerManager_timer_tick_occured(const struct LDKPeerManager *NONNULL_PTR this_arg); public static native void PeerManager_timer_tick_occured(long this_arg); - // LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx); + // struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx); public static native byte[] build_commitment_secret(byte[] commitment_seed, long idx); - // LDKCResult_SecretKeySecpErrorZ derive_private_key(LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); + // struct LDKCResult_SecretKeySecpErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); public static native long derive_private_key(byte[] per_commitment_point, byte[] base_secret); - // LDKCResult_PublicKeySecpErrorZ derive_public_key(LDKPublicKey per_commitment_point, LDKPublicKey base_point); + // struct LDKCResult_PublicKeySecpErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point); public static native long derive_public_key(byte[] per_commitment_point, byte[] base_point); - // LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); + // struct LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); public static native long derive_private_revocation_key(byte[] per_commitment_secret, byte[] countersignatory_revocation_base_secret); - // LDKCResult_PublicKeySecpErrorZ derive_public_revocation_key(LDKPublicKey per_commitment_point, LDKPublicKey countersignatory_revocation_base_point); + // struct LDKCResult_PublicKeySecpErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point); public static native long derive_public_revocation_key(byte[] per_commitment_point, byte[] countersignatory_revocation_base_point); - // void TxCreationKeys_free(LDKTxCreationKeys this_ptr); + // void TxCreationKeys_free(struct LDKTxCreationKeys this_ptr); public static native void TxCreationKeys_free(long this_ptr); - // LDKTxCreationKeys TxCreationKeys_clone(const LDKTxCreationKeys *orig); + // struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig); public static native long TxCreationKeys_clone(long orig); - // LDKPublicKey TxCreationKeys_get_per_commitment_point(const LDKTxCreationKeys *this_ptr); + // struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); public static native byte[] TxCreationKeys_get_per_commitment_point(long this_ptr); - // void TxCreationKeys_set_per_commitment_point(LDKTxCreationKeys *this_ptr, LDKPublicKey val); + // void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void TxCreationKeys_set_per_commitment_point(long this_ptr, byte[] val); - // LDKPublicKey TxCreationKeys_get_revocation_key(const LDKTxCreationKeys *this_ptr); + // struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); public static native byte[] TxCreationKeys_get_revocation_key(long this_ptr); - // void TxCreationKeys_set_revocation_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); + // void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void TxCreationKeys_set_revocation_key(long this_ptr, byte[] val); - // LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const LDKTxCreationKeys *this_ptr); + // struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); public static native byte[] TxCreationKeys_get_broadcaster_htlc_key(long this_ptr); - // void TxCreationKeys_set_broadcaster_htlc_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); + // void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void TxCreationKeys_set_broadcaster_htlc_key(long this_ptr, byte[] val); - // LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const LDKTxCreationKeys *this_ptr); + // struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); public static native byte[] TxCreationKeys_get_countersignatory_htlc_key(long this_ptr); - // void TxCreationKeys_set_countersignatory_htlc_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); + // void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void TxCreationKeys_set_countersignatory_htlc_key(long this_ptr, byte[] val); - // LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const LDKTxCreationKeys *this_ptr); + // struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); public static native byte[] TxCreationKeys_get_broadcaster_delayed_payment_key(long this_ptr); - // void TxCreationKeys_set_broadcaster_delayed_payment_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); + // void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void TxCreationKeys_set_broadcaster_delayed_payment_key(long this_ptr, byte[] val); - // MUST_USE_RES LDKTxCreationKeys TxCreationKeys_new(LDKPublicKey per_commitment_point_arg, LDKPublicKey revocation_key_arg, LDKPublicKey broadcaster_htlc_key_arg, LDKPublicKey countersignatory_htlc_key_arg, LDKPublicKey broadcaster_delayed_payment_key_arg); + // MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg); public static native long TxCreationKeys_new(byte[] per_commitment_point_arg, byte[] revocation_key_arg, byte[] broadcaster_htlc_key_arg, byte[] countersignatory_htlc_key_arg, byte[] broadcaster_delayed_payment_key_arg); - // LDKCVec_u8Z TxCreationKeys_write(const LDKTxCreationKeys *obj); + // struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj); public static native byte[] TxCreationKeys_write(long obj); - // LDKTxCreationKeys TxCreationKeys_read(LDKu8slice ser); + // struct LDKTxCreationKeys TxCreationKeys_read(struct LDKu8slice ser); public static native long TxCreationKeys_read(byte[] ser); - // void PreCalculatedTxCreationKeys_free(LDKPreCalculatedTxCreationKeys this_ptr); - public static native void PreCalculatedTxCreationKeys_free(long this_ptr); - // LDKPreCalculatedTxCreationKeys PreCalculatedTxCreationKeys_clone(const LDKPreCalculatedTxCreationKeys *orig); - public static native long PreCalculatedTxCreationKeys_clone(long orig); - // MUST_USE_RES LDKPreCalculatedTxCreationKeys PreCalculatedTxCreationKeys_new(LDKTxCreationKeys keys); - public static native long PreCalculatedTxCreationKeys_new(long keys); - // MUST_USE_RES LDKTxCreationKeys PreCalculatedTxCreationKeys_trust_key_derivation(const LDKPreCalculatedTxCreationKeys *this_arg); - public static native long PreCalculatedTxCreationKeys_trust_key_derivation(long this_arg); - // MUST_USE_RES LDKPublicKey PreCalculatedTxCreationKeys_per_commitment_point(const LDKPreCalculatedTxCreationKeys *this_arg); - public static native byte[] PreCalculatedTxCreationKeys_per_commitment_point(long this_arg); - // void ChannelPublicKeys_free(LDKChannelPublicKeys this_ptr); + // void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_ptr); public static native void ChannelPublicKeys_free(long this_ptr); - // LDKChannelPublicKeys ChannelPublicKeys_clone(const LDKChannelPublicKeys *orig); + // struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig); public static native long ChannelPublicKeys_clone(long orig); - // LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const LDKChannelPublicKeys *this_ptr); + // struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); public static native byte[] ChannelPublicKeys_get_funding_pubkey(long this_ptr); - // void ChannelPublicKeys_set_funding_pubkey(LDKChannelPublicKeys *this_ptr, LDKPublicKey val); + // void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void ChannelPublicKeys_set_funding_pubkey(long this_ptr, byte[] val); - // LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const LDKChannelPublicKeys *this_ptr); + // struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); public static native byte[] ChannelPublicKeys_get_revocation_basepoint(long this_ptr); - // void ChannelPublicKeys_set_revocation_basepoint(LDKChannelPublicKeys *this_ptr, LDKPublicKey val); + // void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void ChannelPublicKeys_set_revocation_basepoint(long this_ptr, byte[] val); - // LDKPublicKey ChannelPublicKeys_get_payment_point(const LDKChannelPublicKeys *this_ptr); + // struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); public static native byte[] ChannelPublicKeys_get_payment_point(long this_ptr); - // void ChannelPublicKeys_set_payment_point(LDKChannelPublicKeys *this_ptr, LDKPublicKey val); + // void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void ChannelPublicKeys_set_payment_point(long this_ptr, byte[] val); - // LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const LDKChannelPublicKeys *this_ptr); + // struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); public static native byte[] ChannelPublicKeys_get_delayed_payment_basepoint(long this_ptr); - // void ChannelPublicKeys_set_delayed_payment_basepoint(LDKChannelPublicKeys *this_ptr, LDKPublicKey val); + // void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void ChannelPublicKeys_set_delayed_payment_basepoint(long this_ptr, byte[] val); - // LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const LDKChannelPublicKeys *this_ptr); + // struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); public static native byte[] ChannelPublicKeys_get_htlc_basepoint(long this_ptr); - // void ChannelPublicKeys_set_htlc_basepoint(LDKChannelPublicKeys *this_ptr, LDKPublicKey val); + // void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void ChannelPublicKeys_set_htlc_basepoint(long this_ptr, byte[] val); - // MUST_USE_RES LDKChannelPublicKeys ChannelPublicKeys_new(LDKPublicKey funding_pubkey_arg, LDKPublicKey revocation_basepoint_arg, LDKPublicKey payment_point_arg, LDKPublicKey delayed_payment_basepoint_arg, LDKPublicKey htlc_basepoint_arg); + // MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg); public static native long ChannelPublicKeys_new(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg); - // LDKCVec_u8Z ChannelPublicKeys_write(const LDKChannelPublicKeys *obj); + // struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj); public static native byte[] ChannelPublicKeys_write(long obj); - // LDKChannelPublicKeys ChannelPublicKeys_read(LDKu8slice ser); + // struct LDKChannelPublicKeys ChannelPublicKeys_read(struct LDKu8slice ser); public static native long ChannelPublicKeys_read(byte[] ser); - // MUST_USE_RES LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_derive_new(LDKPublicKey per_commitment_point, LDKPublicKey broadcaster_delayed_payment_base, LDKPublicKey broadcaster_htlc_base, LDKPublicKey countersignatory_revocation_base, LDKPublicKey countersignatory_htlc_base); + // MUST_USE_RES struct LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base); public static native long TxCreationKeys_derive_new(byte[] per_commitment_point, byte[] broadcaster_delayed_payment_base, byte[] broadcaster_htlc_base, byte[] countersignatory_revocation_base, byte[] countersignatory_htlc_base); - // LDKCVec_u8Z get_revokeable_redeemscript(LDKPublicKey revocation_key, uint16_t contest_delay, LDKPublicKey broadcaster_delayed_payment_key); + // MUST_USE_RES struct LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); + public static native long TxCreationKeys_from_channel_static_keys(byte[] per_commitment_point, long broadcaster_keys, long countersignatory_keys); + // struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key); public static native byte[] get_revokeable_redeemscript(byte[] revocation_key, short contest_delay, byte[] broadcaster_delayed_payment_key); - // void HTLCOutputInCommitment_free(LDKHTLCOutputInCommitment this_ptr); + // void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_ptr); public static native void HTLCOutputInCommitment_free(long this_ptr); - // LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const LDKHTLCOutputInCommitment *orig); + // struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig); public static native long HTLCOutputInCommitment_clone(long orig); - // bool HTLCOutputInCommitment_get_offered(const LDKHTLCOutputInCommitment *this_ptr); + // bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); public static native boolean HTLCOutputInCommitment_get_offered(long this_ptr); - // void HTLCOutputInCommitment_set_offered(LDKHTLCOutputInCommitment *this_ptr, bool val); + // void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val); public static native void HTLCOutputInCommitment_set_offered(long this_ptr, boolean val); - // uint64_t HTLCOutputInCommitment_get_amount_msat(const LDKHTLCOutputInCommitment *this_ptr); + // uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); public static native long HTLCOutputInCommitment_get_amount_msat(long this_ptr); - // void HTLCOutputInCommitment_set_amount_msat(LDKHTLCOutputInCommitment *this_ptr, uint64_t val); + // void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val); public static native void HTLCOutputInCommitment_set_amount_msat(long this_ptr, long val); - // uint32_t HTLCOutputInCommitment_get_cltv_expiry(const LDKHTLCOutputInCommitment *this_ptr); + // uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); public static native int HTLCOutputInCommitment_get_cltv_expiry(long this_ptr); - // void HTLCOutputInCommitment_set_cltv_expiry(LDKHTLCOutputInCommitment *this_ptr, uint32_t val); + // void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val); public static native void HTLCOutputInCommitment_set_cltv_expiry(long this_ptr, int val); - // const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const LDKHTLCOutputInCommitment *this_ptr))[32]; + // const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32]; public static native byte[] HTLCOutputInCommitment_get_payment_hash(long this_ptr); - // void HTLCOutputInCommitment_set_payment_hash(LDKHTLCOutputInCommitment *this_ptr, LDKThirtyTwoBytes val); + // 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); - // LDKCVec_u8Z HTLCOutputInCommitment_write(const LDKHTLCOutputInCommitment *obj); + // struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj); public static native byte[] HTLCOutputInCommitment_write(long obj); - // LDKHTLCOutputInCommitment HTLCOutputInCommitment_read(LDKu8slice ser); + // struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_read(struct LDKu8slice ser); public static native long HTLCOutputInCommitment_read(byte[] ser); - // LDKCVec_u8Z get_htlc_redeemscript(const LDKHTLCOutputInCommitment *htlc, const LDKTxCreationKeys *keys); + // struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys); public static native byte[] get_htlc_redeemscript(long htlc, long keys); - // LDKCVec_u8Z make_funding_redeemscript(LDKPublicKey broadcaster, LDKPublicKey countersignatory); + // struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory); public static native byte[] make_funding_redeemscript(byte[] broadcaster, byte[] countersignatory); - // LDKTransaction build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const LDKHTLCOutputInCommitment *htlc, LDKPublicKey broadcaster_delayed_payment_key, LDKPublicKey revocation_key); + // struct LDKTransaction build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key); public static native byte[] build_htlc_transaction(byte[] prev_hash, int feerate_per_kw, short contest_delay, long htlc, byte[] broadcaster_delayed_payment_key, byte[] revocation_key); - // void HolderCommitmentTransaction_free(LDKHolderCommitmentTransaction this_ptr); + // void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_ptr); + public static native void ChannelTransactionParameters_free(long this_ptr); + // struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig); + public static native long ChannelTransactionParameters_clone(long orig); + // struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); + public static native long ChannelTransactionParameters_get_holder_pubkeys(long this_ptr); + // void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val); + public static native void ChannelTransactionParameters_set_holder_pubkeys(long this_ptr, long val); + // uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); + public static native short ChannelTransactionParameters_get_holder_selected_contest_delay(long this_ptr); + // void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val); + public static native void ChannelTransactionParameters_set_holder_selected_contest_delay(long this_ptr, short val); + // bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); + public static native boolean ChannelTransactionParameters_get_is_outbound_from_holder(long this_ptr); + // void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val); + public static native void ChannelTransactionParameters_set_is_outbound_from_holder(long this_ptr, boolean val); + // struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); + public static native long ChannelTransactionParameters_get_counterparty_parameters(long this_ptr); + // void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val); + public static native void ChannelTransactionParameters_set_counterparty_parameters(long this_ptr, long val); + // struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); + public static native long ChannelTransactionParameters_get_funding_outpoint(long this_ptr); + // void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val); + public static native void ChannelTransactionParameters_set_funding_outpoint(long this_ptr, long val); + // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg); + public static native long ChannelTransactionParameters_new(long holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, long counterparty_parameters_arg, long funding_outpoint_arg); + // void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr); + public static native void CounterpartyChannelTransactionParameters_free(long this_ptr); + // struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig); + public static native long CounterpartyChannelTransactionParameters_clone(long orig); + // struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr); + public static native long CounterpartyChannelTransactionParameters_get_pubkeys(long this_ptr); + // void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val); + public static native void CounterpartyChannelTransactionParameters_set_pubkeys(long this_ptr, long val); + // uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr); + public static native short CounterpartyChannelTransactionParameters_get_selected_contest_delay(long this_ptr); + // void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val); + public static native void CounterpartyChannelTransactionParameters_set_selected_contest_delay(long this_ptr, short val); + // MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg); + public static native long CounterpartyChannelTransactionParameters_new(long pubkeys_arg, short selected_contest_delay_arg); + // MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); + public static native boolean ChannelTransactionParameters_is_populated(long this_arg); + // MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); + public static native long ChannelTransactionParameters_as_holder_broadcastable(long this_arg); + // MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); + public static native long ChannelTransactionParameters_as_counterparty_broadcastable(long this_arg); + // struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj); + public static native byte[] CounterpartyChannelTransactionParameters_write(long obj); + // struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser); + public static native long CounterpartyChannelTransactionParameters_read(byte[] ser); + // struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj); + public static native byte[] ChannelTransactionParameters_write(long obj); + // struct LDKChannelTransactionParameters ChannelTransactionParameters_read(struct LDKu8slice ser); + public static native long ChannelTransactionParameters_read(byte[] ser); + // void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_ptr); + public static native void DirectedChannelTransactionParameters_free(long this_ptr); + // MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); + public static native long DirectedChannelTransactionParameters_broadcaster_pubkeys(long this_arg); + // MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); + public static native long DirectedChannelTransactionParameters_countersignatory_pubkeys(long this_arg); + // MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); + public static native short DirectedChannelTransactionParameters_contest_delay(long this_arg); + // MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); + public static native boolean DirectedChannelTransactionParameters_is_outbound(long this_arg); + // MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); + public static native long DirectedChannelTransactionParameters_funding_outpoint(long this_arg); + // void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_ptr); public static native void HolderCommitmentTransaction_free(long this_ptr); - // LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const LDKHolderCommitmentTransaction *orig); + // struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig); public static native long HolderCommitmentTransaction_clone(long orig); - // LDKTransaction HolderCommitmentTransaction_get_unsigned_tx(const LDKHolderCommitmentTransaction *this_ptr); - public static native byte[] HolderCommitmentTransaction_get_unsigned_tx(long this_ptr); - // void HolderCommitmentTransaction_set_unsigned_tx(LDKHolderCommitmentTransaction *this_ptr, LDKTransaction val); - public static native void HolderCommitmentTransaction_set_unsigned_tx(long this_ptr, byte[] val); - // LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const LDKHolderCommitmentTransaction *this_ptr); + // struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr); public static native byte[] HolderCommitmentTransaction_get_counterparty_sig(long this_ptr); - // void HolderCommitmentTransaction_set_counterparty_sig(LDKHolderCommitmentTransaction *this_ptr, LDKSignature val); + // void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val); public static native void HolderCommitmentTransaction_set_counterparty_sig(long this_ptr, byte[] val); - // uint32_t HolderCommitmentTransaction_get_feerate_per_kw(const LDKHolderCommitmentTransaction *this_ptr); - public static native int HolderCommitmentTransaction_get_feerate_per_kw(long this_ptr); - // void HolderCommitmentTransaction_set_feerate_per_kw(LDKHolderCommitmentTransaction *this_ptr, uint32_t val); - public static native void HolderCommitmentTransaction_set_feerate_per_kw(long this_ptr, int val); - // void HolderCommitmentTransaction_set_per_htlc(LDKHolderCommitmentTransaction *this_ptr, LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val); - public static native void HolderCommitmentTransaction_set_per_htlc(long this_ptr, long[] val); - // MUST_USE_RES LDKHolderCommitmentTransaction HolderCommitmentTransaction_new_missing_holder_sig(LDKTransaction unsigned_tx, LDKSignature counterparty_sig, LDKPublicKey holder_funding_key, LDKPublicKey counterparty_funding_key, LDKTxCreationKeys keys, uint32_t feerate_per_kw, LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data); - public static native long HolderCommitmentTransaction_new_missing_holder_sig(byte[] unsigned_tx, byte[] counterparty_sig, byte[] holder_funding_key, byte[] counterparty_funding_key, long keys, int feerate_per_kw, long[] htlc_data); - // MUST_USE_RES LDKTxCreationKeys HolderCommitmentTransaction_trust_key_derivation(const LDKHolderCommitmentTransaction *this_arg); - public static native long HolderCommitmentTransaction_trust_key_derivation(long this_arg); - // MUST_USE_RES LDKThirtyTwoBytes HolderCommitmentTransaction_txid(const LDKHolderCommitmentTransaction *this_arg); - public static native byte[] HolderCommitmentTransaction_txid(long this_arg); - // MUST_USE_RES LDKSignature HolderCommitmentTransaction_get_holder_sig(const LDKHolderCommitmentTransaction *this_arg, const uint8_t (*funding_key)[32], LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); - public static native byte[] HolderCommitmentTransaction_get_holder_sig(long this_arg, byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis); - // MUST_USE_RES LDKCResult_CVec_SignatureZNoneZ HolderCommitmentTransaction_get_htlc_sigs(const LDKHolderCommitmentTransaction *this_arg, const uint8_t (*htlc_base_key)[32], uint16_t counterparty_selected_contest_delay); - public static native long HolderCommitmentTransaction_get_htlc_sigs(long this_arg, byte[] htlc_base_key, short counterparty_selected_contest_delay); - // LDKCVec_u8Z HolderCommitmentTransaction_write(const LDKHolderCommitmentTransaction *this_ptr); - public static native byte[] HolderCommitmentTransaction_write(long this_ptr); - // LDKHolderCommitmentTransaction HolderCommitmentTransaction_read(LDKu8slice ser); + // void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val); + public static native void HolderCommitmentTransaction_set_counterparty_htlc_sigs(long this_ptr, byte[][] val); + // struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj); + public static native byte[] HolderCommitmentTransaction_write(long obj); + // struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_read(struct LDKu8slice ser); public static native long HolderCommitmentTransaction_read(byte[] ser); - // void InitFeatures_free(LDKInitFeatures this_ptr); + // MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKSignature counterparty_sig, struct LDKCVec_SignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key); + public static native long HolderCommitmentTransaction_new(long commitment_tx, byte[] counterparty_sig, byte[][] counterparty_htlc_sigs, byte[] holder_funding_key, byte[] counterparty_funding_key); + // void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_ptr); + public static native void BuiltCommitmentTransaction_free(long this_ptr); + // struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig); + public static native long BuiltCommitmentTransaction_clone(long orig); + // struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr); + public static native byte[] BuiltCommitmentTransaction_get_transaction(long this_ptr); + // void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val); + public static native void BuiltCommitmentTransaction_set_transaction(long this_ptr, byte[] val); + // const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32]; + public static native byte[] BuiltCommitmentTransaction_get_txid(long this_ptr); + // void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + public static native void BuiltCommitmentTransaction_set_txid(long this_ptr, byte[] val); + // MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg); + public static native long BuiltCommitmentTransaction_new(byte[] transaction_arg, byte[] txid_arg); + // struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj); + public static native byte[] BuiltCommitmentTransaction_write(long obj); + // struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_read(struct LDKu8slice ser); + public static native long BuiltCommitmentTransaction_read(byte[] ser); + // MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); + public static native byte[] BuiltCommitmentTransaction_get_sighash_all(long this_arg, byte[] funding_redeemscript, long channel_value_satoshis); + // MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); + public static native byte[] BuiltCommitmentTransaction_sign(long this_arg, byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis); + // void CommitmentTransaction_free(struct LDKCommitmentTransaction this_ptr); + public static native void CommitmentTransaction_free(long this_ptr); + // struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig); + public static native long CommitmentTransaction_clone(long orig); + // struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj); + public static native byte[] CommitmentTransaction_write(long obj); + // struct LDKCommitmentTransaction CommitmentTransaction_read(struct LDKu8slice ser); + public static native long CommitmentTransaction_read(byte[] ser); + // MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); + public static native long CommitmentTransaction_commitment_number(long this_arg); + // MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); + public static native long CommitmentTransaction_to_broadcaster_value_sat(long this_arg); + // MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); + public static native long CommitmentTransaction_to_countersignatory_value_sat(long this_arg); + // MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); + public static native int CommitmentTransaction_feerate_per_kw(long this_arg); + // MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); + public static native long CommitmentTransaction_trust(long this_arg); + // MUST_USE_RES struct LDKCResult_TrustedCommitmentTransactionNoneZ CommitmentTransaction_verify(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg, const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); + public static native long CommitmentTransaction_verify(long this_arg, long channel_parameters, long broadcaster_keys, long countersignatory_keys); + // void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_ptr); + public static native void TrustedCommitmentTransaction_free(long this_ptr); + // MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); + public static native byte[] TrustedCommitmentTransaction_txid(long this_arg); + // MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); + public static native long TrustedCommitmentTransaction_built_transaction(long this_arg); + // MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); + public static native long TrustedCommitmentTransaction_keys(long this_arg); + // MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters); + public static native long TrustedCommitmentTransaction_get_htlc_sigs(long this_arg, byte[] htlc_base_key, long channel_parameters); + // uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster); + public static native long get_commitment_transaction_number_obscure_factor(byte[] broadcaster_payment_basepoint, byte[] countersignatory_payment_basepoint, boolean outbound_from_broadcaster); + // void InitFeatures_free(struct LDKInitFeatures this_ptr); public static native void InitFeatures_free(long this_ptr); - // void NodeFeatures_free(LDKNodeFeatures this_ptr); + // void NodeFeatures_free(struct LDKNodeFeatures this_ptr); public static native void NodeFeatures_free(long this_ptr); - // void ChannelFeatures_free(LDKChannelFeatures this_ptr); + // void ChannelFeatures_free(struct LDKChannelFeatures this_ptr); public static native void ChannelFeatures_free(long this_ptr); - // void RouteHop_free(LDKRouteHop this_ptr); + // void RouteHop_free(struct LDKRouteHop this_ptr); public static native void RouteHop_free(long this_ptr); - // LDKRouteHop RouteHop_clone(const LDKRouteHop *orig); + // struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); public static native long RouteHop_clone(long orig); - // LDKPublicKey RouteHop_get_pubkey(const LDKRouteHop *this_ptr); + // struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr); public static native byte[] RouteHop_get_pubkey(long this_ptr); - // void RouteHop_set_pubkey(LDKRouteHop *this_ptr, LDKPublicKey val); + // void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void RouteHop_set_pubkey(long this_ptr, byte[] val); - // LDKNodeFeatures RouteHop_get_node_features(const LDKRouteHop *this_ptr); + // struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); public static native long RouteHop_get_node_features(long this_ptr); - // void RouteHop_set_node_features(LDKRouteHop *this_ptr, LDKNodeFeatures val); + // void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); public static native void RouteHop_set_node_features(long this_ptr, long val); - // uint64_t RouteHop_get_short_channel_id(const LDKRouteHop *this_ptr); + // uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr); public static native long RouteHop_get_short_channel_id(long this_ptr); - // void RouteHop_set_short_channel_id(LDKRouteHop *this_ptr, uint64_t val); + // void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val); public static native void RouteHop_set_short_channel_id(long this_ptr, long val); - // LDKChannelFeatures RouteHop_get_channel_features(const LDKRouteHop *this_ptr); + // struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); public static native long RouteHop_get_channel_features(long this_ptr); - // void RouteHop_set_channel_features(LDKRouteHop *this_ptr, LDKChannelFeatures val); + // void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); public static native void RouteHop_set_channel_features(long this_ptr, long val); - // uint64_t RouteHop_get_fee_msat(const LDKRouteHop *this_ptr); + // uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr); public static native long RouteHop_get_fee_msat(long this_ptr); - // void RouteHop_set_fee_msat(LDKRouteHop *this_ptr, uint64_t val); + // void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val); public static native void RouteHop_set_fee_msat(long this_ptr, long val); - // uint32_t RouteHop_get_cltv_expiry_delta(const LDKRouteHop *this_ptr); + // uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr); public static native int RouteHop_get_cltv_expiry_delta(long this_ptr); - // void RouteHop_set_cltv_expiry_delta(LDKRouteHop *this_ptr, uint32_t val); + // void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val); public static native void RouteHop_set_cltv_expiry_delta(long this_ptr, int val); - // MUST_USE_RES LDKRouteHop RouteHop_new(LDKPublicKey pubkey_arg, LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg); + // MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg); public static native long RouteHop_new(byte[] pubkey_arg, long node_features_arg, long short_channel_id_arg, long channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg); - // void Route_free(LDKRoute this_ptr); + // void Route_free(struct LDKRoute this_ptr); public static native void Route_free(long this_ptr); - // LDKRoute Route_clone(const LDKRoute *orig); + // struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig); public static native long Route_clone(long orig); - // void Route_set_paths(LDKRoute *this_ptr, LDKCVec_CVec_RouteHopZZ val); + // void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val); public static native void Route_set_paths(long this_ptr, long[][] val); - // MUST_USE_RES LDKRoute Route_new(LDKCVec_CVec_RouteHopZZ paths_arg); + // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg); public static native long Route_new(long[][] paths_arg); - // LDKCVec_u8Z Route_write(const LDKRoute *this_ptr); - public static native byte[] Route_write(long this_ptr); - // LDKRoute Route_read(LDKu8slice ser); + // struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj); + public static native byte[] Route_write(long obj); + // struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser); public static native long Route_read(byte[] ser); - // void RouteHint_free(LDKRouteHint this_ptr); + // void RouteHint_free(struct LDKRouteHint this_ptr); public static native void RouteHint_free(long this_ptr); - // LDKRouteHint RouteHint_clone(const LDKRouteHint *orig); + // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); public static native long RouteHint_clone(long orig); - // LDKPublicKey RouteHint_get_src_node_id(const LDKRouteHint *this_ptr); + // struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *NONNULL_PTR this_ptr); public static native byte[] RouteHint_get_src_node_id(long this_ptr); - // void RouteHint_set_src_node_id(LDKRouteHint *this_ptr, LDKPublicKey val); + // void RouteHint_set_src_node_id(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void RouteHint_set_src_node_id(long this_ptr, byte[] val); - // uint64_t RouteHint_get_short_channel_id(const LDKRouteHint *this_ptr); + // uint64_t RouteHint_get_short_channel_id(const struct LDKRouteHint *NONNULL_PTR this_ptr); public static native long RouteHint_get_short_channel_id(long this_ptr); - // void RouteHint_set_short_channel_id(LDKRouteHint *this_ptr, uint64_t val); + // void RouteHint_set_short_channel_id(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val); public static native void RouteHint_set_short_channel_id(long this_ptr, long val); - // LDKRoutingFees RouteHint_get_fees(const LDKRouteHint *this_ptr); + // struct LDKRoutingFees RouteHint_get_fees(const struct LDKRouteHint *NONNULL_PTR this_ptr); public static native long RouteHint_get_fees(long this_ptr); - // void RouteHint_set_fees(LDKRouteHint *this_ptr, LDKRoutingFees val); + // void RouteHint_set_fees(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKRoutingFees val); public static native void RouteHint_set_fees(long this_ptr, long val); - // uint16_t RouteHint_get_cltv_expiry_delta(const LDKRouteHint *this_ptr); + // uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *NONNULL_PTR this_ptr); public static native short RouteHint_get_cltv_expiry_delta(long this_ptr); - // void RouteHint_set_cltv_expiry_delta(LDKRouteHint *this_ptr, uint16_t val); + // 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); - // uint64_t RouteHint_get_htlc_minimum_msat(const LDKRouteHint *this_ptr); + // uint64_t 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(LDKRouteHint *this_ptr, uint64_t val); + // void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val); public static native void RouteHint_set_htlc_minimum_msat(long this_ptr, long val); - // MUST_USE_RES LDKRouteHint RouteHint_new(LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg); + // 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, uint64_t htlc_minimum_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); - // LDKCResult_RouteLightningErrorZ get_route(LDKPublicKey our_node_id, const LDKNetworkGraph *network, LDKPublicKey target, LDKCVec_ChannelDetailsZ *first_hops, LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, LDKLogger logger); + // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey target, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger); public static native long get_route(byte[] our_node_id, long network, byte[] target, long[] first_hops, long[] last_hops, long final_value_msat, int final_cltv, long logger); - // void NetworkGraph_free(LDKNetworkGraph this_ptr); + // void NetworkGraph_free(struct LDKNetworkGraph this_ptr); public static native void NetworkGraph_free(long this_ptr); - // void LockedNetworkGraph_free(LDKLockedNetworkGraph this_ptr); + // void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_ptr); public static native void LockedNetworkGraph_free(long this_ptr); - // void NetGraphMsgHandler_free(LDKNetGraphMsgHandler this_ptr); + // void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_ptr); public static native void NetGraphMsgHandler_free(long this_ptr); - // MUST_USE_RES LDKNetGraphMsgHandler NetGraphMsgHandler_new(LDKAccess *chain_access, LDKLogger logger); - public static native long NetGraphMsgHandler_new(long chain_access, long logger); - // MUST_USE_RES LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(LDKAccess *chain_access, LDKLogger logger, LDKNetworkGraph network_graph); + // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger); + public static native long NetGraphMsgHandler_new(byte[] genesis_hash, long chain_access, long logger); + // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph); public static native long NetGraphMsgHandler_from_net_graph(long chain_access, long logger, long network_graph); - // MUST_USE_RES LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const LDKNetGraphMsgHandler *this_arg); + // MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); public static native long NetGraphMsgHandler_read_locked_graph(long this_arg); - // MUST_USE_RES LDKNetworkGraph LockedNetworkGraph_graph(const LDKLockedNetworkGraph *this_arg); + // MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg); public static native long LockedNetworkGraph_graph(long this_arg); - // LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const LDKNetGraphMsgHandler *this_arg); + // struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); public static native long NetGraphMsgHandler_as_RoutingMessageHandler(long this_arg); - // void DirectionalChannelInfo_free(LDKDirectionalChannelInfo this_ptr); + // struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); + public static native long NetGraphMsgHandler_as_MessageSendEventsProvider(long this_arg); + // void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_ptr); public static native void DirectionalChannelInfo_free(long this_ptr); - // uint32_t DirectionalChannelInfo_get_last_update(const LDKDirectionalChannelInfo *this_ptr); + // uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); public static native int DirectionalChannelInfo_get_last_update(long this_ptr); - // void DirectionalChannelInfo_set_last_update(LDKDirectionalChannelInfo *this_ptr, uint32_t val); + // void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val); public static native void DirectionalChannelInfo_set_last_update(long this_ptr, int val); - // bool DirectionalChannelInfo_get_enabled(const LDKDirectionalChannelInfo *this_ptr); + // bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); public static native boolean DirectionalChannelInfo_get_enabled(long this_ptr); - // void DirectionalChannelInfo_set_enabled(LDKDirectionalChannelInfo *this_ptr, bool val); + // void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val); public static native void DirectionalChannelInfo_set_enabled(long this_ptr, boolean val); - // uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const LDKDirectionalChannelInfo *this_ptr); + // uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); public static native short DirectionalChannelInfo_get_cltv_expiry_delta(long this_ptr); - // void DirectionalChannelInfo_set_cltv_expiry_delta(LDKDirectionalChannelInfo *this_ptr, uint16_t val); + // void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val); public static native void DirectionalChannelInfo_set_cltv_expiry_delta(long this_ptr, short val); - // uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const LDKDirectionalChannelInfo *this_ptr); + // uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); public static native long DirectionalChannelInfo_get_htlc_minimum_msat(long this_ptr); - // void DirectionalChannelInfo_set_htlc_minimum_msat(LDKDirectionalChannelInfo *this_ptr, uint64_t val); + // 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); - // LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const LDKDirectionalChannelInfo *this_ptr); + // 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); + public static native void DirectionalChannelInfo_set_fees(long this_ptr, long val); + // struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); public static native long DirectionalChannelInfo_get_last_update_message(long this_ptr); - // void DirectionalChannelInfo_set_last_update_message(LDKDirectionalChannelInfo *this_ptr, LDKChannelUpdate val); + // 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); - // LDKCVec_u8Z DirectionalChannelInfo_write(const LDKDirectionalChannelInfo *obj); + // struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj); public static native byte[] DirectionalChannelInfo_write(long obj); - // LDKDirectionalChannelInfo DirectionalChannelInfo_read(LDKu8slice ser); + // struct LDKDirectionalChannelInfo DirectionalChannelInfo_read(struct LDKu8slice ser); public static native long DirectionalChannelInfo_read(byte[] ser); - // void ChannelInfo_free(LDKChannelInfo this_ptr); + // void ChannelInfo_free(struct LDKChannelInfo this_ptr); public static native void ChannelInfo_free(long this_ptr); - // LDKChannelFeatures ChannelInfo_get_features(const LDKChannelInfo *this_ptr); + // struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr); public static native long ChannelInfo_get_features(long this_ptr); - // void ChannelInfo_set_features(LDKChannelInfo *this_ptr, LDKChannelFeatures val); + // void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); public static native void ChannelInfo_set_features(long this_ptr, long val); - // LDKPublicKey ChannelInfo_get_node_one(const LDKChannelInfo *this_ptr); + // struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); public static native byte[] ChannelInfo_get_node_one(long this_ptr); - // void ChannelInfo_set_node_one(LDKChannelInfo *this_ptr, LDKPublicKey val); + // void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void ChannelInfo_set_node_one(long this_ptr, byte[] val); - // LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const LDKChannelInfo *this_ptr); + // struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); public static native long ChannelInfo_get_one_to_two(long this_ptr); - // void ChannelInfo_set_one_to_two(LDKChannelInfo *this_ptr, LDKDirectionalChannelInfo val); + // void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val); public static native void ChannelInfo_set_one_to_two(long this_ptr, long val); - // LDKPublicKey ChannelInfo_get_node_two(const LDKChannelInfo *this_ptr); + // struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); public static native byte[] ChannelInfo_get_node_two(long this_ptr); - // void ChannelInfo_set_node_two(LDKChannelInfo *this_ptr, LDKPublicKey val); + // void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void ChannelInfo_set_node_two(long this_ptr, byte[] val); - // LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const LDKChannelInfo *this_ptr); + // struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); public static native long ChannelInfo_get_two_to_one(long this_ptr); - // void ChannelInfo_set_two_to_one(LDKChannelInfo *this_ptr, LDKDirectionalChannelInfo val); + // 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); - // LDKChannelAnnouncement ChannelInfo_get_announcement_message(const LDKChannelInfo *this_ptr); + // 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(LDKChannelInfo *this_ptr, LDKChannelAnnouncement val); + // 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); - // LDKCVec_u8Z ChannelInfo_write(const LDKChannelInfo *obj); + // struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj); public static native byte[] ChannelInfo_write(long obj); - // LDKChannelInfo ChannelInfo_read(LDKu8slice ser); + // struct LDKChannelInfo ChannelInfo_read(struct LDKu8slice ser); public static native long ChannelInfo_read(byte[] ser); - // void RoutingFees_free(LDKRoutingFees this_ptr); + // void RoutingFees_free(struct LDKRoutingFees this_ptr); public static native void RoutingFees_free(long this_ptr); - // LDKRoutingFees RoutingFees_clone(const LDKRoutingFees *orig); + // struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); public static native long RoutingFees_clone(long orig); - // uint32_t RoutingFees_get_base_msat(const LDKRoutingFees *this_ptr); + // uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr); public static native int RoutingFees_get_base_msat(long this_ptr); - // void RoutingFees_set_base_msat(LDKRoutingFees *this_ptr, uint32_t val); + // void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); public static native void RoutingFees_set_base_msat(long this_ptr, int val); - // uint32_t RoutingFees_get_proportional_millionths(const LDKRoutingFees *this_ptr); + // uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr); public static native int RoutingFees_get_proportional_millionths(long this_ptr); - // void RoutingFees_set_proportional_millionths(LDKRoutingFees *this_ptr, uint32_t val); + // void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); public static native void RoutingFees_set_proportional_millionths(long this_ptr, int val); - // MUST_USE_RES LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg); + // MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg); public static native long RoutingFees_new(int base_msat_arg, int proportional_millionths_arg); - // LDKRoutingFees RoutingFees_read(LDKu8slice ser); + // struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser); public static native long RoutingFees_read(byte[] ser); - // LDKCVec_u8Z RoutingFees_write(const LDKRoutingFees *this_ptr); - public static native byte[] RoutingFees_write(long this_ptr); - // void NodeAnnouncementInfo_free(LDKNodeAnnouncementInfo this_ptr); + // struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj); + public static native byte[] RoutingFees_write(long obj); + // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr); public static native void NodeAnnouncementInfo_free(long this_ptr); - // LDKNodeFeatures NodeAnnouncementInfo_get_features(const LDKNodeAnnouncementInfo *this_ptr); + // struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); public static native long NodeAnnouncementInfo_get_features(long this_ptr); - // void NodeAnnouncementInfo_set_features(LDKNodeAnnouncementInfo *this_ptr, LDKNodeFeatures val); + // void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); public static native void NodeAnnouncementInfo_set_features(long this_ptr, long val); - // uint32_t NodeAnnouncementInfo_get_last_update(const LDKNodeAnnouncementInfo *this_ptr); + // uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); public static native int NodeAnnouncementInfo_get_last_update(long this_ptr); - // void NodeAnnouncementInfo_set_last_update(LDKNodeAnnouncementInfo *this_ptr, uint32_t val); + // void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val); public static native void NodeAnnouncementInfo_set_last_update(long this_ptr, int val); - // const uint8_t (*NodeAnnouncementInfo_get_rgb(const LDKNodeAnnouncementInfo *this_ptr))[3]; + // const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3]; public static native byte[] NodeAnnouncementInfo_get_rgb(long this_ptr); - // void NodeAnnouncementInfo_set_rgb(LDKNodeAnnouncementInfo *this_ptr, LDKThreeBytes val); + // void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val); public static native void NodeAnnouncementInfo_set_rgb(long this_ptr, byte[] val); - // const uint8_t (*NodeAnnouncementInfo_get_alias(const LDKNodeAnnouncementInfo *this_ptr))[32]; + // const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32]; public static native byte[] NodeAnnouncementInfo_get_alias(long this_ptr); - // void NodeAnnouncementInfo_set_alias(LDKNodeAnnouncementInfo *this_ptr, LDKThirtyTwoBytes val); + // void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void NodeAnnouncementInfo_set_alias(long this_ptr, byte[] val); - // void NodeAnnouncementInfo_set_addresses(LDKNodeAnnouncementInfo *this_ptr, LDKCVec_NetAddressZ val); + // void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val); public static native void NodeAnnouncementInfo_set_addresses(long this_ptr, long[] val); - // LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const LDKNodeAnnouncementInfo *this_ptr); + // struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); public static native long NodeAnnouncementInfo_get_announcement_message(long this_ptr); - // void NodeAnnouncementInfo_set_announcement_message(LDKNodeAnnouncementInfo *this_ptr, LDKNodeAnnouncement val); + // void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val); public static native void NodeAnnouncementInfo_set_announcement_message(long this_ptr, long val); - // MUST_USE_RES LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(LDKNodeFeatures features_arg, uint32_t last_update_arg, LDKThreeBytes rgb_arg, LDKThirtyTwoBytes alias_arg, LDKCVec_NetAddressZ addresses_arg, LDKNodeAnnouncement announcement_message_arg); + // MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg); public static native long NodeAnnouncementInfo_new(long features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, long[] addresses_arg, long announcement_message_arg); - // LDKCVec_u8Z NodeAnnouncementInfo_write(const LDKNodeAnnouncementInfo *this_ptr); - public static native byte[] NodeAnnouncementInfo_write(long this_ptr); - // LDKNodeAnnouncementInfo NodeAnnouncementInfo_read(LDKu8slice ser); + // struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj); + public static native byte[] NodeAnnouncementInfo_write(long obj); + // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser); public static native long NodeAnnouncementInfo_read(byte[] ser); - // void NodeInfo_free(LDKNodeInfo this_ptr); + // void NodeInfo_free(struct LDKNodeInfo this_ptr); public static native void NodeInfo_free(long this_ptr); - // void NodeInfo_set_channels(LDKNodeInfo *this_ptr, LDKCVec_u64Z val); + // void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); public static native void NodeInfo_set_channels(long this_ptr, long[] val); - // LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const LDKNodeInfo *this_ptr); + // struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr); public static native long NodeInfo_get_lowest_inbound_channel_fees(long this_ptr); - // void NodeInfo_set_lowest_inbound_channel_fees(LDKNodeInfo *this_ptr, LDKRoutingFees val); + // void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val); public static native void NodeInfo_set_lowest_inbound_channel_fees(long this_ptr, long val); - // LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const LDKNodeInfo *this_ptr); + // struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr); public static native long NodeInfo_get_announcement_info(long this_ptr); - // void NodeInfo_set_announcement_info(LDKNodeInfo *this_ptr, LDKNodeAnnouncementInfo val); + // void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val); public static native void NodeInfo_set_announcement_info(long this_ptr, long val); - // MUST_USE_RES LDKNodeInfo NodeInfo_new(LDKCVec_u64Z channels_arg, LDKRoutingFees lowest_inbound_channel_fees_arg, LDKNodeAnnouncementInfo announcement_info_arg); + // MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg); public static native long NodeInfo_new(long[] channels_arg, long lowest_inbound_channel_fees_arg, long announcement_info_arg); - // LDKCVec_u8Z NodeInfo_write(const LDKNodeInfo *this_ptr); - public static native byte[] NodeInfo_write(long this_ptr); - // LDKNodeInfo NodeInfo_read(LDKu8slice ser); + // struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj); + public static native byte[] NodeInfo_write(long obj); + // struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser); public static native long NodeInfo_read(byte[] ser); - // LDKCVec_u8Z NetworkGraph_write(const LDKNetworkGraph *this_ptr); - public static native byte[] NetworkGraph_write(long this_ptr); - // LDKNetworkGraph NetworkGraph_read(LDKu8slice ser); + // struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj); + public static native byte[] NetworkGraph_write(long obj); + // struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser); public static native long NetworkGraph_read(byte[] ser); - // MUST_USE_RES LDKNetworkGraph NetworkGraph_new(void); - public static native long NetworkGraph_new(); - // void NetworkGraph_close_channel_from_update(LDKNetworkGraph *this_arg, uint64_t short_channel_id, bool is_permanent); + // MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash); + public static native long NetworkGraph_new(byte[] genesis_hash); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg); + public static native long NetworkGraph_update_node_from_announcement(long this_arg, long msg); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg); + public static native long NetworkGraph_update_node_from_unsigned_announcement(long this_arg, long msg); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access); + public static native long NetworkGraph_update_channel_from_announcement(long this_arg, long msg, long chain_access); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access); + public static native long NetworkGraph_update_channel_from_unsigned_announcement(long this_arg, long msg, long chain_access); + // void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent); public static native void NetworkGraph_close_channel_from_update(long this_arg, long short_channel_id, boolean is_permanent); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg); + public static native long NetworkGraph_update_channel(long this_arg, long msg); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg); + public static native long NetworkGraph_update_channel_unsigned(long this_arg, long msg); } diff --git a/src/main/java/org/ldk/impl/chain/chaininterface/BroadcasterInterface.java b/src/main/java/org/ldk/impl/chain/chaininterface/BroadcasterInterface.java new file mode 100644 index 00000000..7b602d85 --- /dev/null +++ b/src/main/java/org/ldk/impl/chain/chaininterface/BroadcasterInterface.java @@ -0,0 +1,5 @@ +package org.ldk.impl.chain.chaininterface; + +public interface BroadcasterInterface { + public void broadcast_transaction(byte[] transaction_data); +} diff --git a/src/main/java/org/ldk/impl/chain/keysinterface/KeysInterface.java b/src/main/java/org/ldk/impl/chain/keysinterface/KeysInterface.java new file mode 100644 index 00000000..66d7b515 --- /dev/null +++ b/src/main/java/org/ldk/impl/chain/keysinterface/KeysInterface.java @@ -0,0 +1,5 @@ +package org.ldk.impl.chain.keysinterface; + +public class KeysInterface { + +} diff --git a/src/main/java/org/ldk/impl/ln/channelmanager/ChannelManager.java b/src/main/java/org/ldk/impl/ln/channelmanager/ChannelManager.java new file mode 100644 index 00000000..f961fc50 --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/channelmanager/ChannelManager.java @@ -0,0 +1,19 @@ +package org.ldk.impl.ln.channelmanager; + +import org.ldk.impl.chain.chaininterface.BroadcasterInterface; +import org.ldk.impl.chain.keysinterface.KeysInterface; +import org.ldk.impl.ln.channelmonitor.ManyChannelMonitor; + +public class ChannelManager { + public enum Network { + Bitcoin, + Testnet + } + /*public ChannelManager(Network net, FeeEstimator feeEstimator, ManyChannelMonitor monitor, + BroadcasterInterface broadcaster, Logger logger, KeysInterface keys, + UserConfig config, int cur_chain_height) { + + }*/ + + +} diff --git a/src/main/java/org/ldk/impl/ln/channelmonitor/ManyChannelMonitor.java b/src/main/java/org/ldk/impl/ln/channelmonitor/ManyChannelMonitor.java new file mode 100644 index 00000000..286004d0 --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/channelmonitor/ManyChannelMonitor.java @@ -0,0 +1,4 @@ +package org.ldk.impl.ln.channelmonitor; + +public interface ManyChannelMonitor { +} diff --git a/src/main/java/org/ldk/impl/ln/msgs/AcceptChannel.java b/src/main/java/org/ldk/impl/ln/msgs/AcceptChannel.java new file mode 100644 index 00000000..bafb7bb6 --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/msgs/AcceptChannel.java @@ -0,0 +1,18 @@ +package org.ldk.impl.ln.msgs; + +import org.ldk.impl.bindings; + +public final class AcceptChannel { + private final long c_obj; + + private AcceptChannel(long c_obj) { + this.c_obj = c_obj; + } + + @SuppressWarnings("deprecation") + @Override + final protected void finalize() throws Throwable { + bindings.AcceptChannel_free(this.c_obj); + super.finalize(); + } +} diff --git a/src/main/java/org/ldk/impl/ln/msgs/AnnouncementSignatures.java b/src/main/java/org/ldk/impl/ln/msgs/AnnouncementSignatures.java new file mode 100644 index 00000000..71904413 --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/msgs/AnnouncementSignatures.java @@ -0,0 +1,5 @@ +package org.ldk.impl.ln.msgs; + +public class AnnouncementSignatures { + private long c_obj; +} diff --git a/src/main/java/org/ldk/impl/ln/msgs/ChannelAnnouncement.java b/src/main/java/org/ldk/impl/ln/msgs/ChannelAnnouncement.java new file mode 100644 index 00000000..e559337f --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/msgs/ChannelAnnouncement.java @@ -0,0 +1,5 @@ +package org.ldk.impl.ln.msgs; + +public class ChannelAnnouncement { + private long c_obj; +} diff --git a/src/main/java/org/ldk/impl/ln/msgs/ChannelMessageHandler.java b/src/main/java/org/ldk/impl/ln/msgs/ChannelMessageHandler.java new file mode 100644 index 00000000..aad48d82 --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/msgs/ChannelMessageHandler.java @@ -0,0 +1,8 @@ +package org.ldk.impl.ln.msgs; + +public abstract class ChannelMessageHandler { + private long c_obj; + public long getC_obj() { return c_obj; } + + //abstract void handle_open_channel(char[] public_key, OpenChannel msg); +} \ No newline at end of file diff --git a/src/main/java/org/ldk/impl/ln/msgs/ChannelReestablish.java b/src/main/java/org/ldk/impl/ln/msgs/ChannelReestablish.java new file mode 100644 index 00000000..4aec61c8 --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/msgs/ChannelReestablish.java @@ -0,0 +1,5 @@ +package org.ldk.impl.ln.msgs; + +public class ChannelReestablish { + private long c_obj; +} diff --git a/src/main/java/org/ldk/impl/ln/msgs/ChannelUpdate.java b/src/main/java/org/ldk/impl/ln/msgs/ChannelUpdate.java new file mode 100644 index 00000000..7c7507e0 --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/msgs/ChannelUpdate.java @@ -0,0 +1,5 @@ +package org.ldk.impl.ln.msgs; + +public class ChannelUpdate { + private long c_obj; +} diff --git a/src/main/java/org/ldk/impl/ln/msgs/RoutingMessageHandler.java b/src/main/java/org/ldk/impl/ln/msgs/RoutingMessageHandler.java new file mode 100644 index 00000000..92b38cb4 --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/msgs/RoutingMessageHandler.java @@ -0,0 +1,7 @@ +package org.ldk.impl.ln.msgs; + +public abstract class RoutingMessageHandler { + private long c_obj; + public long getC_obj() { return c_obj; } + +} \ No newline at end of file diff --git a/src/main/java/org/ldk/impl/ln/msgs/msgs.java b/src/main/java/org/ldk/impl/ln/msgs/msgs.java new file mode 100644 index 00000000..0bef15e7 --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/msgs/msgs.java @@ -0,0 +1,67 @@ +package org.ldk.impl.ln.msgs; + +/*public class ClosingSigned { + private long c_obj; +} +public class CommitmentSigned { + private long c_obj; +} +public class CommitmentUpdate { + private long c_obj; +} +public class ErrorMessage { + private long c_obj; +} +public class FundingCreated { + private long c_obj; +} +public class FundingLocked { + private long c_obj; +} +public class FundingSigned { + private long c_obj; +} +public class Init { + private long c_obj; +} +public class NodeAnnouncement { + private long c_obj; +} +public class OpenChannel { + private long c_obj; +} +public class Ping { + private long c_obj; +} +public class Pong { + private long c_obj; +} +public class RevokeAndACK { + private long c_obj; +} +public class Shutdown { + private long c_obj; +} +public class UnsignedChannelAnnouncement { + private long c_obj; +} +public class UnsignedNodeAnnouncement { + private long c_obj; +} +public class UpdateAddHTLC { + private long c_obj; +} +public class UpdateFailHTLC { + private long c_obj; +} +public class UpdateFailMalformedHTLC { + private long c_obj; +} +public class UpdateFee { + private long c_obj; +} +public class UpdateFulfillHTLC { + private long c_obj; +} + +*/ \ No newline at end of file diff --git a/src/main/java/org/ldk/impl/ln/peer_handler/MessageHandler.java b/src/main/java/org/ldk/impl/ln/peer_handler/MessageHandler.java new file mode 100644 index 00000000..079727e5 --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/peer_handler/MessageHandler.java @@ -0,0 +1,26 @@ +package org.ldk.impl.ln.peer_handler; + +import org.ldk.impl.bindings; +import org.ldk.impl.ln.msgs.ChannelMessageHandler; +import org.ldk.impl.ln.msgs.RoutingMessageHandler; + +public class MessageHandler { + private final long c_obj; + // We don't care about these, but we hold references to them to ensure they don't get free'd before us + private final ChannelMessageHandler chan_handler; + private final RoutingMessageHandler route_handler; + + //oc Pr Bprivate MessageHandler(long c_obj) { this.c_obj = c_obj; } + public MessageHandler(ChannelMessageHandler chan_handler, RoutingMessageHandler route_handler) { + this.c_obj = bindings.MessageHandler_new(chan_handler.getC_obj(), route_handler.getC_obj()); + this.chan_handler = chan_handler; + this.route_handler = route_handler; + } + + @SuppressWarnings("deprecation") + @Override + final protected void finalize() throws Throwable { + bindings.MessageHandler_free(this.c_obj); + super.finalize(); + } +} \ No newline at end of file diff --git a/src/main/java/org/ldk/impl/ln/peer_handler/PeerManager.java b/src/main/java/org/ldk/impl/ln/peer_handler/PeerManager.java new file mode 100644 index 00000000..93add85b --- /dev/null +++ b/src/main/java/org/ldk/impl/ln/peer_handler/PeerManager.java @@ -0,0 +1,19 @@ +package org.ldk.impl.ln.peer_handler; + +import org.ldk.impl.bindings; + +public class PeerManager { + private final long c_obj; + + private PeerManager(long c_obj) { + this.c_obj = c_obj; + } + //public PeerManager(MessageHandler) + + @SuppressWarnings("deprecation") + @Override + final protected void finalize() throws Throwable { + bindings.PeerManager_free(this.c_obj); + super.finalize(); + } +} diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index f0f0a39a..718b73c6 100644 --- a/src/main/java/org/ldk/structs/AcceptChannel.java +++ b/src/main/java/org/ldk/structs/AcceptChannel.java @@ -14,10 +14,9 @@ public class AcceptChannel extends CommonBase { if (ptr != 0) { bindings.AcceptChannel_free(ptr); } } - public static AcceptChannel constructor_clone(AcceptChannel orig) { - long ret = bindings.AcceptChannel_clone(orig == null ? 0 : orig.ptr & ~1); + public AcceptChannel clone() { + long ret = bindings.AcceptChannel_clone(this.ptr); AcceptChannel ret_hu_conv = new AcceptChannel(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -147,9 +146,8 @@ public class AcceptChannel extends CommonBase { bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, val); } - public byte[] write(AcceptChannel obj) { - byte[] ret = bindings.AcceptChannel_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.AcceptChannel_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/Access.java b/src/main/java/org/ldk/structs/Access.java index 7a9b89c0..da510903 100644 --- a/src/main/java/org/ldk/structs/Access.java +++ b/src/main/java/org/ldk/structs/Access.java @@ -38,7 +38,6 @@ public class Access extends CommonBase { public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) { long ret = bindings.Access_get_utxo(this.ptr, genesis_hash, short_channel_id); Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/AnnouncementSignatures.java b/src/main/java/org/ldk/structs/AnnouncementSignatures.java index a3bbf117..5bc4dfae 100644 --- a/src/main/java/org/ldk/structs/AnnouncementSignatures.java +++ b/src/main/java/org/ldk/structs/AnnouncementSignatures.java @@ -14,10 +14,9 @@ public class AnnouncementSignatures extends CommonBase { if (ptr != 0) { bindings.AnnouncementSignatures_free(ptr); } } - public static AnnouncementSignatures constructor_clone(AnnouncementSignatures orig) { - long ret = bindings.AnnouncementSignatures_clone(orig == null ? 0 : orig.ptr & ~1); + public AnnouncementSignatures clone() { + long ret = bindings.AnnouncementSignatures_clone(this.ptr); AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -63,9 +62,8 @@ public class AnnouncementSignatures extends CommonBase { return ret_hu_conv; } - public byte[] write(AnnouncementSignatures obj) { - byte[] ret = bindings.AnnouncementSignatures_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.AnnouncementSignatures_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java b/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java new file mode 100644 index 00000000..97e5481b --- /dev/null +++ b/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java @@ -0,0 +1,68 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class BuiltCommitmentTransaction extends CommonBase { + BuiltCommitmentTransaction(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.BuiltCommitmentTransaction_free(ptr); } + } + + public BuiltCommitmentTransaction clone() { + long ret = bindings.BuiltCommitmentTransaction_clone(this.ptr); + BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret); + return ret_hu_conv; + } + + public byte[] get_transaction() { + byte[] ret = bindings.BuiltCommitmentTransaction_get_transaction(this.ptr); + return ret; + } + + public void set_transaction(byte[] val) { + bindings.BuiltCommitmentTransaction_set_transaction(this.ptr, val); + } + + public byte[] get_txid() { + byte[] ret = bindings.BuiltCommitmentTransaction_get_txid(this.ptr); + return ret; + } + + public void set_txid(byte[] val) { + bindings.BuiltCommitmentTransaction_set_txid(this.ptr, val); + } + + public static BuiltCommitmentTransaction constructor_new(byte[] transaction_arg, byte[] txid_arg) { + long ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, txid_arg); + BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret); + return ret_hu_conv; + } + + public byte[] write() { + byte[] ret = bindings.BuiltCommitmentTransaction_write(this.ptr); + return ret; + } + + public static BuiltCommitmentTransaction constructor_read(byte[] ser) { + long ret = bindings.BuiltCommitmentTransaction_read(ser); + BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret); + return ret_hu_conv; + } + + public byte[] get_sighash_all(byte[] funding_redeemscript, long channel_value_satoshis) { + byte[] ret = bindings.BuiltCommitmentTransaction_get_sighash_all(this.ptr, funding_redeemscript, channel_value_satoshis); + return ret; + } + + public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) { + byte[] ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/ChainMonitor.java b/src/main/java/org/ldk/structs/ChainMonitor.java index ae957504..9864acda 100644 --- a/src/main/java/org/ldk/structs/ChainMonitor.java +++ b/src/main/java/org/ldk/structs/ChainMonitor.java @@ -23,13 +23,14 @@ public class ChainMonitor extends CommonBase { bindings.ChainMonitor_block_disconnected(this.ptr, header, disconnected_height); } - public static ChainMonitor constructor_new(Filter chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest) { - long ret = bindings.ChainMonitor_new(chain_source == null ? 0 : chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr); + public static ChainMonitor constructor_new(Filter chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) { + long ret = bindings.ChainMonitor_new(chain_source == null ? 0 : chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr); ChainMonitor ret_hu_conv = new ChainMonitor(null, ret); ret_hu_conv.ptrs_to.add(chain_source); ret_hu_conv.ptrs_to.add(broadcaster); ret_hu_conv.ptrs_to.add(logger); ret_hu_conv.ptrs_to.add(feeest); + ret_hu_conv.ptrs_to.add(persister); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelAnnouncement.java b/src/main/java/org/ldk/structs/ChannelAnnouncement.java index 1d481940..995ca9ae 100644 --- a/src/main/java/org/ldk/structs/ChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/ChannelAnnouncement.java @@ -14,10 +14,9 @@ public class ChannelAnnouncement extends CommonBase { if (ptr != 0) { bindings.ChannelAnnouncement_free(ptr); } } - public static ChannelAnnouncement constructor_clone(ChannelAnnouncement orig) { - long ret = bindings.ChannelAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1); + public ChannelAnnouncement clone() { + long ret = bindings.ChannelAnnouncement_clone(this.ptr); ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -75,9 +74,8 @@ public class ChannelAnnouncement extends CommonBase { return ret_hu_conv; } - public byte[] write(ChannelAnnouncement obj) { - byte[] ret = bindings.ChannelAnnouncement_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.ChannelAnnouncement_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/ChannelConfig.java b/src/main/java/org/ldk/structs/ChannelConfig.java index ed37eb1d..9cc8ff3f 100644 --- a/src/main/java/org/ldk/structs/ChannelConfig.java +++ b/src/main/java/org/ldk/structs/ChannelConfig.java @@ -14,10 +14,9 @@ public class ChannelConfig extends CommonBase { if (ptr != 0) { bindings.ChannelConfig_free(ptr); } } - public static ChannelConfig constructor_clone(ChannelConfig orig) { - long ret = bindings.ChannelConfig_clone(orig == null ? 0 : orig.ptr & ~1); + public ChannelConfig clone() { + long ret = bindings.ChannelConfig_clone(this.ptr); ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -60,9 +59,8 @@ public class ChannelConfig extends CommonBase { return ret_hu_conv; } - public byte[] write(ChannelConfig obj) { - byte[] ret = bindings.ChannelConfig_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.ChannelConfig_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/ChannelDetails.java b/src/main/java/org/ldk/structs/ChannelDetails.java index dfc373e5..09221b0d 100644 --- a/src/main/java/org/ldk/structs/ChannelDetails.java +++ b/src/main/java/org/ldk/structs/ChannelDetails.java @@ -14,10 +14,9 @@ public class ChannelDetails extends CommonBase { if (ptr != 0) { bindings.ChannelDetails_free(ptr); } } - public static ChannelDetails constructor_clone(ChannelDetails orig) { - long ret = bindings.ChannelDetails_clone(orig == null ? 0 : orig.ptr & ~1); + public ChannelDetails clone() { + long ret = bindings.ChannelDetails_clone(this.ptr); ChannelDetails ret_hu_conv = new ChannelDetails(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -45,7 +44,11 @@ public class ChannelDetails extends CommonBase { return ret_hu_conv; } - // Skipped ChannelDetails_set_counterparty_features + public void set_counterparty_features(InitFeatures val) { + bindings.ChannelDetails_set_counterparty_features(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + public long get_channel_value_satoshis() { long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr); return ret; diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java index 98578edc..850eff7e 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java @@ -14,10 +14,9 @@ public class ChannelHandshakeConfig extends CommonBase { if (ptr != 0) { bindings.ChannelHandshakeConfig_free(ptr); } } - public static ChannelHandshakeConfig constructor_clone(ChannelHandshakeConfig orig) { - long ret = bindings.ChannelHandshakeConfig_clone(orig == null ? 0 : orig.ptr & ~1); + public ChannelHandshakeConfig clone() { + long ret = bindings.ChannelHandshakeConfig_clone(this.ptr); ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java index bf8249d0..a9408524 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java @@ -14,10 +14,9 @@ public class ChannelHandshakeLimits extends CommonBase { if (ptr != 0) { bindings.ChannelHandshakeLimits_free(ptr); } } - public static ChannelHandshakeLimits constructor_clone(ChannelHandshakeLimits orig) { - long ret = bindings.ChannelHandshakeLimits_clone(orig == null ? 0 : orig.ptr & ~1); + public ChannelHandshakeLimits clone() { + long ret = bindings.ChannelHandshakeLimits_clone(this.ptr); ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index ae95717d..fdcba395 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -20,7 +20,11 @@ public class ChannelInfo extends CommonBase { return ret_hu_conv; } - // Skipped ChannelInfo_set_features + public void set_features(ChannelFeatures val) { + bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + public byte[] get_node_one() { byte[] ret = bindings.ChannelInfo_get_node_one(this.ptr); return ret; @@ -36,7 +40,11 @@ public class ChannelInfo extends CommonBase { return ret_hu_conv; } - // Skipped ChannelInfo_set_one_to_two + public void set_one_to_two(DirectionalChannelInfo val) { + bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + public byte[] get_node_two() { byte[] ret = bindings.ChannelInfo_get_node_two(this.ptr); return ret; @@ -52,7 +60,11 @@ public class ChannelInfo extends CommonBase { return ret_hu_conv; } - // Skipped ChannelInfo_set_two_to_one + public void set_two_to_one(DirectionalChannelInfo val) { + bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + public ChannelAnnouncement get_announcement_message() { long ret = bindings.ChannelInfo_get_announcement_message(this.ptr); ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret); @@ -64,9 +76,8 @@ public class ChannelInfo extends CommonBase { this.ptrs_to.add(val); } - public byte[] write(ChannelInfo obj) { - byte[] ret = bindings.ChannelInfo_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.ChannelInfo_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/ChannelKeys.java b/src/main/java/org/ldk/structs/ChannelKeys.java index d3ac3c07..76537158 100644 --- a/src/main/java/org/ldk/structs/ChannelKeys.java +++ b/src/main/java/org/ldk/structs/ChannelKeys.java @@ -24,14 +24,14 @@ public class ChannelKeys extends CommonBase { byte[] get_per_commitment_point(long idx); byte[] release_commitment_secret(long idx); TwoTuple key_derivation_params(); - Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(int feerate_per_kw, byte[] commitment_tx, PreCalculatedTxCreationKeys keys, HTLCOutputInCommitment[] htlcs); - Result_SignatureNoneZ sign_holder_commitment(HolderCommitmentTransaction holder_commitment_tx); - Result_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions(HolderCommitmentTransaction holder_commitment_tx); + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx); + Result_SignatureNoneZ sign_holder_commitment(HolderCommitmentTransaction commitment_tx); + Result_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions(HolderCommitmentTransaction commitment_tx); Result_SignatureNoneZ sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc); Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc); Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx); Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg); - void on_accept(ChannelPublicKeys channel_points, short counterparty_selected_contest_delay, short holder_selected_contest_delay); + void ready_channel(ChannelTransactionParameters channel_parameters); byte[] write(); } private static class LDKChannelKeysHolder { ChannelKeys held; } @@ -51,29 +51,23 @@ public class ChannelKeys extends CommonBase { long result = bindings.C2Tuple_u64u64Z_new(ret.a, ret.b); return result; } - @Override public long sign_counterparty_commitment(int feerate_per_kw, byte[] commitment_tx, long keys, long[] htlcs) { - PreCalculatedTxCreationKeys keys_hu_conv = new PreCalculatedTxCreationKeys(null, keys); - HTLCOutputInCommitment[] arr_conv_24_arr = new HTLCOutputInCommitment[htlcs.length]; - for (int y = 0; y < htlcs.length; y++) { - long arr_conv_24 = htlcs[y]; - HTLCOutputInCommitment arr_conv_24_hu_conv = new HTLCOutputInCommitment(null, arr_conv_24); - arr_conv_24_arr[y] = arr_conv_24_hu_conv; - } - Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(feerate_per_kw, commitment_tx, keys_hu_conv, arr_conv_24_arr); + @Override public long sign_counterparty_commitment(long commitment_tx) { + CommitmentTransaction commitment_tx_hu_conv = new CommitmentTransaction(null, commitment_tx); + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv); long result = ret != null ? ret.ptr : 0; ret.ptr = 0; return result; } - @Override public long sign_holder_commitment(long holder_commitment_tx) { - HolderCommitmentTransaction holder_commitment_tx_hu_conv = new HolderCommitmentTransaction(null, holder_commitment_tx); - Result_SignatureNoneZ ret = arg.sign_holder_commitment(holder_commitment_tx_hu_conv); + @Override public long sign_holder_commitment(long commitment_tx) { + HolderCommitmentTransaction commitment_tx_hu_conv = new HolderCommitmentTransaction(null, commitment_tx); + Result_SignatureNoneZ ret = arg.sign_holder_commitment(commitment_tx_hu_conv); long result = ret != null ? ret.ptr : 0; ret.ptr = 0; return result; } - @Override public long sign_holder_commitment_htlc_transactions(long holder_commitment_tx) { - HolderCommitmentTransaction holder_commitment_tx_hu_conv = new HolderCommitmentTransaction(null, holder_commitment_tx); - Result_CVec_SignatureZNoneZ ret = arg.sign_holder_commitment_htlc_transactions(holder_commitment_tx_hu_conv); + @Override public long sign_holder_commitment_htlc_transactions(long commitment_tx) { + HolderCommitmentTransaction commitment_tx_hu_conv = new HolderCommitmentTransaction(null, commitment_tx); + Result_CVec_SignatureZNoneZ ret = arg.sign_holder_commitment_htlc_transactions(commitment_tx_hu_conv); long result = ret != null ? ret.ptr : 0; ret.ptr = 0; return result; @@ -105,9 +99,9 @@ public class ChannelKeys extends CommonBase { ret.ptr = 0; return result; } - @Override public void on_accept(long channel_points, short counterparty_selected_contest_delay, short holder_selected_contest_delay) { - ChannelPublicKeys channel_points_hu_conv = new ChannelPublicKeys(null, channel_points); - arg.on_accept(channel_points_hu_conv, counterparty_selected_contest_delay, holder_selected_contest_delay); + @Override public void ready_channel(long channel_parameters) { + ChannelTransactionParameters channel_parameters_hu_conv = new ChannelTransactionParameters(null, channel_parameters); + arg.ready_channel(channel_parameters_hu_conv); } @Override public byte[] write() { byte[] ret = arg.write(); @@ -126,36 +120,38 @@ public class ChannelKeys extends CommonBase { return ret; } - // Skipped ChannelKeys_key_derivation_params - public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(int feerate_per_kw, byte[] commitment_tx, PreCalculatedTxCreationKeys keys, HTLCOutputInCommitment[] htlcs) { - long ret = bindings.ChannelKeys_sign_counterparty_commitment(this.ptr, feerate_per_kw, commitment_tx, keys == null ? 0 : keys.ptr & ~1, Arrays.stream(htlcs).mapToLong(arr_conv_24 -> arr_conv_24 == null ? 0 : arr_conv_24.ptr & ~1).toArray()); + public TwoTuple key_derivation_params() { + long ret = bindings.ChannelKeys_key_derivation_params(this.ptr); + long ret_a = bindings.LDKC2Tuple_u64u64Z_get_a(ret); + long ret_b = bindings.LDKC2Tuple_u64u64Z_get_b(ret); + TwoTuple ret_conv = new TwoTuple(ret_a, ret_b); + return ret_conv; + } + + public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx) { + long ret = bindings.ChannelKeys_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1); Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); - this.ptrs_to.add(keys); - /* TODO 2 HTLCOutputInCommitment */; + this.ptrs_to.add(commitment_tx); return ret_hu_conv; } - public Result_SignatureNoneZ sign_holder_commitment(HolderCommitmentTransaction holder_commitment_tx) { - long ret = bindings.ChannelKeys_sign_holder_commitment(this.ptr, holder_commitment_tx == null ? 0 : holder_commitment_tx.ptr & ~1); + public Result_SignatureNoneZ sign_holder_commitment(HolderCommitmentTransaction commitment_tx) { + long ret = bindings.ChannelKeys_sign_holder_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); - this.ptrs_to.add(holder_commitment_tx); + this.ptrs_to.add(commitment_tx); return ret_hu_conv; } - public Result_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions(HolderCommitmentTransaction holder_commitment_tx) { - long ret = bindings.ChannelKeys_sign_holder_commitment_htlc_transactions(this.ptr, holder_commitment_tx == null ? 0 : holder_commitment_tx.ptr & ~1); + public Result_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions(HolderCommitmentTransaction commitment_tx) { + long ret = bindings.ChannelKeys_sign_holder_commitment_htlc_transactions(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1); Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); - this.ptrs_to.add(holder_commitment_tx); + this.ptrs_to.add(commitment_tx); return ret_hu_conv; } public Result_SignatureNoneZ sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc) { long ret = bindings.ChannelKeys_sign_justice_transaction(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(htlc); return ret_hu_conv; } @@ -163,7 +159,6 @@ public class ChannelKeys extends CommonBase { public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc) { long ret = bindings.ChannelKeys_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(htlc); return ret_hu_conv; } @@ -171,21 +166,19 @@ public class ChannelKeys extends CommonBase { public Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx) { long ret = bindings.ChannelKeys_sign_closing_transaction(this.ptr, closing_tx); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) { long ret = bindings.ChannelKeys_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(msg); return ret_hu_conv; } - public void on_accept(ChannelPublicKeys channel_points, short counterparty_selected_contest_delay, short holder_selected_contest_delay) { - bindings.ChannelKeys_on_accept(this.ptr, channel_points == null ? 0 : channel_points.ptr & ~1, counterparty_selected_contest_delay, holder_selected_contest_delay); - this.ptrs_to.add(channel_points); + public void ready_channel(ChannelTransactionParameters channel_parameters) { + bindings.ChannelKeys_ready_channel(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr & ~1); + this.ptrs_to.add(channel_parameters); } public byte[] write() { @@ -199,11 +192,10 @@ public class ChannelKeys extends CommonBase { return ret_hu_conv; } - public static ChannelKeys constructor_clone(ChannelKeys orig) { - long ret = bindings.ChannelKeys_clone(orig == null ? 0 : orig.ptr); + public ChannelKeys clone() { + long ret = bindings.ChannelKeys_clone(this.ptr); ChannelKeys ret_hu_conv = new ChannelKeys(null, ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(orig); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index a0a290b0..4f22bd22 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -29,7 +29,6 @@ public class ChannelManager extends CommonBase { public Result_NoneAPIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_id, UserConfig override_config) { long ret = bindings.ChannelManager_create_channel(this.ptr, their_network_key, channel_value_satoshis, push_msat, user_id, override_config == null ? 0 : override_config.ptr & ~1); Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(override_config); return ret_hu_conv; } @@ -59,7 +58,6 @@ public class ChannelManager extends CommonBase { public Result_NoneAPIErrorZ close_channel(byte[] channel_id) { long ret = bindings.ChannelManager_close_channel(this.ptr, channel_id); Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -74,7 +72,6 @@ public class ChannelManager extends CommonBase { public Result_NonePaymentSendFailureZ send_payment(Route route, byte[] payment_hash, byte[] payment_secret) { long ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_hash, payment_secret); Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(route); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelMessageHandler.java b/src/main/java/org/ldk/structs/ChannelMessageHandler.java index d286901e..ac0e308e 100644 --- a/src/main/java/org/ldk/structs/ChannelMessageHandler.java +++ b/src/main/java/org/ldk/structs/ChannelMessageHandler.java @@ -125,8 +125,18 @@ public class ChannelMessageHandler extends CommonBase { }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance); return impl_holder.held; } - // Skipped ChannelMessageHandler_handle_open_channel - // Skipped ChannelMessageHandler_handle_accept_channel + public void handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg) { + bindings.ChannelMessageHandler_handle_open_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); + this.ptrs_to.add(their_features); + this.ptrs_to.add(msg); + } + + public void handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg) { + bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); + this.ptrs_to.add(their_features); + this.ptrs_to.add(msg); + } + public void handle_funding_created(byte[] their_node_id, FundingCreated msg) { bindings.ChannelMessageHandler_handle_funding_created(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); diff --git a/src/main/java/org/ldk/structs/ChannelMonitor.java b/src/main/java/org/ldk/structs/ChannelMonitor.java index 666ed72f..5ace2c36 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitor.java +++ b/src/main/java/org/ldk/structs/ChannelMonitor.java @@ -19,12 +19,12 @@ public class ChannelMonitor extends CommonBase { return ret; } - public Result_NoneMonitorUpdateErrorZ update_monitor(ChannelMonitorUpdate updates, BroadcasterInterface broadcaster, Logger logger) { - long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr & ~1, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr); + public Result_NoneMonitorUpdateErrorZ update_monitor(ChannelMonitorUpdate updates, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { + long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr & ~1, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(updates); this.ptrs_to.add(broadcaster); + this.ptrs_to.add(fee_estimator); this.ptrs_to.add(logger); return ret_hu_conv; } @@ -34,7 +34,15 @@ public class ChannelMonitor extends CommonBase { return ret; } - // Skipped ChannelMonitor_get_funding_txo + public TwoTuple get_funding_txo() { + long ret = bindings.ChannelMonitor_get_funding_txo(this.ptr); + long ret_a = bindings.LDKC2Tuple_OutPointScriptZ_get_a(ret); + OutPoint ret_a_hu_conv = new OutPoint(null, ret_a);; + byte[] ret_b = bindings.LDKC2Tuple_OutPointScriptZ_get_b(ret); + TwoTuple ret_conv = new TwoTuple(ret_a_hu_conv, ret_b); + return ret_conv; + } + public MonitorEvent[] get_and_clear_pending_monitor_events() { long[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr); MonitorEvent[] arr_conv_14_arr = new MonitorEvent[ret.length]; @@ -64,27 +72,30 @@ public class ChannelMonitor extends CommonBase { return ret; } - public TwoTuple[] block_connected(byte[] header, TwoTuple[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { + public TwoTuple[]>[] block_connected(byte[] header, TwoTuple[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).mapToLong(arr_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_24.a, arr_conv_24.b)).toArray(), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); - TwoTuple[] arr_conv_27_arr = new TwoTuple[ret.length]; - for (int b = 0; b < ret.length; b++) { - long arr_conv_27 = ret[b]; - byte[] arr_conv_27_a = bindings.LDKC2Tuple_TxidCVec_TxOutZZ_get_a(arr_conv_27); - long[] arr_conv_27_b = bindings.LDKC2Tuple_TxidCVec_TxOutZZ_get_b(arr_conv_27); - TxOut[] arr_conv_7_arr = new TxOut[arr_conv_27_b.length]; - for (int h = 0; h < arr_conv_27_b.length; h++) { - long arr_conv_7 = arr_conv_27_b[h]; - TxOut arr_conv_7_conv = new TxOut(null, arr_conv_7); - arr_conv_7_arr[h] = arr_conv_7_conv; + TwoTuple[]>[] arr_conv_46_arr = new TwoTuple[ret.length]; + for (int u = 0; u < ret.length; u++) { + long arr_conv_46 = ret[u]; + byte[] arr_conv_46_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(arr_conv_46); + long[] arr_conv_46_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(arr_conv_46); + TwoTuple[] arr_conv_26_arr = new TwoTuple[arr_conv_46_b.length]; + for (int a = 0; a < arr_conv_46_b.length; a++) { + long arr_conv_26 = arr_conv_46_b[a]; + int arr_conv_26_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(arr_conv_26); + long arr_conv_26_b = bindings.LDKC2Tuple_u32TxOutZ_get_b(arr_conv_26); + TxOut arr_conv_26_b_conv = new TxOut(null, arr_conv_26_b);; + TwoTuple arr_conv_26_conv = new TwoTuple(arr_conv_26_a, arr_conv_26_b_conv); + arr_conv_26_arr[a] = arr_conv_26_conv; }; - TwoTuple arr_conv_27_conv = new TwoTuple(arr_conv_27_a, arr_conv_7_arr); - arr_conv_27_arr[b] = arr_conv_27_conv; + TwoTuple[]> arr_conv_46_conv = new TwoTuple[]>(arr_conv_46_a, arr_conv_26_arr); + arr_conv_46_arr[u] = arr_conv_46_conv; } /* TODO 2 TwoTuple */; this.ptrs_to.add(broadcaster); this.ptrs_to.add(fee_estimator); this.ptrs_to.add(logger); - return arr_conv_27_arr; + return arr_conv_46_arr; } public void block_disconnected(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { diff --git a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java index 960c5f20..92d58952 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java @@ -14,10 +14,9 @@ public class ChannelMonitorUpdate extends CommonBase { if (ptr != 0) { bindings.ChannelMonitorUpdate_free(ptr); } } - public static ChannelMonitorUpdate constructor_clone(ChannelMonitorUpdate orig) { - long ret = bindings.ChannelMonitorUpdate_clone(orig == null ? 0 : orig.ptr & ~1); + public ChannelMonitorUpdate clone() { + long ret = bindings.ChannelMonitorUpdate_clone(this.ptr); ChannelMonitorUpdate ret_hu_conv = new ChannelMonitorUpdate(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -35,9 +34,9 @@ public class ChannelMonitorUpdate extends CommonBase { return ret; } - public static ChannelMonitorUpdate constructor_read(byte[] ser) { + public static Result_ChannelMonitorUpdateDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelMonitorUpdate_read(ser); - ChannelMonitorUpdate ret_hu_conv = new ChannelMonitorUpdate(null, ret); + Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelPublicKeys.java b/src/main/java/org/ldk/structs/ChannelPublicKeys.java index 3dfd7c06..29c745d8 100644 --- a/src/main/java/org/ldk/structs/ChannelPublicKeys.java +++ b/src/main/java/org/ldk/structs/ChannelPublicKeys.java @@ -14,10 +14,9 @@ public class ChannelPublicKeys extends CommonBase { if (ptr != 0) { bindings.ChannelPublicKeys_free(ptr); } } - public static ChannelPublicKeys constructor_clone(ChannelPublicKeys orig) { - long ret = bindings.ChannelPublicKeys_clone(orig == null ? 0 : orig.ptr & ~1); + public ChannelPublicKeys clone() { + long ret = bindings.ChannelPublicKeys_clone(this.ptr); ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -72,9 +71,8 @@ public class ChannelPublicKeys extends CommonBase { return ret_hu_conv; } - public byte[] write(ChannelPublicKeys obj) { - byte[] ret = bindings.ChannelPublicKeys_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.ChannelPublicKeys_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/ChannelReestablish.java b/src/main/java/org/ldk/structs/ChannelReestablish.java index 17dbf286..ad00ac0e 100644 --- a/src/main/java/org/ldk/structs/ChannelReestablish.java +++ b/src/main/java/org/ldk/structs/ChannelReestablish.java @@ -14,10 +14,9 @@ public class ChannelReestablish extends CommonBase { if (ptr != 0) { bindings.ChannelReestablish_free(ptr); } } - public static ChannelReestablish constructor_clone(ChannelReestablish orig) { - long ret = bindings.ChannelReestablish_clone(orig == null ? 0 : orig.ptr & ~1); + public ChannelReestablish clone() { + long ret = bindings.ChannelReestablish_clone(this.ptr); ChannelReestablish ret_hu_conv = new ChannelReestablish(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -53,9 +52,9 @@ public class ChannelReestablish extends CommonBase { return ret; } - public static ChannelReestablish constructor_read(byte[] ser) { + public static Result_ChannelReestablishDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelReestablish_read(ser); - ChannelReestablish ret_hu_conv = new ChannelReestablish(null, ret); + Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java new file mode 100644 index 00000000..9a8899d0 --- /dev/null +++ b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java @@ -0,0 +1,111 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class ChannelTransactionParameters extends CommonBase { + ChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.ChannelTransactionParameters_free(ptr); } + } + + public ChannelTransactionParameters clone() { + long ret = bindings.ChannelTransactionParameters_clone(this.ptr); + ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + return ret_hu_conv; + } + + public ChannelPublicKeys get_holder_pubkeys() { + long ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr); + ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + return ret_hu_conv; + } + + public void set_holder_pubkeys(ChannelPublicKeys val) { + bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + + public short get_holder_selected_contest_delay() { + short ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr); + return ret; + } + + public void set_holder_selected_contest_delay(short val) { + bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val); + } + + public boolean get_is_outbound_from_holder() { + boolean ret = bindings.ChannelTransactionParameters_get_is_outbound_from_holder(this.ptr); + return ret; + } + + public void set_is_outbound_from_holder(boolean val) { + bindings.ChannelTransactionParameters_set_is_outbound_from_holder(this.ptr, val); + } + + public CounterpartyChannelTransactionParameters get_counterparty_parameters() { + long ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr); + CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); + return ret_hu_conv; + } + + public void set_counterparty_parameters(CounterpartyChannelTransactionParameters val) { + bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + + public OutPoint get_funding_outpoint() { + long ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr); + OutPoint ret_hu_conv = new OutPoint(null, ret); + return ret_hu_conv; + } + + public void set_funding_outpoint(OutPoint val) { + bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + + public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) { + long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1); + ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + ret_hu_conv.ptrs_to.add(holder_pubkeys_arg); + ret_hu_conv.ptrs_to.add(counterparty_parameters_arg); + ret_hu_conv.ptrs_to.add(funding_outpoint_arg); + return ret_hu_conv; + } + + public boolean is_populated() { + boolean ret = bindings.ChannelTransactionParameters_is_populated(this.ptr); + return ret; + } + + public DirectedChannelTransactionParameters as_holder_broadcastable() { + long ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr); + DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); + return ret_hu_conv; + } + + public DirectedChannelTransactionParameters as_counterparty_broadcastable() { + long ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr); + DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); + return ret_hu_conv; + } + + public byte[] write() { + byte[] ret = bindings.ChannelTransactionParameters_write(this.ptr); + return ret; + } + + public static ChannelTransactionParameters constructor_read(byte[] ser) { + long ret = bindings.ChannelTransactionParameters_read(ser); + ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/ChannelUpdate.java b/src/main/java/org/ldk/structs/ChannelUpdate.java index 2409134c..8baf1cee 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelUpdate.java @@ -14,10 +14,9 @@ public class ChannelUpdate extends CommonBase { if (ptr != 0) { bindings.ChannelUpdate_free(ptr); } } - public static ChannelUpdate constructor_clone(ChannelUpdate orig) { - long ret = bindings.ChannelUpdate_clone(orig == null ? 0 : orig.ptr & ~1); + public ChannelUpdate clone() { + long ret = bindings.ChannelUpdate_clone(this.ptr); ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -48,9 +47,8 @@ public class ChannelUpdate extends CommonBase { return ret_hu_conv; } - public byte[] write(ChannelUpdate obj) { - byte[] ret = bindings.ChannelUpdate_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.ChannelUpdate_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/ClosingSigned.java b/src/main/java/org/ldk/structs/ClosingSigned.java index fe05ebef..0a78ac03 100644 --- a/src/main/java/org/ldk/structs/ClosingSigned.java +++ b/src/main/java/org/ldk/structs/ClosingSigned.java @@ -14,10 +14,9 @@ public class ClosingSigned extends CommonBase { if (ptr != 0) { bindings.ClosingSigned_free(ptr); } } - public static ClosingSigned constructor_clone(ClosingSigned orig) { - long ret = bindings.ClosingSigned_clone(orig == null ? 0 : orig.ptr & ~1); + public ClosingSigned clone() { + long ret = bindings.ClosingSigned_clone(this.ptr); ClosingSigned ret_hu_conv = new ClosingSigned(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -54,9 +53,8 @@ public class ClosingSigned extends CommonBase { return ret_hu_conv; } - public byte[] write(ClosingSigned obj) { - byte[] ret = bindings.ClosingSigned_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.ClosingSigned_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/CommitmentSigned.java b/src/main/java/org/ldk/structs/CommitmentSigned.java index a29b4623..ba515767 100644 --- a/src/main/java/org/ldk/structs/CommitmentSigned.java +++ b/src/main/java/org/ldk/structs/CommitmentSigned.java @@ -14,10 +14,9 @@ public class CommitmentSigned extends CommonBase { if (ptr != 0) { bindings.CommitmentSigned_free(ptr); } } - public static CommitmentSigned constructor_clone(CommitmentSigned orig) { - long ret = bindings.CommitmentSigned_clone(orig == null ? 0 : orig.ptr & ~1); + public CommitmentSigned clone() { + long ret = bindings.CommitmentSigned_clone(this.ptr); CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -49,9 +48,8 @@ public class CommitmentSigned extends CommonBase { return ret_hu_conv; } - public byte[] write(CommitmentSigned obj) { - byte[] ret = bindings.CommitmentSigned_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.CommitmentSigned_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/CommitmentTransaction.java b/src/main/java/org/ldk/structs/CommitmentTransaction.java new file mode 100644 index 00000000..31fd014f --- /dev/null +++ b/src/main/java/org/ldk/structs/CommitmentTransaction.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; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class CommitmentTransaction extends CommonBase { + CommitmentTransaction(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.CommitmentTransaction_free(ptr); } + } + + public CommitmentTransaction clone() { + long ret = bindings.CommitmentTransaction_clone(this.ptr); + CommitmentTransaction ret_hu_conv = new CommitmentTransaction(null, ret); + return ret_hu_conv; + } + + public byte[] write() { + byte[] ret = bindings.CommitmentTransaction_write(this.ptr); + return ret; + } + + public static CommitmentTransaction constructor_read(byte[] ser) { + long ret = bindings.CommitmentTransaction_read(ser); + CommitmentTransaction ret_hu_conv = new CommitmentTransaction(null, ret); + return ret_hu_conv; + } + + public long commitment_number() { + long ret = bindings.CommitmentTransaction_commitment_number(this.ptr); + return ret; + } + + public long to_broadcaster_value_sat() { + long ret = bindings.CommitmentTransaction_to_broadcaster_value_sat(this.ptr); + return ret; + } + + public long to_countersignatory_value_sat() { + long ret = bindings.CommitmentTransaction_to_countersignatory_value_sat(this.ptr); + return ret; + } + + public int feerate_per_kw() { + int ret = bindings.CommitmentTransaction_feerate_per_kw(this.ptr); + return ret; + } + + public TrustedCommitmentTransaction trust() { + long ret = bindings.CommitmentTransaction_trust(this.ptr); + TrustedCommitmentTransaction ret_hu_conv = new TrustedCommitmentTransaction(null, ret); + return ret_hu_conv; + } + + public Result_TrustedCommitmentTransactionNoneZ verify(DirectedChannelTransactionParameters channel_parameters, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) { + long ret = bindings.CommitmentTransaction_verify(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr & ~1, broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1); + Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret); + this.ptrs_to.add(channel_parameters); + this.ptrs_to.add(broadcaster_keys); + this.ptrs_to.add(countersignatory_keys); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/CommitmentUpdate.java b/src/main/java/org/ldk/structs/CommitmentUpdate.java index 01e7a975..4b9d1535 100644 --- a/src/main/java/org/ldk/structs/CommitmentUpdate.java +++ b/src/main/java/org/ldk/structs/CommitmentUpdate.java @@ -14,10 +14,9 @@ public class CommitmentUpdate extends CommonBase { if (ptr != 0) { bindings.CommitmentUpdate_free(ptr); } } - public static CommitmentUpdate constructor_clone(CommitmentUpdate orig) { - long ret = bindings.CommitmentUpdate_clone(orig == null ? 0 : orig.ptr & ~1); + public CommitmentUpdate clone() { + long ret = bindings.CommitmentUpdate_clone(this.ptr); CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java new file mode 100644 index 00000000..49d27132 --- /dev/null +++ b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java @@ -0,0 +1,61 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class CounterpartyChannelTransactionParameters extends CommonBase { + CounterpartyChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.CounterpartyChannelTransactionParameters_free(ptr); } + } + + public CounterpartyChannelTransactionParameters clone() { + long ret = bindings.CounterpartyChannelTransactionParameters_clone(this.ptr); + CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); + return ret_hu_conv; + } + + public ChannelPublicKeys get_pubkeys() { + long ret = bindings.CounterpartyChannelTransactionParameters_get_pubkeys(this.ptr); + ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + return ret_hu_conv; + } + + public void set_pubkeys(ChannelPublicKeys val) { + bindings.CounterpartyChannelTransactionParameters_set_pubkeys(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + + public short get_selected_contest_delay() { + short ret = bindings.CounterpartyChannelTransactionParameters_get_selected_contest_delay(this.ptr); + return ret; + } + + public void set_selected_contest_delay(short val) { + bindings.CounterpartyChannelTransactionParameters_set_selected_contest_delay(this.ptr, val); + } + + public static CounterpartyChannelTransactionParameters constructor_new(ChannelPublicKeys pubkeys_arg, short selected_contest_delay_arg) { + long ret = bindings.CounterpartyChannelTransactionParameters_new(pubkeys_arg == null ? 0 : pubkeys_arg.ptr & ~1, selected_contest_delay_arg); + CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); + ret_hu_conv.ptrs_to.add(pubkeys_arg); + return ret_hu_conv; + } + + public byte[] write() { + byte[] ret = bindings.CounterpartyChannelTransactionParameters_write(this.ptr); + return ret; + } + + public static CounterpartyChannelTransactionParameters constructor_read(byte[] ser) { + long ret = bindings.CounterpartyChannelTransactionParameters_read(ser); + CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/DataLossProtect.java b/src/main/java/org/ldk/structs/DataLossProtect.java index fa0cd512..7fecd217 100644 --- a/src/main/java/org/ldk/structs/DataLossProtect.java +++ b/src/main/java/org/ldk/structs/DataLossProtect.java @@ -14,10 +14,9 @@ public class DataLossProtect extends CommonBase { if (ptr != 0) { bindings.DataLossProtect_free(ptr); } } - public static DataLossProtect constructor_clone(DataLossProtect orig) { - long ret = bindings.DataLossProtect_clone(orig == null ? 0 : orig.ptr & ~1); + public DataLossProtect clone() { + long ret = bindings.DataLossProtect_clone(this.ptr); DataLossProtect ret_hu_conv = new DataLossProtect(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java b/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java new file mode 100644 index 00000000..4d2e621d --- /dev/null +++ b/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java @@ -0,0 +1,45 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class DirectedChannelTransactionParameters extends CommonBase { + DirectedChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.DirectedChannelTransactionParameters_free(ptr); } + } + + public ChannelPublicKeys broadcaster_pubkeys() { + long ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr); + ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + return ret_hu_conv; + } + + public ChannelPublicKeys countersignatory_pubkeys() { + long ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr); + ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + return ret_hu_conv; + } + + public short contest_delay() { + short ret = bindings.DirectedChannelTransactionParameters_contest_delay(this.ptr); + return ret; + } + + public boolean is_outbound() { + boolean ret = bindings.DirectedChannelTransactionParameters_is_outbound(this.ptr); + return ret; + } + + public OutPoint funding_outpoint() { + long ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr); + OutPoint ret_hu_conv = new OutPoint(null, ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java index 6120b30e..eaef8705 100644 --- a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java +++ b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java @@ -50,6 +50,17 @@ public class DirectionalChannelInfo extends CommonBase { bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val); } + public RoutingFees get_fees() { + long ret = bindings.DirectionalChannelInfo_get_fees(this.ptr); + RoutingFees ret_hu_conv = new RoutingFees(null, ret); + return ret_hu_conv; + } + + public void set_fees(RoutingFees val) { + bindings.DirectionalChannelInfo_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + public ChannelUpdate get_last_update_message() { long ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr); ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret); @@ -61,9 +72,8 @@ public class DirectionalChannelInfo extends CommonBase { this.ptrs_to.add(val); } - public byte[] write(DirectionalChannelInfo obj) { - byte[] ret = bindings.DirectionalChannelInfo_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.DirectionalChannelInfo_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/ErrorMessage.java b/src/main/java/org/ldk/structs/ErrorMessage.java index df76af01..c6758fdf 100644 --- a/src/main/java/org/ldk/structs/ErrorMessage.java +++ b/src/main/java/org/ldk/structs/ErrorMessage.java @@ -14,10 +14,9 @@ public class ErrorMessage extends CommonBase { if (ptr != 0) { bindings.ErrorMessage_free(ptr); } } - public static ErrorMessage constructor_clone(ErrorMessage orig) { - long ret = bindings.ErrorMessage_clone(orig == null ? 0 : orig.ptr & ~1); + public ErrorMessage clone() { + long ret = bindings.ErrorMessage_clone(this.ptr); ErrorMessage ret_hu_conv = new ErrorMessage(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -50,9 +49,9 @@ public class ErrorMessage extends CommonBase { return ret; } - public static ErrorMessage constructor_read(byte[] ser) { + public static Result_ErrorMessageDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ErrorMessage_read(ser); - ErrorMessage ret_hu_conv = new ErrorMessage(null, ret); + Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/FundingCreated.java b/src/main/java/org/ldk/structs/FundingCreated.java index e5e0ff9a..42be833b 100644 --- a/src/main/java/org/ldk/structs/FundingCreated.java +++ b/src/main/java/org/ldk/structs/FundingCreated.java @@ -14,10 +14,9 @@ public class FundingCreated extends CommonBase { if (ptr != 0) { bindings.FundingCreated_free(ptr); } } - public static FundingCreated constructor_clone(FundingCreated orig) { - long ret = bindings.FundingCreated_clone(orig == null ? 0 : orig.ptr & ~1); + public FundingCreated clone() { + long ret = bindings.FundingCreated_clone(this.ptr); FundingCreated ret_hu_conv = new FundingCreated(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -63,9 +62,8 @@ public class FundingCreated extends CommonBase { return ret_hu_conv; } - public byte[] write(FundingCreated obj) { - byte[] ret = bindings.FundingCreated_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.FundingCreated_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/FundingLocked.java b/src/main/java/org/ldk/structs/FundingLocked.java index e6e2eea5..c46b3183 100644 --- a/src/main/java/org/ldk/structs/FundingLocked.java +++ b/src/main/java/org/ldk/structs/FundingLocked.java @@ -14,10 +14,9 @@ public class FundingLocked extends CommonBase { if (ptr != 0) { bindings.FundingLocked_free(ptr); } } - public static FundingLocked constructor_clone(FundingLocked orig) { - long ret = bindings.FundingLocked_clone(orig == null ? 0 : orig.ptr & ~1); + public FundingLocked clone() { + long ret = bindings.FundingLocked_clone(this.ptr); FundingLocked ret_hu_conv = new FundingLocked(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -45,9 +44,8 @@ public class FundingLocked extends CommonBase { return ret_hu_conv; } - public byte[] write(FundingLocked obj) { - byte[] ret = bindings.FundingLocked_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.FundingLocked_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/FundingSigned.java b/src/main/java/org/ldk/structs/FundingSigned.java index 9af23467..899d17d8 100644 --- a/src/main/java/org/ldk/structs/FundingSigned.java +++ b/src/main/java/org/ldk/structs/FundingSigned.java @@ -14,10 +14,9 @@ public class FundingSigned extends CommonBase { if (ptr != 0) { bindings.FundingSigned_free(ptr); } } - public static FundingSigned constructor_clone(FundingSigned orig) { - long ret = bindings.FundingSigned_clone(orig == null ? 0 : orig.ptr & ~1); + public FundingSigned clone() { + long ret = bindings.FundingSigned_clone(this.ptr); FundingSigned ret_hu_conv = new FundingSigned(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -45,9 +44,8 @@ public class FundingSigned extends CommonBase { return ret_hu_conv; } - public byte[] write(FundingSigned obj) { - byte[] ret = bindings.FundingSigned_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.FundingSigned_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/GossipTimestampFilter.java b/src/main/java/org/ldk/structs/GossipTimestampFilter.java index 6e039017..6443e409 100644 --- a/src/main/java/org/ldk/structs/GossipTimestampFilter.java +++ b/src/main/java/org/ldk/structs/GossipTimestampFilter.java @@ -14,10 +14,9 @@ public class GossipTimestampFilter extends CommonBase { if (ptr != 0) { bindings.GossipTimestampFilter_free(ptr); } } - public static GossipTimestampFilter constructor_clone(GossipTimestampFilter orig) { - long ret = bindings.GossipTimestampFilter_clone(orig == null ? 0 : orig.ptr & ~1); + public GossipTimestampFilter clone() { + long ret = bindings.GossipTimestampFilter_clone(this.ptr); GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -54,9 +53,9 @@ public class GossipTimestampFilter extends CommonBase { return ret_hu_conv; } - public static GossipTimestampFilter constructor_read(byte[] ser) { + public static Result_GossipTimestampFilterDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.GossipTimestampFilter_read(ser); - GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); + Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); 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 54745ba9..1697e301 100644 --- a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java +++ b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java @@ -14,10 +14,9 @@ public class HTLCOutputInCommitment extends CommonBase { if (ptr != 0) { bindings.HTLCOutputInCommitment_free(ptr); } } - public static HTLCOutputInCommitment constructor_clone(HTLCOutputInCommitment orig) { - long ret = bindings.HTLCOutputInCommitment_clone(orig == null ? 0 : orig.ptr & ~1); + public HTLCOutputInCommitment clone() { + long ret = bindings.HTLCOutputInCommitment_clone(this.ptr); HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -57,9 +56,8 @@ public class HTLCOutputInCommitment extends CommonBase { bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val); } - public byte[] write(HTLCOutputInCommitment obj) { - byte[] ret = bindings.HTLCOutputInCommitment_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.HTLCOutputInCommitment_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/HTLCUpdate.java b/src/main/java/org/ldk/structs/HTLCUpdate.java index 2f5fb3e3..7313e867 100644 --- a/src/main/java/org/ldk/structs/HTLCUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCUpdate.java @@ -14,16 +14,14 @@ public class HTLCUpdate extends CommonBase { if (ptr != 0) { bindings.HTLCUpdate_free(ptr); } } - public static HTLCUpdate constructor_clone(HTLCUpdate orig) { - long ret = bindings.HTLCUpdate_clone(orig == null ? 0 : orig.ptr & ~1); + public HTLCUpdate clone() { + long ret = bindings.HTLCUpdate_clone(this.ptr); HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } - public byte[] write(HTLCUpdate obj) { - byte[] ret = bindings.HTLCUpdate_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.HTLCUpdate_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java index a864aa06..fd95bef2 100644 --- a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java @@ -14,22 +14,12 @@ public class HolderCommitmentTransaction extends CommonBase { if (ptr != 0) { bindings.HolderCommitmentTransaction_free(ptr); } } - public static HolderCommitmentTransaction constructor_clone(HolderCommitmentTransaction orig) { - long ret = bindings.HolderCommitmentTransaction_clone(orig == null ? 0 : orig.ptr & ~1); + public HolderCommitmentTransaction clone() { + long ret = bindings.HolderCommitmentTransaction_clone(this.ptr); HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } - public byte[] get_unsigned_tx() { - byte[] ret = bindings.HolderCommitmentTransaction_get_unsigned_tx(this.ptr); - return ret; - } - - public void set_unsigned_tx(byte[] val) { - bindings.HolderCommitmentTransaction_set_unsigned_tx(this.ptr, val); - } - public byte[] get_counterparty_sig() { byte[] ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr); return ret; @@ -39,49 +29,8 @@ public class HolderCommitmentTransaction extends CommonBase { bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, val); } - public int get_feerate_per_kw() { - int ret = bindings.HolderCommitmentTransaction_get_feerate_per_kw(this.ptr); - return ret; - } - - public void set_feerate_per_kw(int val) { - bindings.HolderCommitmentTransaction_set_feerate_per_kw(this.ptr, val); - } - - public void set_per_htlc(TwoTuple[] val) { - bindings.HolderCommitmentTransaction_set_per_htlc(this.ptr, Arrays.stream(val).mapToLong(arr_conv_42 -> bindings.C2Tuple_HTLCOutputInCommitmentSignatureZ_new(arr_conv_42.a == null ? 0 : arr_conv_42.a.ptr & ~1/*XXX: this.ptrs_to.add(arr_conv_42_a)*/, arr_conv_42.b)).toArray()); - /* TODO 2 TwoTuple */; - } - - public static HolderCommitmentTransaction constructor_new_missing_holder_sig(byte[] unsigned_tx, byte[] counterparty_sig, byte[] holder_funding_key, byte[] counterparty_funding_key, TxCreationKeys keys, int feerate_per_kw, TwoTuple[] htlc_data) { - long ret = bindings.HolderCommitmentTransaction_new_missing_holder_sig(unsigned_tx, counterparty_sig, holder_funding_key, counterparty_funding_key, keys == null ? 0 : keys.ptr & ~1, feerate_per_kw, Arrays.stream(htlc_data).mapToLong(arr_conv_42 -> bindings.C2Tuple_HTLCOutputInCommitmentSignatureZ_new(arr_conv_42.a == null ? 0 : arr_conv_42.a.ptr & ~1/*XXX: this.ptrs_to.add(arr_conv_42_a)*/, arr_conv_42.b)).toArray()); - HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret); - ret_hu_conv.ptrs_to.add(keys); - /* TODO 2 TwoTuple */; - return ret_hu_conv; - } - - public TxCreationKeys trust_key_derivation() { - long ret = bindings.HolderCommitmentTransaction_trust_key_derivation(this.ptr); - TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); - return ret_hu_conv; - } - - public byte[] txid() { - byte[] ret = bindings.HolderCommitmentTransaction_txid(this.ptr); - return ret; - } - - public byte[] get_holder_sig(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) { - byte[] ret = bindings.HolderCommitmentTransaction_get_holder_sig(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis); - return ret; - } - - public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, short counterparty_selected_contest_delay) { - long ret = bindings.HolderCommitmentTransaction_get_htlc_sigs(this.ptr, htlc_base_key, counterparty_selected_contest_delay); - Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); - return ret_hu_conv; + public void set_counterparty_htlc_sigs(byte[][] val) { + bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val); } public byte[] write() { @@ -95,4 +44,11 @@ public class HolderCommitmentTransaction extends CommonBase { return ret_hu_conv; } + public static HolderCommitmentTransaction constructor_new(CommitmentTransaction commitment_tx, byte[] counterparty_sig, byte[][] counterparty_htlc_sigs, byte[] holder_funding_key, byte[] counterparty_funding_key) { + long ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr & ~1, counterparty_sig, counterparty_htlc_sigs, holder_funding_key, counterparty_funding_key); + HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret); + ret_hu_conv.ptrs_to.add(commitment_tx); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/InMemoryChannelKeys.java b/src/main/java/org/ldk/structs/InMemoryChannelKeys.java index 53210e29..01e2d484 100644 --- a/src/main/java/org/ldk/structs/InMemoryChannelKeys.java +++ b/src/main/java/org/ldk/structs/InMemoryChannelKeys.java @@ -14,10 +14,9 @@ public class InMemoryChannelKeys extends CommonBase { if (ptr != 0) { bindings.InMemoryChannelKeys_free(ptr); } } - public static InMemoryChannelKeys constructor_clone(InMemoryChannelKeys orig) { - long ret = bindings.InMemoryChannelKeys_clone(orig == null ? 0 : orig.ptr & ~1); + public InMemoryChannelKeys clone() { + long ret = bindings.InMemoryChannelKeys_clone(this.ptr); InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -97,6 +96,23 @@ public class InMemoryChannelKeys extends CommonBase { return ret; } + public boolean is_outbound() { + boolean ret = bindings.InMemoryChannelKeys_is_outbound(this.ptr); + return ret; + } + + public OutPoint funding_outpoint() { + long ret = bindings.InMemoryChannelKeys_funding_outpoint(this.ptr); + OutPoint ret_hu_conv = new OutPoint(null, ret); + return ret_hu_conv; + } + + public ChannelTransactionParameters get_channel_parameters() { + long ret = bindings.InMemoryChannelKeys_get_channel_parameters(this.ptr); + ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + return ret_hu_conv; + } + public ChannelKeys as_ChannelKeys() { long ret = bindings.InMemoryChannelKeys_as_ChannelKeys(this.ptr); ChannelKeys ret_hu_conv = new ChannelKeys(null, ret); @@ -109,9 +125,9 @@ public class InMemoryChannelKeys extends CommonBase { return ret; } - public static InMemoryChannelKeys constructor_read(byte[] ser) { + public static Result_InMemoryChannelKeysDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.InMemoryChannelKeys_read(ser); - InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret); + Result_InMemoryChannelKeysDecodeErrorZ ret_hu_conv = Result_InMemoryChannelKeysDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Init.java b/src/main/java/org/ldk/structs/Init.java index 0efe9484..7da0c6c1 100644 --- a/src/main/java/org/ldk/structs/Init.java +++ b/src/main/java/org/ldk/structs/Init.java @@ -14,10 +14,9 @@ public class Init extends CommonBase { if (ptr != 0) { bindings.Init_free(ptr); } } - public static Init constructor_clone(Init orig) { - long ret = bindings.Init_clone(orig == null ? 0 : orig.ptr & ~1); + public Init clone() { + long ret = bindings.Init_clone(this.ptr); Init ret_hu_conv = new Init(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -26,9 +25,9 @@ public class Init extends CommonBase { return ret; } - public static Init constructor_read(byte[] ser) { + public static Result_InitDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.Init_read(ser); - Init ret_hu_conv = new Init(null, ret); + Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/KeysInterface.java b/src/main/java/org/ldk/structs/KeysInterface.java index cc934aef..1a715877 100644 --- a/src/main/java/org/ldk/structs/KeysInterface.java +++ b/src/main/java/org/ldk/structs/KeysInterface.java @@ -25,6 +25,7 @@ public class KeysInterface extends CommonBase { byte[] get_shutdown_pubkey(); ChannelKeys get_channel_keys(boolean inbound, long channel_value_satoshis); byte[] get_secure_random_bytes(); + Result_ChanKeySignerDecodeErrorZ read_chan_signer(byte[] reader); } private static class LDKKeysInterfaceHolder { KeysInterface held; } public static KeysInterface new_impl(KeysInterfaceInterface arg) { @@ -52,6 +53,12 @@ public class KeysInterface extends CommonBase { byte[] ret = arg.get_secure_random_bytes(); return ret; } + @Override public long read_chan_signer(byte[] reader) { + Result_ChanKeySignerDecodeErrorZ ret = arg.read_chan_signer(reader); + long result = ret != null ? ret.ptr : 0; + ret.ptr = 0; + return result; + } }); return impl_holder.held; } @@ -82,4 +89,10 @@ public class KeysInterface extends CommonBase { return ret; } + public Result_ChanKeySignerDecodeErrorZ read_chan_signer(byte[] reader) { + long ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader); + Result_ChanKeySignerDecodeErrorZ ret_hu_conv = Result_ChanKeySignerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/MessageSendEvent.java b/src/main/java/org/ldk/structs/MessageSendEvent.java index 8a58fe14..30b7548f 100644 --- a/src/main/java/org/ldk/structs/MessageSendEvent.java +++ b/src/main/java/org/ldk/structs/MessageSendEvent.java @@ -63,6 +63,12 @@ public class MessageSendEvent extends CommonBase { if (raw_val.getClass() == bindings.LDKMessageSendEvent.PaymentFailureNetworkUpdate.class) { return new PaymentFailureNetworkUpdate(ptr, (bindings.LDKMessageSendEvent.PaymentFailureNetworkUpdate)raw_val); } + if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelRangeQuery.class) { + return new SendChannelRangeQuery(ptr, (bindings.LDKMessageSendEvent.SendChannelRangeQuery)raw_val); + } + if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShortIdsQuery.class) { + return new SendShortIdsQuery(ptr, (bindings.LDKMessageSendEvent.SendShortIdsQuery)raw_val); + } assert false; return null; // Unreachable without extending the (internal) bindings interface } @@ -240,4 +246,26 @@ public class MessageSendEvent extends CommonBase { this.update = update_hu_conv; } } + public final static class SendChannelRangeQuery extends MessageSendEvent { + public final byte[] node_id; + public final QueryChannelRange msg; + private SendChannelRangeQuery(long ptr, bindings.LDKMessageSendEvent.SendChannelRangeQuery obj) { + super(null, ptr); + this.node_id = obj.node_id; + long msg = obj.msg; + QueryChannelRange msg_hu_conv = new QueryChannelRange(null, msg); + this.msg = msg_hu_conv; + } + } + public final static class SendShortIdsQuery extends MessageSendEvent { + public final byte[] node_id; + public final QueryShortChannelIds msg; + private SendShortIdsQuery(long ptr, bindings.LDKMessageSendEvent.SendShortIdsQuery obj) { + super(null, ptr); + this.node_id = obj.node_id; + long msg = obj.msg; + QueryShortChannelIds msg_hu_conv = new QueryShortChannelIds(null, msg); + this.msg = msg_hu_conv; + } + } } diff --git a/src/main/java/org/ldk/structs/MonitorEvent.java b/src/main/java/org/ldk/structs/MonitorEvent.java index 7fd2ab6e..bbe27e36 100644 --- a/src/main/java/org/ldk/structs/MonitorEvent.java +++ b/src/main/java/org/ldk/structs/MonitorEvent.java @@ -14,10 +14,9 @@ public class MonitorEvent extends CommonBase { if (ptr != 0) { bindings.MonitorEvent_free(ptr); } } - public static MonitorEvent constructor_clone(MonitorEvent orig) { - long ret = bindings.MonitorEvent_clone(orig == null ? 0 : orig.ptr & ~1); + public MonitorEvent clone() { + long ret = bindings.MonitorEvent_clone(this.ptr); MonitorEvent ret_hu_conv = new MonitorEvent(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java b/src/main/java/org/ldk/structs/NetGraphMsgHandler.java index 4327d100..3fba8fa4 100644 --- a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java +++ b/src/main/java/org/ldk/structs/NetGraphMsgHandler.java @@ -14,15 +14,22 @@ public class NetGraphMsgHandler extends CommonBase { if (ptr != 0) { bindings.NetGraphMsgHandler_free(ptr); } } - public static NetGraphMsgHandler constructor_new(Access chain_access, Logger logger) { - long ret = bindings.NetGraphMsgHandler_new(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr); + public static NetGraphMsgHandler constructor_new(byte[] genesis_hash, Access chain_access, Logger logger) { + long ret = bindings.NetGraphMsgHandler_new(genesis_hash, chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr); + NetGraphMsgHandler ret_hu_conv = new NetGraphMsgHandler(null, ret); + ret_hu_conv.ptrs_to.add(chain_access); + ret_hu_conv.ptrs_to.add(logger); + return ret_hu_conv; + } + + public static NetGraphMsgHandler constructor_from_net_graph(Access chain_access, Logger logger, byte[] network_graph_genesis_hash) { + long ret = bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, bindings.NetworkGraph_new(network_graph_genesis_hash)); NetGraphMsgHandler ret_hu_conv = new NetGraphMsgHandler(null, ret); ret_hu_conv.ptrs_to.add(chain_access); ret_hu_conv.ptrs_to.add(logger); return ret_hu_conv; } - // Skipped NetGraphMsgHandler_from_net_graph public LockedNetworkGraph read_locked_graph() { long ret = bindings.NetGraphMsgHandler_read_locked_graph(this.ptr); LockedNetworkGraph ret_hu_conv = new LockedNetworkGraph(null, ret); @@ -36,4 +43,11 @@ public class NetGraphMsgHandler extends CommonBase { return ret_hu_conv; } + public MessageSendEventsProvider as_MessageSendEventsProvider() { + long ret = bindings.NetGraphMsgHandler_as_MessageSendEventsProvider(this.ptr); + MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/NetworkGraph.java b/src/main/java/org/ldk/structs/NetworkGraph.java index f39cb94e..778e475b 100644 --- a/src/main/java/org/ldk/structs/NetworkGraph.java +++ b/src/main/java/org/ldk/structs/NetworkGraph.java @@ -19,20 +19,64 @@ public class NetworkGraph extends CommonBase { return ret; } - public static NetworkGraph constructor_read(byte[] ser) { + public static Result_NetworkGraphDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.NetworkGraph_read(ser); - NetworkGraph ret_hu_conv = new NetworkGraph(null, ret); + Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public static NetworkGraph constructor_new() { - long ret = bindings.NetworkGraph_new(); + public static NetworkGraph constructor_new(byte[] genesis_hash) { + long ret = bindings.NetworkGraph_new(genesis_hash); NetworkGraph ret_hu_conv = new NetworkGraph(null, ret); return ret_hu_conv; } + public Result_NoneLightningErrorZ update_node_from_announcement(NodeAnnouncement msg) { + long ret = bindings.NetworkGraph_update_node_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(msg); + return ret_hu_conv; + } + + public Result_NoneLightningErrorZ update_node_from_unsigned_announcement(UnsignedNodeAnnouncement msg) { + long ret = bindings.NetworkGraph_update_node_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(msg); + return ret_hu_conv; + } + + public Result_NoneLightningErrorZ update_channel_from_announcement(ChannelAnnouncement msg, Access chain_access) { + long ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access == null ? 0 : chain_access.ptr); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(msg); + this.ptrs_to.add(chain_access); + return ret_hu_conv; + } + + public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(UnsignedChannelAnnouncement msg, Access chain_access) { + long ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access == null ? 0 : chain_access.ptr); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(msg); + this.ptrs_to.add(chain_access); + return ret_hu_conv; + } + public void close_channel_from_update(long short_channel_id, boolean is_permanent) { bindings.NetworkGraph_close_channel_from_update(this.ptr, short_channel_id, is_permanent); } + public Result_NoneLightningErrorZ update_channel(ChannelUpdate msg) { + long ret = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : msg.ptr & ~1); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(msg); + return ret_hu_conv; + } + + public Result_NoneLightningErrorZ update_channel_unsigned(UnsignedChannelUpdate msg) { + long ret = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg == null ? 0 : msg.ptr & ~1); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(msg); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/NodeAnnouncement.java b/src/main/java/org/ldk/structs/NodeAnnouncement.java index 55b76655..4a151d13 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncement.java @@ -14,10 +14,9 @@ public class NodeAnnouncement extends CommonBase { if (ptr != 0) { bindings.NodeAnnouncement_free(ptr); } } - public static NodeAnnouncement constructor_clone(NodeAnnouncement orig) { - long ret = bindings.NodeAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1); + public NodeAnnouncement clone() { + long ret = bindings.NodeAnnouncement_clone(this.ptr); NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -48,9 +47,8 @@ public class NodeAnnouncement extends CommonBase { return ret_hu_conv; } - public byte[] write(NodeAnnouncement obj) { - byte[] ret = bindings.NodeAnnouncement_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.NodeAnnouncement_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java index a7979950..0ce531e5 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java @@ -20,7 +20,11 @@ public class NodeAnnouncementInfo extends CommonBase { return ret_hu_conv; } - // Skipped NodeAnnouncementInfo_set_features + public void set_features(NodeFeatures val) { + bindings.NodeAnnouncementInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + public int get_last_update() { int ret = bindings.NodeAnnouncementInfo_get_last_update(this.ptr); return ret; @@ -78,9 +82,9 @@ public class NodeAnnouncementInfo extends CommonBase { return ret; } - public static NodeAnnouncementInfo constructor_read(byte[] ser) { + public static Result_NodeAnnouncementInfoDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.NodeAnnouncementInfo_read(ser); - NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret); + Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/NodeInfo.java b/src/main/java/org/ldk/structs/NodeInfo.java index 5f4aed27..018d5bc4 100644 --- a/src/main/java/org/ldk/structs/NodeInfo.java +++ b/src/main/java/org/ldk/structs/NodeInfo.java @@ -35,16 +35,28 @@ public class NodeInfo extends CommonBase { return ret_hu_conv; } - // Skipped NodeInfo_set_announcement_info - // Skipped NodeInfo_new + public void set_announcement_info(NodeFeatures val_features_arg, int val_last_update_arg, byte[] val_rgb_arg, byte[] val_alias_arg, NetAddress[] val_addresses_arg, NodeAnnouncement val_announcement_message_arg) { + bindings.NodeInfo_set_announcement_info(this.ptr, bindings.NodeAnnouncementInfo_new(val_features_arg == null ? 0 : val_features_arg.ptr & ~1, val_last_update_arg, val_rgb_arg, val_alias_arg, Arrays.stream(val_addresses_arg).mapToLong(arr_conv_12 -> arr_conv_12.ptr).toArray(), val_announcement_message_arg == null ? 0 : val_announcement_message_arg.ptr & ~1)); + } + + public static NodeInfo constructor_new(long[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeFeatures announcement_info_arg_features_arg, int announcement_info_arg_last_update_arg, byte[] announcement_info_arg_rgb_arg, byte[] announcement_info_arg_alias_arg, NetAddress[] announcement_info_arg_addresses_arg, NodeAnnouncement announcement_info_arg_announcement_message_arg) { + long ret = bindings.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg == null ? 0 : lowest_inbound_channel_fees_arg.ptr & ~1, bindings.NodeAnnouncementInfo_new(announcement_info_arg_features_arg == null ? 0 : announcement_info_arg_features_arg.ptr & ~1, announcement_info_arg_last_update_arg, announcement_info_arg_rgb_arg, announcement_info_arg_alias_arg, Arrays.stream(announcement_info_arg_addresses_arg).mapToLong(arr_conv_12 -> arr_conv_12.ptr).toArray(), announcement_info_arg_announcement_message_arg == null ? 0 : announcement_info_arg_announcement_message_arg.ptr & ~1)); + NodeInfo ret_hu_conv = new NodeInfo(null, ret); + ret_hu_conv.ptrs_to.add(lowest_inbound_channel_fees_arg); + ret_hu_conv.ptrs_to.add(announcement_info_arg_features_arg); + /* TODO 2 NetAddress */; + ret_hu_conv.ptrs_to.add(announcement_info_arg_announcement_message_arg); + return ret_hu_conv; + } + public byte[] write() { byte[] ret = bindings.NodeInfo_write(this.ptr); return ret; } - public static NodeInfo constructor_read(byte[] ser) { + public static Result_NodeInfoDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.NodeInfo_read(ser); - NodeInfo ret_hu_conv = new NodeInfo(null, ret); + Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OpenChannel.java b/src/main/java/org/ldk/structs/OpenChannel.java index 32fe0ec7..0a99f832 100644 --- a/src/main/java/org/ldk/structs/OpenChannel.java +++ b/src/main/java/org/ldk/structs/OpenChannel.java @@ -14,10 +14,9 @@ public class OpenChannel extends CommonBase { if (ptr != 0) { bindings.OpenChannel_free(ptr); } } - public static OpenChannel constructor_clone(OpenChannel orig) { - long ret = bindings.OpenChannel_clone(orig == null ? 0 : orig.ptr & ~1); + public OpenChannel clone() { + long ret = bindings.OpenChannel_clone(this.ptr); OpenChannel ret_hu_conv = new OpenChannel(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -183,9 +182,8 @@ public class OpenChannel extends CommonBase { bindings.OpenChannel_set_channel_flags(this.ptr, val); } - public byte[] write(OpenChannel obj) { - byte[] ret = bindings.OpenChannel_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.OpenChannel_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/OutPoint.java b/src/main/java/org/ldk/structs/OutPoint.java index 74af3416..605d2160 100644 --- a/src/main/java/org/ldk/structs/OutPoint.java +++ b/src/main/java/org/ldk/structs/OutPoint.java @@ -14,10 +14,9 @@ public class OutPoint extends CommonBase { if (ptr != 0) { bindings.OutPoint_free(ptr); } } - public static OutPoint constructor_clone(OutPoint orig) { - long ret = bindings.OutPoint_clone(orig == null ? 0 : orig.ptr & ~1); + public OutPoint clone() { + long ret = bindings.OutPoint_clone(this.ptr); OutPoint ret_hu_conv = new OutPoint(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -50,9 +49,8 @@ public class OutPoint extends CommonBase { return ret; } - public byte[] write(OutPoint obj) { - byte[] ret = bindings.OutPoint_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.OutPoint_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/PeerManager.java b/src/main/java/org/ldk/structs/PeerManager.java index 2bb4ba9b..22fe597f 100644 --- a/src/main/java/org/ldk/structs/PeerManager.java +++ b/src/main/java/org/ldk/structs/PeerManager.java @@ -31,7 +31,6 @@ public class PeerManager extends CommonBase { public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, SocketDescriptor descriptor) { long ret = bindings.PeerManager_new_outbound_connection(this.ptr, their_node_id, descriptor == null ? 0 : descriptor.ptr); Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(descriptor); return ret_hu_conv; } @@ -39,7 +38,6 @@ public class PeerManager extends CommonBase { public Result_NonePeerHandleErrorZ new_inbound_connection(SocketDescriptor descriptor) { long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : descriptor.ptr); Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(descriptor); return ret_hu_conv; } @@ -47,7 +45,6 @@ public class PeerManager extends CommonBase { public Result_NonePeerHandleErrorZ write_buffer_space_avail(SocketDescriptor descriptor) { long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : descriptor.ptr); Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(descriptor); return ret_hu_conv; } @@ -55,7 +52,6 @@ public class PeerManager extends CommonBase { public Result_boolPeerHandleErrorZ read_event(SocketDescriptor peer_descriptor, byte[] data) { long ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0 : peer_descriptor.ptr, data); Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(peer_descriptor); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Persist.java b/src/main/java/org/ldk/structs/Persist.java new file mode 100644 index 00000000..d9f5690e --- /dev/null +++ b/src/main/java/org/ldk/structs/Persist.java @@ -0,0 +1,67 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Persist extends CommonBase { + final bindings.LDKPersist bindings_instance; + Persist(Object _dummy, long ptr) { super(ptr); bindings_instance = null; } + private Persist(bindings.LDKPersist arg) { + super(bindings.LDKPersist_new(arg)); + this.ptrs_to.add(arg); + this.bindings_instance = arg; + } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.Persist_free(ptr); } super.finalize(); + } + + public static interface PersistInterface { + Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data); + Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data); + } + private static class LDKPersistHolder { Persist held; } + public static Persist new_impl(PersistInterface arg) { + final LDKPersistHolder impl_holder = new LDKPersistHolder(); + impl_holder.held = new Persist(new bindings.LDKPersist() { + @Override public long persist_new_channel(long id, long data) { + OutPoint id_hu_conv = new OutPoint(null, id); + ChannelMonitor data_hu_conv = new ChannelMonitor(null, data); + Result_NoneChannelMonitorUpdateErrZ ret = arg.persist_new_channel(id_hu_conv, data_hu_conv); + long result = ret != null ? ret.ptr : 0; + ret.ptr = 0; + return result; + } + @Override public long update_persisted_channel(long id, long update, long data) { + OutPoint id_hu_conv = new OutPoint(null, id); + ChannelMonitorUpdate update_hu_conv = new ChannelMonitorUpdate(null, update); + ChannelMonitor data_hu_conv = new ChannelMonitor(null, data); + Result_NoneChannelMonitorUpdateErrZ ret = arg.update_persisted_channel(id_hu_conv, update_hu_conv, data_hu_conv); + long result = ret != null ? ret.ptr : 0; + ret.ptr = 0; + return result; + } + }); + return impl_holder.held; + } + public Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data) { + long ret = bindings.Persist_persist_new_channel(this.ptr, id == null ? 0 : id.ptr & ~1, data == null ? 0 : data.ptr & ~1); + Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); + this.ptrs_to.add(id); + this.ptrs_to.add(data); + return ret_hu_conv; + } + + public Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data) { + long ret = bindings.Persist_update_persisted_channel(this.ptr, id == null ? 0 : id.ptr & ~1, update == null ? 0 : update.ptr & ~1, data == null ? 0 : data.ptr & ~1); + Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); + this.ptrs_to.add(id); + this.ptrs_to.add(update); + this.ptrs_to.add(data); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Ping.java b/src/main/java/org/ldk/structs/Ping.java index 25e970f7..3630dab0 100644 --- a/src/main/java/org/ldk/structs/Ping.java +++ b/src/main/java/org/ldk/structs/Ping.java @@ -14,10 +14,9 @@ public class Ping extends CommonBase { if (ptr != 0) { bindings.Ping_free(ptr); } } - public static Ping constructor_clone(Ping orig) { - long ret = bindings.Ping_clone(orig == null ? 0 : orig.ptr & ~1); + public Ping clone() { + long ret = bindings.Ping_clone(this.ptr); Ping ret_hu_conv = new Ping(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -50,9 +49,9 @@ public class Ping extends CommonBase { return ret; } - public static Ping constructor_read(byte[] ser) { + public static Result_PingDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.Ping_read(ser); - Ping ret_hu_conv = new Ping(null, ret); + Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Pong.java b/src/main/java/org/ldk/structs/Pong.java index d44e6bc4..854ba669 100644 --- a/src/main/java/org/ldk/structs/Pong.java +++ b/src/main/java/org/ldk/structs/Pong.java @@ -14,10 +14,9 @@ public class Pong extends CommonBase { if (ptr != 0) { bindings.Pong_free(ptr); } } - public static Pong constructor_clone(Pong orig) { - long ret = bindings.Pong_clone(orig == null ? 0 : orig.ptr & ~1); + public Pong clone() { + long ret = bindings.Pong_clone(this.ptr); Pong ret_hu_conv = new Pong(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -41,9 +40,9 @@ public class Pong extends CommonBase { return ret; } - public static Pong constructor_read(byte[] ser) { + public static Result_PongDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.Pong_read(ser); - Pong ret_hu_conv = new Pong(null, ret); + Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PreCalculatedTxCreationKeys.java b/src/main/java/org/ldk/structs/PreCalculatedTxCreationKeys.java deleted file mode 100644 index a05b2a72..00000000 --- a/src/main/java/org/ldk/structs/PreCalculatedTxCreationKeys.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; - -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class PreCalculatedTxCreationKeys extends CommonBase { - PreCalculatedTxCreationKeys(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.PreCalculatedTxCreationKeys_free(ptr); } - } - - public static PreCalculatedTxCreationKeys constructor_clone(PreCalculatedTxCreationKeys orig) { - long ret = bindings.PreCalculatedTxCreationKeys_clone(orig == null ? 0 : orig.ptr & ~1); - PreCalculatedTxCreationKeys ret_hu_conv = new PreCalculatedTxCreationKeys(null, ret); - ret_hu_conv.ptrs_to.add(orig); - return ret_hu_conv; - } - - public static PreCalculatedTxCreationKeys constructor_new(TxCreationKeys keys) { - long ret = bindings.PreCalculatedTxCreationKeys_new(keys == null ? 0 : keys.ptr & ~1); - PreCalculatedTxCreationKeys ret_hu_conv = new PreCalculatedTxCreationKeys(null, ret); - ret_hu_conv.ptrs_to.add(keys); - return ret_hu_conv; - } - - public TxCreationKeys trust_key_derivation() { - long ret = bindings.PreCalculatedTxCreationKeys_trust_key_derivation(this.ptr); - TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); - return ret_hu_conv; - } - - public byte[] per_commitment_point() { - byte[] ret = bindings.PreCalculatedTxCreationKeys_per_commitment_point(this.ptr); - return ret; - } - -} diff --git a/src/main/java/org/ldk/structs/QueryChannelRange.java b/src/main/java/org/ldk/structs/QueryChannelRange.java index ee29caf9..53491db5 100644 --- a/src/main/java/org/ldk/structs/QueryChannelRange.java +++ b/src/main/java/org/ldk/structs/QueryChannelRange.java @@ -14,10 +14,9 @@ public class QueryChannelRange extends CommonBase { if (ptr != 0) { bindings.QueryChannelRange_free(ptr); } } - public static QueryChannelRange constructor_clone(QueryChannelRange orig) { - long ret = bindings.QueryChannelRange_clone(orig == null ? 0 : orig.ptr & ~1); + public QueryChannelRange clone() { + long ret = bindings.QueryChannelRange_clone(this.ptr); QueryChannelRange ret_hu_conv = new QueryChannelRange(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -54,9 +53,9 @@ public class QueryChannelRange extends CommonBase { return ret_hu_conv; } - public static QueryChannelRange constructor_read(byte[] ser) { + public static Result_QueryChannelRangeDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.QueryChannelRange_read(ser); - QueryChannelRange ret_hu_conv = new QueryChannelRange(null, ret); + Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/QueryShortChannelIds.java b/src/main/java/org/ldk/structs/QueryShortChannelIds.java index e65af98f..1faab93a 100644 --- a/src/main/java/org/ldk/structs/QueryShortChannelIds.java +++ b/src/main/java/org/ldk/structs/QueryShortChannelIds.java @@ -14,10 +14,9 @@ public class QueryShortChannelIds extends CommonBase { if (ptr != 0) { bindings.QueryShortChannelIds_free(ptr); } } - public static QueryShortChannelIds constructor_clone(QueryShortChannelIds orig) { - long ret = bindings.QueryShortChannelIds_clone(orig == null ? 0 : orig.ptr & ~1); + public QueryShortChannelIds clone() { + long ret = bindings.QueryShortChannelIds_clone(this.ptr); QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -40,9 +39,9 @@ public class QueryShortChannelIds extends CommonBase { return ret_hu_conv; } - public static QueryShortChannelIds constructor_read(byte[] ser) { + public static Result_QueryShortChannelIdsDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.QueryShortChannelIds_read(ser); - QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret); + Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ReplyChannelRange.java b/src/main/java/org/ldk/structs/ReplyChannelRange.java index 90fc2555..d49f6a47 100644 --- a/src/main/java/org/ldk/structs/ReplyChannelRange.java +++ b/src/main/java/org/ldk/structs/ReplyChannelRange.java @@ -14,10 +14,9 @@ public class ReplyChannelRange extends CommonBase { if (ptr != 0) { bindings.ReplyChannelRange_free(ptr); } } - public static ReplyChannelRange constructor_clone(ReplyChannelRange orig) { - long ret = bindings.ReplyChannelRange_clone(orig == null ? 0 : orig.ptr & ~1); + public ReplyChannelRange clone() { + long ret = bindings.ReplyChannelRange_clone(this.ptr); ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -67,9 +66,9 @@ public class ReplyChannelRange extends CommonBase { return ret_hu_conv; } - public static ReplyChannelRange constructor_read(byte[] ser) { + public static Result_ReplyChannelRangeDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ReplyChannelRange_read(ser); - ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret); + Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java index 2be00711..224cc61b 100644 --- a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java +++ b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java @@ -14,10 +14,9 @@ public class ReplyShortChannelIdsEnd extends CommonBase { if (ptr != 0) { bindings.ReplyShortChannelIdsEnd_free(ptr); } } - public static ReplyShortChannelIdsEnd constructor_clone(ReplyShortChannelIdsEnd orig) { - long ret = bindings.ReplyShortChannelIdsEnd_clone(orig == null ? 0 : orig.ptr & ~1); + public ReplyShortChannelIdsEnd clone() { + long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr); ReplyShortChannelIdsEnd ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -45,9 +44,9 @@ public class ReplyShortChannelIdsEnd extends CommonBase { return ret_hu_conv; } - public static ReplyShortChannelIdsEnd constructor_read(byte[] ser) { + public static Result_ReplyShortChannelIdsEndDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ReplyShortChannelIdsEnd_read(ser); - ReplyShortChannelIdsEnd ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); + 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_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java new file mode 100644 index 00000000..fb1b5247 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java @@ -0,0 +1,51 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonBase { + private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(ptr)) { + return new Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK extends Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { + public final TwoTuple res; + private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(ptr); + byte[] res_a = bindings.LDKC2Tuple_BlockHashChannelManagerZ_get_a(res); + long res_b = bindings.LDKC2Tuple_BlockHashChannelManagerZ_get_b(res); + ChannelManager res_b_hu_conv = new ChannelManager(null, res_b);; + TwoTuple res_conv = new TwoTuple(res_a, res_b_hu_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/*XXX: this.ptrs_to.add(res_b)*/))); + } + } + + public static final class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err extends Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { + public final DecodeError err; + private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java new file mode 100644 index 00000000..fef8c632 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java @@ -0,0 +1,51 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonBase { + private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(ptr)) { + return new Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK extends Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { + public final TwoTuple res; + private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(ptr); + byte[] res_a = bindings.LDKC2Tuple_BlockHashChannelMonitorZ_get_a(res); + long res_b = bindings.LDKC2Tuple_BlockHashChannelMonitorZ_get_b(res); + ChannelMonitor res_b_hu_conv = new ChannelMonitor(null, res_b);; + TwoTuple res_conv = new TwoTuple(res_a, res_b_hu_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/*XXX: this.ptrs_to.add(res_b)*/))); + } + } + + public static final class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err extends Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { + public final DecodeError err; + private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} 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 db81132c..b58d3a8b 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 @@ -35,10 +35,8 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { } public static final class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err extends Result_C2Tuple_SignatureCVec_SignatureZZNoneZ { - public final byte err; private Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - this.err = bindings.LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(ptr); } public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err() { this(null, bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err()); diff --git a/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java new file mode 100644 index 00000000..0a0cfeb7 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java @@ -0,0 +1,48 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase { + private Result_CResult_NetAddressu8ZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_CResult_NetAddressu8ZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok(ptr)) { + return new Result_CResult_NetAddressu8ZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_CResult_NetAddressu8ZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_CResult_NetAddressu8ZDecodeErrorZ_OK extends Result_CResult_NetAddressu8ZDecodeErrorZ { + public final Result_NetAddressu8Z res; + private Result_CResult_NetAddressu8ZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(ptr); + 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 { + public final DecodeError err; + private Result_CResult_NetAddressu8ZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} 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 b1bc15c9..c70e7844 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java @@ -31,10 +31,8 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase { } public static final class Result_CVec_SignatureZNoneZ_Err extends Result_CVec_SignatureZNoneZ { - public final byte err; private Result_CVec_SignatureZNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - this.err = bindings.LDKCResult_CVec_SignatureZNoneZ_get_err(ptr); } public Result_CVec_SignatureZNoneZ_Err() { this(null, bindings.CResult_CVec_SignatureZNoneZ_err()); diff --git a/src/main/java/org/ldk/structs/Result_ChanKeySignerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChanKeySignerDecodeErrorZ.java new file mode 100644 index 00000000..1aa74eea --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ChanKeySignerDecodeErrorZ.java @@ -0,0 +1,50 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_ChanKeySignerDecodeErrorZ extends CommonBase { + private Result_ChanKeySignerDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ChanKeySignerDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ChanKeySignerDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_ChanKeySignerDecodeErrorZ_result_ok(ptr)) { + return new Result_ChanKeySignerDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ChanKeySignerDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ChanKeySignerDecodeErrorZ_OK extends Result_ChanKeySignerDecodeErrorZ { + public final ChannelKeys res; + private Result_ChanKeySignerDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_ChanKeySignerDecodeErrorZ_get_ok(ptr); + ChannelKeys ret_hu_conv = new ChannelKeys(null, res); + ret_hu_conv.ptrs_to.add(this); + this.res = ret_hu_conv; + } + public Result_ChanKeySignerDecodeErrorZ_OK(ChannelKeys res) { + this(null, bindings.CResult_ChanKeySignerDecodeErrorZ_ok(res == null ? 0 : res.ptr)); + this.ptrs_to.add(res); + } + } + + public static final class Result_ChanKeySignerDecodeErrorZ_Err extends Result_ChanKeySignerDecodeErrorZ { + public final DecodeError err; + private Result_ChanKeySignerDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_ChanKeySignerDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + this.err = err_hu_conv; + } + public Result_ChanKeySignerDecodeErrorZ_Err(DecodeError err) { + this(null, bindings.CResult_ChanKeySignerDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); + this.ptrs_to.add(err); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java new file mode 100644 index 00000000..0b1aa205 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { + private Result_ChannelMonitorUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ChannelMonitorUpdateDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok(ptr)) { + return new Result_ChannelMonitorUpdateDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ChannelMonitorUpdateDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ChannelMonitorUpdateDecodeErrorZ_OK extends Result_ChannelMonitorUpdateDecodeErrorZ { + public final ChannelMonitorUpdate res; + private Result_ChannelMonitorUpdateDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(ptr); + ChannelMonitorUpdate res_hu_conv = new ChannelMonitorUpdate(null, res); + 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 { + public final DecodeError err; + private Result_ChannelMonitorUpdateDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java new file mode 100644 index 00000000..e496269f --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { + private Result_ChannelReestablishDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ChannelReestablishDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ChannelReestablishDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(ptr)) { + return new Result_ChannelReestablishDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ChannelReestablishDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ChannelReestablishDecodeErrorZ_OK extends Result_ChannelReestablishDecodeErrorZ { + public final ChannelReestablish res; + private Result_ChannelReestablishDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(ptr); + ChannelReestablish res_hu_conv = new ChannelReestablish(null, res); + 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 { + public final DecodeError err; + private Result_ChannelReestablishDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_ChannelReestablishDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java new file mode 100644 index 00000000..c6e2bda9 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_ErrorMessageDecodeErrorZ extends CommonBase { + private Result_ErrorMessageDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ErrorMessageDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ErrorMessageDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_ErrorMessageDecodeErrorZ_result_ok(ptr)) { + return new Result_ErrorMessageDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ErrorMessageDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ErrorMessageDecodeErrorZ_OK extends Result_ErrorMessageDecodeErrorZ { + public final ErrorMessage res; + private Result_ErrorMessageDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_ErrorMessageDecodeErrorZ_get_ok(ptr); + ErrorMessage res_hu_conv = new ErrorMessage(null, res); + 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 { + public final DecodeError err; + private Result_ErrorMessageDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_ErrorMessageDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java new file mode 100644 index 00000000..fe376e70 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { + private Result_GossipTimestampFilterDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_GossipTimestampFilterDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_GossipTimestampFilterDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(ptr)) { + return new Result_GossipTimestampFilterDecodeErrorZ_OK(null, ptr); + } else { + return new Result_GossipTimestampFilterDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_GossipTimestampFilterDecodeErrorZ_OK extends Result_GossipTimestampFilterDecodeErrorZ { + public final GossipTimestampFilter res; + private Result_GossipTimestampFilterDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(ptr); + GossipTimestampFilter res_hu_conv = new GossipTimestampFilter(null, res); + 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 { + public final DecodeError err; + private Result_GossipTimestampFilterDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_InMemoryChannelKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InMemoryChannelKeysDecodeErrorZ.java new file mode 100644 index 00000000..ea33fa2c --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_InMemoryChannelKeysDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_InMemoryChannelKeysDecodeErrorZ extends CommonBase { + private Result_InMemoryChannelKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_InMemoryChannelKeysDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_InMemoryChannelKeysDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok(ptr)) { + return new Result_InMemoryChannelKeysDecodeErrorZ_OK(null, ptr); + } else { + return new Result_InMemoryChannelKeysDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_InMemoryChannelKeysDecodeErrorZ_OK extends Result_InMemoryChannelKeysDecodeErrorZ { + public final InMemoryChannelKeys res; + private Result_InMemoryChannelKeysDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(ptr); + InMemoryChannelKeys res_hu_conv = new InMemoryChannelKeys(null, res); + this.res = res_hu_conv; + } + public Result_InMemoryChannelKeysDecodeErrorZ_OK(InMemoryChannelKeys res) { + this(null, bindings.CResult_InMemoryChannelKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1)); + this.ptrs_to.add(res); + } + } + + public static final class Result_InMemoryChannelKeysDecodeErrorZ_Err extends Result_InMemoryChannelKeysDecodeErrorZ { + public final DecodeError err; + private Result_InMemoryChannelKeysDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + this.err = err_hu_conv; + } + public Result_InMemoryChannelKeysDecodeErrorZ_Err(DecodeError err) { + this(null, bindings.CResult_InMemoryChannelKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1)); + this.ptrs_to.add(err); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java new file mode 100644 index 00000000..8719e28c --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_InitDecodeErrorZ extends CommonBase { + private Result_InitDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_InitDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_InitDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_InitDecodeErrorZ_result_ok(ptr)) { + return new Result_InitDecodeErrorZ_OK(null, ptr); + } else { + return new Result_InitDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_InitDecodeErrorZ_OK extends Result_InitDecodeErrorZ { + public final Init res; + private Result_InitDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_InitDecodeErrorZ_get_ok(ptr); + Init res_hu_conv = new Init(null, res); + 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 { + public final DecodeError err; + private Result_InitDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_InitDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java b/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java new file mode 100644 index 00000000..a2aa53da --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java @@ -0,0 +1,46 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_NetAddressu8Z extends CommonBase { + private Result_NetAddressu8Z(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_NetAddressu8Z_free(ptr); } super.finalize(); + } + + static Result_NetAddressu8Z constr_from_ptr(long ptr) { + if (bindings.LDKCResult_NetAddressu8Z_result_ok(ptr)) { + return new Result_NetAddressu8Z_OK(null, ptr); + } else { + return new Result_NetAddressu8Z_Err(null, ptr); + } + } + public static final class Result_NetAddressu8Z_OK extends Result_NetAddressu8Z { + public final NetAddress res; + private Result_NetAddressu8Z_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_NetAddressu8Z_get_ok(ptr); + NetAddress res_hu_conv = NetAddress.constr_from_ptr(res); + 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 { + public final byte err; + private Result_NetAddressu8Z_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + this.err = bindings.LDKCResult_NetAddressu8Z_get_err(ptr); + } + public Result_NetAddressu8Z_Err(byte err) { + this(null, bindings.CResult_NetAddressu8Z_err(err)); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java new file mode 100644 index 00000000..2d3f603d --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_NetworkGraphDecodeErrorZ extends CommonBase { + private Result_NetworkGraphDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_NetworkGraphDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_NetworkGraphDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_NetworkGraphDecodeErrorZ_result_ok(ptr)) { + return new Result_NetworkGraphDecodeErrorZ_OK(null, ptr); + } else { + return new Result_NetworkGraphDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_NetworkGraphDecodeErrorZ_OK extends Result_NetworkGraphDecodeErrorZ { + public final NetworkGraph res; + private Result_NetworkGraphDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_NetworkGraphDecodeErrorZ_get_ok(ptr); + NetworkGraph res_hu_conv = new NetworkGraph(null, res); + 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 { + public final DecodeError err; + private Result_NetworkGraphDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_NetworkGraphDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java new file mode 100644 index 00000000..3de2c49d --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { + private Result_NodeAnnouncementInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_NodeAnnouncementInfoDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(ptr)) { + return new Result_NodeAnnouncementInfoDecodeErrorZ_OK(null, ptr); + } else { + return new Result_NodeAnnouncementInfoDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_NodeAnnouncementInfoDecodeErrorZ_OK extends Result_NodeAnnouncementInfoDecodeErrorZ { + public final NodeAnnouncementInfo res; + private Result_NodeAnnouncementInfoDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(ptr); + NodeAnnouncementInfo res_hu_conv = new NodeAnnouncementInfo(null, res); + 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 { + public final DecodeError err; + private Result_NodeAnnouncementInfoDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java new file mode 100644 index 00000000..01d528e3 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_NodeInfoDecodeErrorZ extends CommonBase { + private Result_NodeInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_NodeInfoDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_NodeInfoDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_NodeInfoDecodeErrorZ_result_ok(ptr)) { + return new Result_NodeInfoDecodeErrorZ_OK(null, ptr); + } else { + return new Result_NodeInfoDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_NodeInfoDecodeErrorZ_OK extends Result_NodeInfoDecodeErrorZ { + public final NodeInfo res; + private Result_NodeInfoDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_NodeInfoDecodeErrorZ_get_ok(ptr); + NodeInfo res_hu_conv = new NodeInfo(null, res); + 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 { + public final DecodeError err; + private Result_NodeInfoDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_NodeInfoDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java index 974f8811..2eaacd34 100644 --- a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java @@ -20,10 +20,8 @@ public class Result_NoneAPIErrorZ extends CommonBase { } } public static final class Result_NoneAPIErrorZ_OK extends Result_NoneAPIErrorZ { - public final byte res; private Result_NoneAPIErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - this.res = bindings.LDKCResult_NoneAPIErrorZ_get_ok(ptr); } public Result_NoneAPIErrorZ_OK() { this(null, bindings.CResult_NoneAPIErrorZ_ok()); diff --git a/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java b/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java index 68d715e3..5d8da12c 100644 --- a/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java @@ -20,10 +20,8 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { } } public static final class Result_NoneChannelMonitorUpdateErrZ_OK extends Result_NoneChannelMonitorUpdateErrZ { - public final byte res; private Result_NoneChannelMonitorUpdateErrZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - this.res = bindings.LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(ptr); } public Result_NoneChannelMonitorUpdateErrZ_OK() { this(null, bindings.CResult_NoneChannelMonitorUpdateErrZ_ok()); diff --git a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java new file mode 100644 index 00000000..056bb41a --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java @@ -0,0 +1,44 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_NoneLightningErrorZ extends CommonBase { + private Result_NoneLightningErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_NoneLightningErrorZ_free(ptr); } super.finalize(); + } + + static Result_NoneLightningErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_NoneLightningErrorZ_result_ok(ptr)) { + return new Result_NoneLightningErrorZ_OK(null, ptr); + } else { + return new Result_NoneLightningErrorZ_Err(null, ptr); + } + } + public static final class Result_NoneLightningErrorZ_OK extends Result_NoneLightningErrorZ { + 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 { + public final LightningError err; + private Result_NoneLightningErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_NoneLightningErrorZ_get_err(ptr); + LightningError err_hu_conv = new LightningError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java index 281dce01..1a18d923 100644 --- a/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java @@ -20,10 +20,8 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase { } } public static final class Result_NoneMonitorUpdateErrorZ_OK extends Result_NoneMonitorUpdateErrorZ { - public final byte res; private Result_NoneMonitorUpdateErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - this.res = bindings.LDKCResult_NoneMonitorUpdateErrorZ_get_ok(ptr); } public Result_NoneMonitorUpdateErrorZ_OK() { this(null, bindings.CResult_NoneMonitorUpdateErrorZ_ok()); diff --git a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java index b6a47720..8bb2b037 100644 --- a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java @@ -20,10 +20,8 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { } } public static final class Result_NonePaymentSendFailureZ_OK extends Result_NonePaymentSendFailureZ { - public final byte res; private Result_NonePaymentSendFailureZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - this.res = bindings.LDKCResult_NonePaymentSendFailureZ_get_ok(ptr); } public Result_NonePaymentSendFailureZ_OK() { this(null, bindings.CResult_NonePaymentSendFailureZ_ok()); diff --git a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java index c7b31e13..c3aa3adf 100644 --- a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java @@ -20,10 +20,8 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { } } public static final class Result_NonePeerHandleErrorZ_OK extends Result_NonePeerHandleErrorZ { - public final byte res; private Result_NonePeerHandleErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - this.res = bindings.LDKCResult_NonePeerHandleErrorZ_get_ok(ptr); } public Result_NonePeerHandleErrorZ_OK() { this(null, bindings.CResult_NonePeerHandleErrorZ_ok()); diff --git a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java new file mode 100644 index 00000000..078fd1f8 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_PingDecodeErrorZ extends CommonBase { + private Result_PingDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_PingDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_PingDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_PingDecodeErrorZ_result_ok(ptr)) { + return new Result_PingDecodeErrorZ_OK(null, ptr); + } else { + return new Result_PingDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_PingDecodeErrorZ_OK extends Result_PingDecodeErrorZ { + public final Ping res; + private Result_PingDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_PingDecodeErrorZ_get_ok(ptr); + Ping res_hu_conv = new Ping(null, res); + 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 { + public final DecodeError err; + private Result_PingDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_PingDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java new file mode 100644 index 00000000..6ccd90dd --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_PongDecodeErrorZ extends CommonBase { + private Result_PongDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_PongDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_PongDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_PongDecodeErrorZ_result_ok(ptr)) { + return new Result_PongDecodeErrorZ_OK(null, ptr); + } else { + return new Result_PongDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_PongDecodeErrorZ_OK extends Result_PongDecodeErrorZ { + public final Pong res; + private Result_PongDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_PongDecodeErrorZ_get_ok(ptr); + Pong res_hu_conv = new Pong(null, res); + 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 { + public final DecodeError err; + private Result_PongDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_PongDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java new file mode 100644 index 00000000..9a94fdfb --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { + private Result_QueryChannelRangeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_QueryChannelRangeDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_QueryChannelRangeDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(ptr)) { + return new Result_QueryChannelRangeDecodeErrorZ_OK(null, ptr); + } else { + return new Result_QueryChannelRangeDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_QueryChannelRangeDecodeErrorZ_OK extends Result_QueryChannelRangeDecodeErrorZ { + public final QueryChannelRange res; + private Result_QueryChannelRangeDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(ptr); + QueryChannelRange res_hu_conv = new QueryChannelRange(null, res); + 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 { + public final DecodeError err; + private Result_QueryChannelRangeDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java new file mode 100644 index 00000000..822a6dd6 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { + private Result_QueryShortChannelIdsDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_QueryShortChannelIdsDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_QueryShortChannelIdsDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(ptr)) { + return new Result_QueryShortChannelIdsDecodeErrorZ_OK(null, ptr); + } else { + return new Result_QueryShortChannelIdsDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_QueryShortChannelIdsDecodeErrorZ_OK extends Result_QueryShortChannelIdsDecodeErrorZ { + public final QueryShortChannelIds res; + private Result_QueryShortChannelIdsDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(ptr); + QueryShortChannelIds res_hu_conv = new QueryShortChannelIds(null, res); + 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 { + public final DecodeError err; + private Result_QueryShortChannelIdsDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java new file mode 100644 index 00000000..9d86f09a --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { + private Result_ReplyChannelRangeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ReplyChannelRangeDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ReplyChannelRangeDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(ptr)) { + return new Result_ReplyChannelRangeDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ReplyChannelRangeDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ReplyChannelRangeDecodeErrorZ_OK extends Result_ReplyChannelRangeDecodeErrorZ { + public final ReplyChannelRange res; + private Result_ReplyChannelRangeDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(ptr); + ReplyChannelRange res_hu_conv = new ReplyChannelRange(null, res); + 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 { + public final DecodeError err; + private Result_ReplyChannelRangeDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java new file mode 100644 index 00000000..9db0c5d4 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { + private Result_ReplyShortChannelIdsEndDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ReplyShortChannelIdsEndDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(ptr)) { + return new Result_ReplyShortChannelIdsEndDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ReplyShortChannelIdsEndDecodeErrorZ_OK extends Result_ReplyShortChannelIdsEndDecodeErrorZ { + public final ReplyShortChannelIdsEnd res; + private Result_ReplyShortChannelIdsEndDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(ptr); + ReplyShortChannelIdsEnd res_hu_conv = new ReplyShortChannelIdsEnd(null, res); + 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 { + public final DecodeError err; + private Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java new file mode 100644 index 00000000..e1314330 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_RouteDecodeErrorZ extends CommonBase { + private Result_RouteDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_RouteDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_RouteDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_RouteDecodeErrorZ_result_ok(ptr)) { + return new Result_RouteDecodeErrorZ_OK(null, ptr); + } else { + return new Result_RouteDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_RouteDecodeErrorZ_OK extends Result_RouteDecodeErrorZ { + public final Route res; + private Result_RouteDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_RouteDecodeErrorZ_get_ok(ptr); + Route res_hu_conv = new Route(null, res); + 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 { + public final DecodeError err; + private Result_RouteDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_RouteDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java new file mode 100644 index 00000000..eda7ce3e --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_RoutingFeesDecodeErrorZ extends CommonBase { + private Result_RoutingFeesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_RoutingFeesDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_RoutingFeesDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_RoutingFeesDecodeErrorZ_result_ok(ptr)) { + return new Result_RoutingFeesDecodeErrorZ_OK(null, ptr); + } else { + return new Result_RoutingFeesDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_RoutingFeesDecodeErrorZ_OK extends Result_RoutingFeesDecodeErrorZ { + public final RoutingFees res; + private Result_RoutingFeesDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_RoutingFeesDecodeErrorZ_get_ok(ptr); + RoutingFees res_hu_conv = new RoutingFees(null, res); + 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 { + public final DecodeError err; + private Result_RoutingFeesDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_RoutingFeesDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java b/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java index 0e054a3b..304cbd86 100644 --- a/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java @@ -31,10 +31,8 @@ public class Result_SignatureNoneZ extends CommonBase { } public static final class Result_SignatureNoneZ_Err extends Result_SignatureNoneZ { - public final byte err; private Result_SignatureNoneZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - this.err = bindings.LDKCResult_SignatureNoneZ_get_err(ptr); } public Result_SignatureNoneZ_Err() { this(null, bindings.CResult_SignatureNoneZ_err()); diff --git a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java new file mode 100644 index 00000000..40c3b4ec --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { + private Result_SpendableOutputDescriptorDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_SpendableOutputDescriptorDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(ptr)) { + return new Result_SpendableOutputDescriptorDecodeErrorZ_OK(null, ptr); + } else { + return new Result_SpendableOutputDescriptorDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_SpendableOutputDescriptorDecodeErrorZ_OK extends Result_SpendableOutputDescriptorDecodeErrorZ { + public final SpendableOutputDescriptor res; + private Result_SpendableOutputDescriptorDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(ptr); + SpendableOutputDescriptor res_hu_conv = SpendableOutputDescriptor.constr_from_ptr(res); + 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 { + public final DecodeError err; + private Result_SpendableOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java new file mode 100644 index 00000000..a4a939f1 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java @@ -0,0 +1,44 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { + private Result_TrustedCommitmentTransactionNoneZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_TrustedCommitmentTransactionNoneZ_free(ptr); } super.finalize(); + } + + static Result_TrustedCommitmentTransactionNoneZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(ptr)) { + return new Result_TrustedCommitmentTransactionNoneZ_OK(null, ptr); + } else { + return new Result_TrustedCommitmentTransactionNoneZ_Err(null, ptr); + } + } + public static final class Result_TrustedCommitmentTransactionNoneZ_OK extends Result_TrustedCommitmentTransactionNoneZ { + public final TrustedCommitmentTransaction res; + private Result_TrustedCommitmentTransactionNoneZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(ptr); + TrustedCommitmentTransaction res_hu_conv = new TrustedCommitmentTransaction(null, res); + 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); + } + } + + 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()); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java new file mode 100644 index 00000000..2473f7a2 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { + private Result_UnsignedChannelAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_UnsignedChannelAnnouncementDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(ptr)) { + return new Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(null, ptr); + } else { + return new Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_UnsignedChannelAnnouncementDecodeErrorZ_OK extends Result_UnsignedChannelAnnouncementDecodeErrorZ { + public final UnsignedChannelAnnouncement res; + private Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(ptr); + UnsignedChannelAnnouncement res_hu_conv = new UnsignedChannelAnnouncement(null, res); + 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 { + public final DecodeError err; + private Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java new file mode 100644 index 00000000..627fdf69 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { + private Result_UnsignedChannelUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_UnsignedChannelUpdateDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(ptr)) { + return new Result_UnsignedChannelUpdateDecodeErrorZ_OK(null, ptr); + } else { + return new Result_UnsignedChannelUpdateDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_UnsignedChannelUpdateDecodeErrorZ_OK extends Result_UnsignedChannelUpdateDecodeErrorZ { + public final UnsignedChannelUpdate res; + private Result_UnsignedChannelUpdateDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(ptr); + UnsignedChannelUpdate res_hu_conv = new UnsignedChannelUpdate(null, res); + 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 { + public final DecodeError err; + private Result_UnsignedChannelUpdateDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java new file mode 100644 index 00000000..7493f14e --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java @@ -0,0 +1,49 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { + private Result_UnsignedNodeAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_UnsignedNodeAnnouncementDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(ptr)) { + return new Result_UnsignedNodeAnnouncementDecodeErrorZ_OK(null, ptr); + } else { + return new Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_UnsignedNodeAnnouncementDecodeErrorZ_OK extends Result_UnsignedNodeAnnouncementDecodeErrorZ { + public final UnsignedNodeAnnouncement res; + private Result_UnsignedNodeAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(ptr); + UnsignedNodeAnnouncement res_hu_conv = new UnsignedNodeAnnouncement(null, res); + 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 { + public final DecodeError err; + private Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = new DecodeError(null, err); + 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); + } + } +} diff --git a/src/main/java/org/ldk/structs/RevokeAndACK.java b/src/main/java/org/ldk/structs/RevokeAndACK.java index 176f5db7..a874af85 100644 --- a/src/main/java/org/ldk/structs/RevokeAndACK.java +++ b/src/main/java/org/ldk/structs/RevokeAndACK.java @@ -14,10 +14,9 @@ public class RevokeAndACK extends CommonBase { if (ptr != 0) { bindings.RevokeAndACK_free(ptr); } } - public static RevokeAndACK constructor_clone(RevokeAndACK orig) { - long ret = bindings.RevokeAndACK_clone(orig == null ? 0 : orig.ptr & ~1); + public RevokeAndACK clone() { + long ret = bindings.RevokeAndACK_clone(this.ptr); RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -54,9 +53,8 @@ public class RevokeAndACK extends CommonBase { return ret_hu_conv; } - public byte[] write(RevokeAndACK obj) { - byte[] ret = bindings.RevokeAndACK_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.RevokeAndACK_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/Route.java b/src/main/java/org/ldk/structs/Route.java index 6bbf4fb6..e6195c34 100644 --- a/src/main/java/org/ldk/structs/Route.java +++ b/src/main/java/org/ldk/structs/Route.java @@ -14,10 +14,9 @@ public class Route extends CommonBase { if (ptr != 0) { bindings.Route_free(ptr); } } - public static Route constructor_clone(Route orig) { - long ret = bindings.Route_clone(orig == null ? 0 : orig.ptr & ~1); + public Route clone() { + long ret = bindings.Route_clone(this.ptr); Route ret_hu_conv = new Route(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -38,9 +37,9 @@ public class Route extends CommonBase { return ret; } - public static Route constructor_read(byte[] ser) { + public static Result_RouteDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.Route_read(ser); - Route ret_hu_conv = new Route(null, ret); + Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.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 e5c54d69..f94c4071 100644 --- a/src/main/java/org/ldk/structs/RouteHint.java +++ b/src/main/java/org/ldk/structs/RouteHint.java @@ -14,10 +14,9 @@ public class RouteHint extends CommonBase { if (ptr != 0) { bindings.RouteHint_free(ptr); } } - public static RouteHint constructor_clone(RouteHint orig) { - long ret = bindings.RouteHint_clone(orig == null ? 0 : orig.ptr & ~1); + public RouteHint clone() { + long ret = bindings.RouteHint_clone(this.ptr); RouteHint ret_hu_conv = new RouteHint(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RouteHop.java b/src/main/java/org/ldk/structs/RouteHop.java index e54845e5..fe13c7b5 100644 --- a/src/main/java/org/ldk/structs/RouteHop.java +++ b/src/main/java/org/ldk/structs/RouteHop.java @@ -14,10 +14,9 @@ public class RouteHop extends CommonBase { if (ptr != 0) { bindings.RouteHop_free(ptr); } } - public static RouteHop constructor_clone(RouteHop orig) { - long ret = bindings.RouteHop_clone(orig == null ? 0 : orig.ptr & ~1); + public RouteHop clone() { + long ret = bindings.RouteHop_clone(this.ptr); RouteHop ret_hu_conv = new RouteHop(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -36,7 +35,11 @@ public class RouteHop extends CommonBase { return ret_hu_conv; } - // Skipped RouteHop_set_node_features + public void set_node_features(NodeFeatures val) { + bindings.RouteHop_set_node_features(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + public long get_short_channel_id() { long ret = bindings.RouteHop_get_short_channel_id(this.ptr); return ret; @@ -52,7 +55,11 @@ public class RouteHop extends CommonBase { return ret_hu_conv; } - // Skipped RouteHop_set_channel_features + public void set_channel_features(ChannelFeatures val) { + bindings.RouteHop_set_channel_features(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + public long get_fee_msat() { long ret = bindings.RouteHop_get_fee_msat(this.ptr); return ret; @@ -71,5 +78,12 @@ public class RouteHop extends CommonBase { bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val); } - // Skipped RouteHop_new + public static RouteHop constructor_new(byte[] pubkey_arg, NodeFeatures node_features_arg, long short_channel_id_arg, ChannelFeatures channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg) { + long ret = bindings.RouteHop_new(pubkey_arg, node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg); + RouteHop ret_hu_conv = new RouteHop(null, ret); + ret_hu_conv.ptrs_to.add(node_features_arg); + ret_hu_conv.ptrs_to.add(channel_features_arg); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/RoutingFees.java b/src/main/java/org/ldk/structs/RoutingFees.java index 0671b545..ec9af161 100644 --- a/src/main/java/org/ldk/structs/RoutingFees.java +++ b/src/main/java/org/ldk/structs/RoutingFees.java @@ -14,10 +14,9 @@ public class RoutingFees extends CommonBase { if (ptr != 0) { bindings.RoutingFees_free(ptr); } } - public static RoutingFees constructor_clone(RoutingFees orig) { - long ret = bindings.RoutingFees_clone(orig == null ? 0 : orig.ptr & ~1); + public RoutingFees clone() { + long ret = bindings.RoutingFees_clone(this.ptr); RoutingFees ret_hu_conv = new RoutingFees(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -45,9 +44,9 @@ public class RoutingFees extends CommonBase { return ret_hu_conv; } - public static RoutingFees constructor_read(byte[] ser) { + public static Result_RoutingFeesDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.RoutingFees_read(ser); - RoutingFees ret_hu_conv = new RoutingFees(null, ret); + Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RoutingMessageHandler.java b/src/main/java/org/ldk/structs/RoutingMessageHandler.java index 3bedb698..9d6cdc0f 100644 --- a/src/main/java/org/ldk/structs/RoutingMessageHandler.java +++ b/src/main/java/org/ldk/structs/RoutingMessageHandler.java @@ -9,9 +9,10 @@ import java.util.Arrays; public class RoutingMessageHandler extends CommonBase { final bindings.LDKRoutingMessageHandler bindings_instance; RoutingMessageHandler(Object _dummy, long ptr) { super(ptr); bindings_instance = null; } - private RoutingMessageHandler(bindings.LDKRoutingMessageHandler arg) { - super(bindings.LDKRoutingMessageHandler_new(arg)); + private RoutingMessageHandler(bindings.LDKRoutingMessageHandler arg, bindings.LDKMessageSendEventsProvider MessageSendEventsProvider) { + super(bindings.LDKRoutingMessageHandler_new(arg, MessageSendEventsProvider)); this.ptrs_to.add(arg); + this.ptrs_to.add(MessageSendEventsProvider); this.bindings_instance = arg; } @Override @SuppressWarnings("deprecation") @@ -26,10 +27,14 @@ public class RoutingMessageHandler extends CommonBase { void handle_htlc_fail_channel_update(HTLCFailChannelUpdate update); ThreeTuple[] get_next_channel_announcements(long starting_point, byte batch_amount); NodeAnnouncement[] get_next_node_announcements(byte[] starting_point, byte batch_amount); - boolean should_request_full_sync(byte[] node_id); + void sync_routing_table(byte[] their_node_id, Init init); + Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, ReplyChannelRange msg); + Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, ReplyShortChannelIdsEnd msg); + Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, QueryChannelRange msg); + Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, QueryShortChannelIds msg); } private static class LDKRoutingMessageHandlerHolder { RoutingMessageHandler held; } - public static RoutingMessageHandler new_impl(RoutingMessageHandlerInterface arg) { + public static RoutingMessageHandler new_impl(RoutingMessageHandlerInterface arg, MessageSendEventsProvider.MessageSendEventsProviderInterface MessageSendEventsProvider_impl) { final LDKRoutingMessageHandlerHolder impl_holder = new LDKRoutingMessageHandlerHolder(); impl_holder.held = new RoutingMessageHandler(new bindings.LDKRoutingMessageHandler() { @Override public long handle_node_announcement(long msg) { @@ -69,17 +74,44 @@ public class RoutingMessageHandler extends CommonBase { /* TODO 2 NodeAnnouncement */; return result; } - @Override public boolean should_request_full_sync(byte[] node_id) { - boolean ret = arg.should_request_full_sync(node_id); - return ret; + @Override public void sync_routing_table(byte[] their_node_id, long init) { + Init init_hu_conv = new Init(null, init); + arg.sync_routing_table(their_node_id, init_hu_conv); } - }); + @Override public long handle_reply_channel_range(byte[] their_node_id, long msg) { + ReplyChannelRange msg_hu_conv = new ReplyChannelRange(null, msg); + Result_NoneLightningErrorZ ret = arg.handle_reply_channel_range(their_node_id, msg_hu_conv); + long result = ret != null ? ret.ptr : 0; + ret.ptr = 0; + return result; + } + @Override public long handle_reply_short_channel_ids_end(byte[] their_node_id, long msg) { + ReplyShortChannelIdsEnd msg_hu_conv = new ReplyShortChannelIdsEnd(null, msg); + Result_NoneLightningErrorZ ret = arg.handle_reply_short_channel_ids_end(their_node_id, msg_hu_conv); + long result = ret != null ? ret.ptr : 0; + ret.ptr = 0; + return result; + } + @Override public long handle_query_channel_range(byte[] their_node_id, long msg) { + QueryChannelRange msg_hu_conv = new QueryChannelRange(null, msg); + Result_NoneLightningErrorZ ret = arg.handle_query_channel_range(their_node_id, msg_hu_conv); + long result = ret != null ? ret.ptr : 0; + ret.ptr = 0; + return result; + } + @Override public long handle_query_short_channel_ids(byte[] their_node_id, long msg) { + QueryShortChannelIds msg_hu_conv = new QueryShortChannelIds(null, msg); + Result_NoneLightningErrorZ ret = arg.handle_query_short_channel_ids(their_node_id, msg_hu_conv); + long result = ret != null ? ret.ptr : 0; + ret.ptr = 0; + return result; + } + }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance); return impl_holder.held; } public Result_boolLightningErrorZ handle_node_announcement(NodeAnnouncement msg) { long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(msg); return ret_hu_conv; } @@ -87,7 +119,6 @@ public class RoutingMessageHandler extends CommonBase { public Result_boolLightningErrorZ handle_channel_announcement(ChannelAnnouncement msg) { long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(msg); return ret_hu_conv; } @@ -95,7 +126,6 @@ public class RoutingMessageHandler extends CommonBase { public Result_boolLightningErrorZ handle_channel_update(ChannelUpdate msg) { long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(msg); return ret_hu_conv; } @@ -133,9 +163,37 @@ public class RoutingMessageHandler extends CommonBase { return arr_conv_18_arr; } - public boolean should_request_full_sync(byte[] node_id) { - boolean ret = bindings.RoutingMessageHandler_should_request_full_sync(this.ptr, node_id); - return ret; + public void sync_routing_table(byte[] their_node_id, Init init) { + bindings.RoutingMessageHandler_sync_routing_table(this.ptr, their_node_id, init == null ? 0 : init.ptr & ~1); + this.ptrs_to.add(init); + } + + public Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, ReplyChannelRange msg) { + long ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(msg); + return ret_hu_conv; + } + + public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, ReplyShortChannelIdsEnd msg) { + long ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(msg); + return ret_hu_conv; + } + + public Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, QueryChannelRange msg) { + long ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(msg); + return ret_hu_conv; + } + + public Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, QueryShortChannelIds msg) { + long ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(msg); + return ret_hu_conv; } } diff --git a/src/main/java/org/ldk/structs/Shutdown.java b/src/main/java/org/ldk/structs/Shutdown.java index 1d1c91d5..77b9a342 100644 --- a/src/main/java/org/ldk/structs/Shutdown.java +++ b/src/main/java/org/ldk/structs/Shutdown.java @@ -14,10 +14,9 @@ public class Shutdown extends CommonBase { if (ptr != 0) { bindings.Shutdown_free(ptr); } } - public static Shutdown constructor_clone(Shutdown orig) { - long ret = bindings.Shutdown_clone(orig == null ? 0 : orig.ptr & ~1); + public Shutdown clone() { + long ret = bindings.Shutdown_clone(this.ptr); Shutdown ret_hu_conv = new Shutdown(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -45,9 +44,8 @@ public class Shutdown extends CommonBase { return ret_hu_conv; } - public byte[] write(Shutdown obj) { - byte[] ret = bindings.Shutdown_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.Shutdown_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/SocketDescriptor.java b/src/main/java/org/ldk/structs/SocketDescriptor.java index 9670c9da..40dfc014 100644 --- a/src/main/java/org/ldk/structs/SocketDescriptor.java +++ b/src/main/java/org/ldk/structs/SocketDescriptor.java @@ -63,11 +63,10 @@ public class SocketDescriptor extends CommonBase { return ret; } - public static SocketDescriptor constructor_clone(SocketDescriptor orig) { - long ret = bindings.SocketDescriptor_clone(orig == null ? 0 : orig.ptr); + public SocketDescriptor clone() { + long ret = bindings.SocketDescriptor_clone(this.ptr); SocketDescriptor ret_hu_conv = new SocketDescriptor(null, ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(orig); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java b/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java new file mode 100644 index 00000000..e49ae242 --- /dev/null +++ b/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java @@ -0,0 +1,41 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; + +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class TrustedCommitmentTransaction extends CommonBase { + TrustedCommitmentTransaction(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.TrustedCommitmentTransaction_free(ptr); } + } + + public byte[] txid() { + byte[] ret = bindings.TrustedCommitmentTransaction_txid(this.ptr); + return ret; + } + + public BuiltCommitmentTransaction built_transaction() { + long ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr); + BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret); + return ret_hu_conv; + } + + public TxCreationKeys keys() { + long ret = bindings.TrustedCommitmentTransaction_keys(this.ptr); + TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); + return ret_hu_conv; + } + + public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, DirectedChannelTransactionParameters channel_parameters) { + long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, htlc_base_key, channel_parameters == null ? 0 : channel_parameters.ptr & ~1); + Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); + this.ptrs_to.add(channel_parameters); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TxCreationKeys.java b/src/main/java/org/ldk/structs/TxCreationKeys.java index eda469d9..9d0df354 100644 --- a/src/main/java/org/ldk/structs/TxCreationKeys.java +++ b/src/main/java/org/ldk/structs/TxCreationKeys.java @@ -14,10 +14,9 @@ public class TxCreationKeys extends CommonBase { if (ptr != 0) { bindings.TxCreationKeys_free(ptr); } } - public static TxCreationKeys constructor_clone(TxCreationKeys orig) { - long ret = bindings.TxCreationKeys_clone(orig == null ? 0 : orig.ptr & ~1); + public TxCreationKeys clone() { + long ret = bindings.TxCreationKeys_clone(this.ptr); TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -72,9 +71,8 @@ public class TxCreationKeys extends CommonBase { return ret_hu_conv; } - public byte[] write(TxCreationKeys obj) { - byte[] ret = bindings.TxCreationKeys_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.TxCreationKeys_write(this.ptr); return ret; } @@ -84,10 +82,17 @@ public class TxCreationKeys extends CommonBase { return ret_hu_conv; } - public Result_TxCreationKeysSecpErrorZ derive_new(byte[] per_commitment_point, byte[] broadcaster_delayed_payment_base, byte[] broadcaster_htlc_base, byte[] countersignatory_revocation_base, byte[] countersignatory_htlc_base) { + public static Result_TxCreationKeysSecpErrorZ constructor_derive_new(byte[] per_commitment_point, byte[] broadcaster_delayed_payment_base, byte[] broadcaster_htlc_base, byte[] countersignatory_revocation_base, byte[] countersignatory_htlc_base) { long ret = bindings.TxCreationKeys_derive_new(per_commitment_point, broadcaster_delayed_payment_base, broadcaster_htlc_base, countersignatory_revocation_base, countersignatory_htlc_base); Result_TxCreationKeysSecpErrorZ ret_hu_conv = Result_TxCreationKeysSecpErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public static Result_TxCreationKeysSecpErrorZ constructor_from_channel_static_keys(byte[] per_commitment_point, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) { + long ret = bindings.TxCreationKeys_from_channel_static_keys(per_commitment_point, broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1); + Result_TxCreationKeysSecpErrorZ ret_hu_conv = Result_TxCreationKeysSecpErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(broadcaster_keys); + ret_hu_conv.ptrs_to.add(countersignatory_keys); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java index 96cc90d8..1d6db48b 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java @@ -14,10 +14,9 @@ public class UnsignedChannelAnnouncement extends CommonBase { if (ptr != 0) { bindings.UnsignedChannelAnnouncement_free(ptr); } } - public static UnsignedChannelAnnouncement constructor_clone(UnsignedChannelAnnouncement orig) { - long ret = bindings.UnsignedChannelAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1); + public UnsignedChannelAnnouncement clone() { + long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr); UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -27,7 +26,11 @@ public class UnsignedChannelAnnouncement extends CommonBase { return ret_hu_conv; } - // Skipped UnsignedChannelAnnouncement_set_features + public void set_features(ChannelFeatures val) { + bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + public byte[] get_chain_hash() { byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr); return ret; @@ -87,9 +90,9 @@ public class UnsignedChannelAnnouncement extends CommonBase { return ret; } - public static UnsignedChannelAnnouncement constructor_read(byte[] ser) { + public static Result_UnsignedChannelAnnouncementDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UnsignedChannelAnnouncement_read(ser); - UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); + Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java index 936895d0..70c9749a 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java @@ -14,10 +14,9 @@ public class UnsignedChannelUpdate extends CommonBase { if (ptr != 0) { bindings.UnsignedChannelUpdate_free(ptr); } } - public static UnsignedChannelUpdate constructor_clone(UnsignedChannelUpdate orig) { - long ret = bindings.UnsignedChannelUpdate_clone(orig == null ? 0 : orig.ptr & ~1); + public UnsignedChannelUpdate clone() { + long ret = bindings.UnsignedChannelUpdate_clone(this.ptr); UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -98,9 +97,9 @@ public class UnsignedChannelUpdate extends CommonBase { return ret; } - public static UnsignedChannelUpdate constructor_read(byte[] ser) { + public static Result_UnsignedChannelUpdateDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UnsignedChannelUpdate_read(ser); - UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret); + Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java index 65559db1..e737f271 100644 --- a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java @@ -14,10 +14,9 @@ public class UnsignedNodeAnnouncement extends CommonBase { if (ptr != 0) { bindings.UnsignedNodeAnnouncement_free(ptr); } } - public static UnsignedNodeAnnouncement constructor_clone(UnsignedNodeAnnouncement orig) { - long ret = bindings.UnsignedNodeAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1); + public UnsignedNodeAnnouncement clone() { + long ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr); UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -27,7 +26,11 @@ public class UnsignedNodeAnnouncement extends CommonBase { return ret_hu_conv; } - // Skipped UnsignedNodeAnnouncement_set_features + public void set_features(NodeFeatures val) { + bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); + this.ptrs_to.add(val); + } + public int get_timestamp() { int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr); return ret; @@ -74,9 +77,9 @@ public class UnsignedNodeAnnouncement extends CommonBase { return ret; } - public static UnsignedNodeAnnouncement constructor_read(byte[] ser) { + public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UnsignedNodeAnnouncement_read(ser); - UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); + Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UpdateAddHTLC.java b/src/main/java/org/ldk/structs/UpdateAddHTLC.java index c4aa0936..acf6a36a 100644 --- a/src/main/java/org/ldk/structs/UpdateAddHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateAddHTLC.java @@ -14,10 +14,9 @@ public class UpdateAddHTLC extends CommonBase { if (ptr != 0) { bindings.UpdateAddHTLC_free(ptr); } } - public static UpdateAddHTLC constructor_clone(UpdateAddHTLC orig) { - long ret = bindings.UpdateAddHTLC_clone(orig == null ? 0 : orig.ptr & ~1); + public UpdateAddHTLC clone() { + long ret = bindings.UpdateAddHTLC_clone(this.ptr); UpdateAddHTLC ret_hu_conv = new UpdateAddHTLC(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -66,9 +65,8 @@ public class UpdateAddHTLC extends CommonBase { bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val); } - public byte[] write(UpdateAddHTLC obj) { - byte[] ret = bindings.UpdateAddHTLC_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.UpdateAddHTLC_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/UpdateFailHTLC.java b/src/main/java/org/ldk/structs/UpdateFailHTLC.java index 171cbaff..37d34c46 100644 --- a/src/main/java/org/ldk/structs/UpdateFailHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailHTLC.java @@ -14,10 +14,9 @@ public class UpdateFailHTLC extends CommonBase { if (ptr != 0) { bindings.UpdateFailHTLC_free(ptr); } } - public static UpdateFailHTLC constructor_clone(UpdateFailHTLC orig) { - long ret = bindings.UpdateFailHTLC_clone(orig == null ? 0 : orig.ptr & ~1); + public UpdateFailHTLC clone() { + long ret = bindings.UpdateFailHTLC_clone(this.ptr); UpdateFailHTLC ret_hu_conv = new UpdateFailHTLC(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -39,9 +38,8 @@ public class UpdateFailHTLC extends CommonBase { bindings.UpdateFailHTLC_set_htlc_id(this.ptr, val); } - public byte[] write(UpdateFailHTLC obj) { - byte[] ret = bindings.UpdateFailHTLC_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.UpdateFailHTLC_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java index 3009fcbd..5f0fd7d2 100644 --- a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java @@ -14,10 +14,9 @@ public class UpdateFailMalformedHTLC extends CommonBase { if (ptr != 0) { bindings.UpdateFailMalformedHTLC_free(ptr); } } - public static UpdateFailMalformedHTLC constructor_clone(UpdateFailMalformedHTLC orig) { - long ret = bindings.UpdateFailMalformedHTLC_clone(orig == null ? 0 : orig.ptr & ~1); + public UpdateFailMalformedHTLC clone() { + long ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr); UpdateFailMalformedHTLC ret_hu_conv = new UpdateFailMalformedHTLC(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -48,9 +47,8 @@ public class UpdateFailMalformedHTLC extends CommonBase { bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val); } - public byte[] write(UpdateFailMalformedHTLC obj) { - byte[] ret = bindings.UpdateFailMalformedHTLC_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.UpdateFailMalformedHTLC_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/UpdateFee.java b/src/main/java/org/ldk/structs/UpdateFee.java index ecc9f0f0..8c90926a 100644 --- a/src/main/java/org/ldk/structs/UpdateFee.java +++ b/src/main/java/org/ldk/structs/UpdateFee.java @@ -14,10 +14,9 @@ public class UpdateFee extends CommonBase { if (ptr != 0) { bindings.UpdateFee_free(ptr); } } - public static UpdateFee constructor_clone(UpdateFee orig) { - long ret = bindings.UpdateFee_clone(orig == null ? 0 : orig.ptr & ~1); + public UpdateFee clone() { + long ret = bindings.UpdateFee_clone(this.ptr); UpdateFee ret_hu_conv = new UpdateFee(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -45,9 +44,8 @@ public class UpdateFee extends CommonBase { return ret_hu_conv; } - public byte[] write(UpdateFee obj) { - byte[] ret = bindings.UpdateFee_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.UpdateFee_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java index d28bf460..57375723 100644 --- a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java @@ -14,10 +14,9 @@ public class UpdateFulfillHTLC extends CommonBase { if (ptr != 0) { bindings.UpdateFulfillHTLC_free(ptr); } } - public static UpdateFulfillHTLC constructor_clone(UpdateFulfillHTLC orig) { - long ret = bindings.UpdateFulfillHTLC_clone(orig == null ? 0 : orig.ptr & ~1); + public UpdateFulfillHTLC clone() { + long ret = bindings.UpdateFulfillHTLC_clone(this.ptr); UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } @@ -54,9 +53,8 @@ public class UpdateFulfillHTLC extends CommonBase { return ret_hu_conv; } - public byte[] write(UpdateFulfillHTLC obj) { - byte[] ret = bindings.UpdateFulfillHTLC_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.UpdateFulfillHTLC_write(this.ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/UserConfig.java b/src/main/java/org/ldk/structs/UserConfig.java index 4967fbf3..8e871e21 100644 --- a/src/main/java/org/ldk/structs/UserConfig.java +++ b/src/main/java/org/ldk/structs/UserConfig.java @@ -14,10 +14,9 @@ public class UserConfig extends CommonBase { if (ptr != 0) { bindings.UserConfig_free(ptr); } } - public static UserConfig constructor_clone(UserConfig orig) { - long ret = bindings.UserConfig_clone(orig == null ? 0 : orig.ptr & ~1); + public UserConfig clone() { + long ret = bindings.UserConfig_clone(this.ptr); UserConfig ret_hu_conv = new UserConfig(null, ret); - ret_hu_conv.ptrs_to.add(orig); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Watch.java b/src/main/java/org/ldk/structs/Watch.java index 8b4f3219..8bc9ab05 100644 --- a/src/main/java/org/ldk/structs/Watch.java +++ b/src/main/java/org/ldk/structs/Watch.java @@ -53,11 +53,17 @@ public class Watch extends CommonBase { }); return impl_holder.held; } - // Skipped Watch_watch_channel + public Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor) { + long ret = bindings.Watch_watch_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, monitor == null ? 0 : monitor.ptr & ~1); + Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); + this.ptrs_to.add(funding_txo); + this.ptrs_to.add(monitor); + return ret_hu_conv; + } + public Result_NoneChannelMonitorUpdateErrZ update_channel(OutPoint funding_txo, ChannelMonitorUpdate update) { long ret = bindings.Watch_update_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, update == null ? 0 : update.ptr & ~1); Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); this.ptrs_to.add(funding_txo); this.ptrs_to.add(update); return ret_hu_conv; diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 4acad6c2..81d87d3d 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -452,17 +452,17 @@ static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error va } } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_u8 *vec = (LDKCVecTempl_u8*)ptr; +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u8Z_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint8_t)); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1new(JNIEnv *env, jclass _b, jbyteArray elems){ - LDKCVecTempl_u8 *ret = MALLOC(sizeof(LDKCVecTempl_u8), "LDKCVecTempl_u8"); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u8Z_1new(JNIEnv *env, jclass _b, jbyteArray elems){ + LDKCVec_u8Z *ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z"); ret->datalen = (*env)->GetArrayLength(env, elems); if (ret->datalen == 0) { ret->data = NULL; } else { - ret->data = MALLOC(sizeof(uint8_t) * ret->datalen, "LDKCVecTempl_u8 Data"); + ret->data = MALLOC(sizeof(uint8_t) * ret->datalen, "LDKCVec_u8Z Data"); jbyte *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); for (size_t i = 0; i < ret->datalen; i++) { ret->data[i] = java_elems[i]; @@ -471,104 +471,94 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1new(JNIEnv } return (long)ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1usize_1_1Transaction_1new(JNIEnv *_env, jclass _b, jlong a, jbyteArray b) { - LDKC2TupleTempl_usize__Transaction* ret = MALLOC(sizeof(LDKC2TupleTempl_usize__Transaction), "LDKC2TupleTempl_usize__Transaction"); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) { + LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); ret->a = a; - LDKTransaction b_ref; - b_ref.datalen = (*_env)->GetArrayLength (_env, b); - b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data); - b_ref.data_is_owned = false; - ret->b = b_ref; + ret->b = b; return (long)ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_usize__Transaction *tuple = (LDKC2TupleTempl_usize__Transaction*)ptr; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_u64u64Z *tuple = (LDKC2Tuple_u64u64Z*)ptr; return tuple->a; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_usize__Transaction *tuple = (LDKC2TupleTempl_usize__Transaction*)ptr; - LDKTransaction b_var = tuple->b; - jbyteArray b_arr = (*_env)->NewByteArray(_env, b_var.datalen); - (*_env)->SetByteArrayRegion(_env, b_arr, 0, b_var.datalen, b_var.data); - return b_arr; -} -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok; -} -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_NoneChannelMonitorUpdateErrZ *val = (LDKCResult_NoneChannelMonitorUpdateErrZ*)arg; - CHECK(val->result_ok); - return *val->contents.result; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_NoneChannelMonitorUpdateErrZ *val = (LDKCResult_NoneChannelMonitorUpdateErrZ*)arg; - CHECK(!val->result_ok); - jclass err_conv = LDKChannelMonitorUpdateErr_to_java(_env, (*val->contents.err)); - return err_conv; -} -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok; -} -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)arg; - CHECK(val->result_ok); - return *val->contents.result; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)arg; - CHECK(!val->result_ok); - LDKMonitorUpdateError err_var = (*val->contents.err); - CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long err_ref = (long)err_var.inner & ~1; - return err_ref; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1OutPoint_1_1CVec_1u8Z_1new(JNIEnv *_env, jclass _b, jlong a, jbyteArray b) { - LDKC2TupleTempl_OutPoint__CVec_u8Z* ret = MALLOC(sizeof(LDKC2TupleTempl_OutPoint__CVec_u8Z), "LDKC2TupleTempl_OutPoint__CVec_u8Z"); - LDKOutPoint a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - if (a_conv.inner != NULL) - a_conv = OutPoint_clone(&a_conv); - ret->a = a_conv; - LDKCVec_u8Z b_ref; - b_ref.datalen = (*_env)->GetArrayLength (_env, b); - b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); - (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data); - ret->b = b_ref; - return (long)ret; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_u64u64Z *tuple = (LDKC2Tuple_u64u64Z*)ptr; + return tuple->b; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_OutPoint__CVec_u8Z *tuple = (LDKC2TupleTempl_OutPoint__CVec_u8Z*)ptr; - LDKOutPoint a_var = tuple->a; - CHECK((((long)a_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&a_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long a_ref = (long)a_var.inner & ~1; - return a_ref; +static jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL; +static jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL; +static jclass LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class = NULL; +static jmethodID LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = NULL; +static jclass LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class = NULL; +static jmethodID LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv * env, jclass _a) { + LDKSpendableOutputDescriptor_StaticOutput_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput;")); + CHECK(LDKSpendableOutputDescriptor_StaticOutput_class != NULL); + LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "", "(JJ)V"); + CHECK(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL); + LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$DynamicOutputP2WSH;")); + CHECK(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class != NULL); + LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, "", "(J[BSJJ[B)V"); + CHECK(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth != NULL); + LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutputCounterpartyPayment;")); + CHECK(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class != NULL); + LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, "", "(JJJ)V"); + CHECK(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth != NULL); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_OutPoint__CVec_u8Z *tuple = (LDKC2TupleTempl_OutPoint__CVec_u8Z*)ptr; - LDKCVec_u8Z b_var = tuple->b; - jbyteArray b_arr = (*_env)->NewByteArray(_env, b_var.datalen); - (*_env)->SetByteArrayRegion(_env, b_arr, 0, b_var.datalen, b_var.data); - return b_arr; +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { + LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)ptr; + switch(obj->tag) { + case LDKSpendableOutputDescriptor_StaticOutput: { + LDKOutPoint outpoint_var = obj->static_output.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 & ~1; + long output_ref = (long)&obj->static_output.output; + return (*_env)->NewObject(_env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, (long)output_ref); + } + case LDKSpendableOutputDescriptor_DynamicOutputP2WSH: { + LDKOutPoint outpoint_var = obj->dynamic_output_p2wsh.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 & ~1; + jbyteArray per_commitment_point_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, per_commitment_point_arr, 0, 33, obj->dynamic_output_p2wsh.per_commitment_point.compressed_form); + long output_ref = (long)&obj->dynamic_output_p2wsh.output; + long key_derivation_params_ref = (long)&obj->dynamic_output_p2wsh.key_derivation_params; + jbyteArray revocation_pubkey_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, revocation_pubkey_arr, 0, 33, obj->dynamic_output_p2wsh.revocation_pubkey.compressed_form); + return (*_env)->NewObject(_env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth, outpoint_ref, per_commitment_point_arr, obj->dynamic_output_p2wsh.to_self_delay, (long)output_ref, key_derivation_params_ref, revocation_pubkey_arr); + } + case LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment: { + LDKOutPoint outpoint_var = obj->static_output_counterparty_payment.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 & ~1; + long output_ref = (long)&obj->static_output_counterparty_payment.output; + long key_derivation_params_ref = (long)&obj->static_output_counterparty_payment.key_derivation_params; + return (*_env)->NewObject(_env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth, outpoint_ref, (long)output_ref, key_derivation_params_ref); + } + default: abort(); + } } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_TxOut *vec = (LDKCVecTempl_TxOut*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTxOut)); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SpendableOutputDescriptorZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_SpendableOutputDescriptorZ *vec = (LDKCVec_SpendableOutputDescriptorZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSpendableOutputDescriptor)); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_TxOut *ret = MALLOC(sizeof(LDKCVecTempl_TxOut), "LDKCVecTempl_TxOut"); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SpendableOutputDescriptorZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_SpendableOutputDescriptorZ *ret = MALLOC(sizeof(LDKCVec_SpendableOutputDescriptorZ), "LDKCVec_SpendableOutputDescriptorZ"); ret->datalen = (*env)->GetArrayLength(env, elems); if (ret->datalen == 0) { ret->data = NULL; } else { - ret->data = MALLOC(sizeof(LDKTxOut) * ret->datalen, "LDKCVecTempl_TxOut Data"); + ret->data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * ret->datalen, "LDKCVec_SpendableOutputDescriptorZ Data"); jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); for (size_t i = 0; i < ret->datalen; i++) { jlong arr_elem = java_elems[i]; - LDKTxOut arr_elem_conv = *(LDKTxOut*)arr_elem; + LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)arr_elem; FREE((void*)arr_elem); ret->data[i] = arr_elem_conv; } @@ -576,479 +566,454 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1new(JNIE } return (long)ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1new(JNIEnv *_env, jclass _b, jbyteArray a, jlongArray b) { - LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut* ret = MALLOC(sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut), "LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut"); - LDKThirtyTwoBytes a_ref; - CHECK((*_env)->GetArrayLength (_env, a) == 32); - (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data); - ret->a = a_ref; - LDKCVecTempl_TxOut b_constr; - b_constr.datalen = (*_env)->GetArrayLength (_env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKTxOut), "LDKCVecTempl_TxOut Elements"); - else - b_constr.data = NULL; - long* b_vals = (*_env)->GetLongArrayElements (_env, b, NULL); - for (size_t h = 0; h < b_constr.datalen; h++) { - long arr_conv_7 = b_vals[h]; - LDKTxOut arr_conv_7_conv = *(LDKTxOut*)arr_conv_7; - FREE((void*)arr_conv_7); - b_constr.data[h] = arr_conv_7_conv; - } - (*_env)->ReleaseLongArrayElements (_env, b, b_vals, 0); - ret->b = b_constr; - return (long)ret; -} -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1TxOutZZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *tuple = (LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)ptr; - jbyteArray a_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, a_arr, 0, 32, tuple->a.data); - return a_arr; +static jclass LDKErrorAction_DisconnectPeer_class = NULL; +static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL; +static jclass LDKErrorAction_IgnoreError_class = NULL; +static jmethodID LDKErrorAction_IgnoreError_meth = NULL; +static jclass LDKErrorAction_SendErrorMessage_class = NULL; +static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv * env, jclass _a) { + LDKErrorAction_DisconnectPeer_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$DisconnectPeer;")); + CHECK(LDKErrorAction_DisconnectPeer_class != NULL); + LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "", "(J)V"); + CHECK(LDKErrorAction_DisconnectPeer_meth != NULL); + LDKErrorAction_IgnoreError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$IgnoreError;")); + CHECK(LDKErrorAction_IgnoreError_class != NULL); + LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "", "()V"); + CHECK(LDKErrorAction_IgnoreError_meth != NULL); + LDKErrorAction_SendErrorMessage_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$SendErrorMessage;")); + CHECK(LDKErrorAction_SendErrorMessage_class != NULL); + LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "", "(J)V"); + CHECK(LDKErrorAction_SendErrorMessage_meth != NULL); } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1TxOutZZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *tuple = (LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)ptr; - LDKCVecTempl_TxOut b_var = tuple->b; - jlongArray b_arr = (*_env)->NewLongArray(_env, b_var.datalen); - jlong *b_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, b_arr, NULL); - for (size_t h = 0; h < b_var.datalen; h++) { - long arr_conv_7_ref = (long)&b_var.data[h]; - b_arr_ptr[h] = arr_conv_7_ref; +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { + LDKErrorAction *obj = (LDKErrorAction*)ptr; + switch(obj->tag) { + case LDKErrorAction_DisconnectPeer: { + LDKErrorMessage msg_var = obj->disconnect_peer.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref); + } + case LDKErrorAction_IgnoreError: { + return (*_env)->NewObject(_env, LDKErrorAction_IgnoreError_class, LDKErrorAction_IgnoreError_meth); + } + case LDKErrorAction_SendErrorMessage: { + LDKErrorMessage msg_var = obj->send_error_message.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref); + } + default: abort(); } - (*_env)->ReleasePrimitiveArrayCritical(_env, b_arr, b_arr_ptr, 0); - return b_arr; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1u64_1_1u64_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) { - LDKC2TupleTempl_u64__u64* ret = MALLOC(sizeof(LDKC2TupleTempl_u64__u64), "LDKC2TupleTempl_u64__u64"); - ret->a = a; - ret->b = b; - return (long)ret; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_u64__u64 *tuple = (LDKC2TupleTempl_u64__u64*)ptr; - return tuple->a; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_u64__u64 *tuple = (LDKC2TupleTempl_u64__u64*)ptr; - return tuple->b; +static jclass LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class = NULL; +static jmethodID LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth = NULL; +static jclass LDKHTLCFailChannelUpdate_ChannelClosed_class = NULL; +static jmethodID LDKHTLCFailChannelUpdate_ChannelClosed_meth = NULL; +static jclass LDKHTLCFailChannelUpdate_NodeFailure_class = NULL; +static jmethodID LDKHTLCFailChannelUpdate_NodeFailure_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCFailChannelUpdate_init (JNIEnv * env, jclass _a) { + LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$ChannelUpdateMessage;")); + CHECK(LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class != NULL); + LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class, "", "(J)V"); + CHECK(LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth != NULL); + LDKHTLCFailChannelUpdate_ChannelClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$ChannelClosed;")); + CHECK(LDKHTLCFailChannelUpdate_ChannelClosed_class != NULL); + LDKHTLCFailChannelUpdate_ChannelClosed_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_ChannelClosed_class, "", "(JZ)V"); + CHECK(LDKHTLCFailChannelUpdate_ChannelClosed_meth != NULL); + LDKHTLCFailChannelUpdate_NodeFailure_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$NodeFailure;")); + CHECK(LDKHTLCFailChannelUpdate_NodeFailure_class != NULL); + LDKHTLCFailChannelUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_NodeFailure_class, "", "([BZ)V"); + CHECK(LDKHTLCFailChannelUpdate_NodeFailure_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Signature_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_Signature *vec = (LDKCVecTempl_Signature*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSignature)); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { + LDKHTLCFailChannelUpdate *obj = (LDKHTLCFailChannelUpdate*)ptr; + switch(obj->tag) { + case LDKHTLCFailChannelUpdate_ChannelUpdateMessage: { + LDKChannelUpdate msg_var = obj->channel_update_message.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth, msg_ref); + } + case LDKHTLCFailChannelUpdate_ChannelClosed: { + return (*_env)->NewObject(_env, LDKHTLCFailChannelUpdate_ChannelClosed_class, LDKHTLCFailChannelUpdate_ChannelClosed_meth, obj->channel_closed.short_channel_id, obj->channel_closed.is_permanent); + } + case LDKHTLCFailChannelUpdate_NodeFailure: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->node_failure.node_id.compressed_form); + return (*_env)->NewObject(_env, LDKHTLCFailChannelUpdate_NodeFailure_class, LDKHTLCFailChannelUpdate_NodeFailure_meth, node_id_arr, obj->node_failure.is_permanent); + } + default: abort(); + } } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1Signature_1_1CVecTempl_1Signature_1new(JNIEnv *_env, jclass _b, jbyteArray a, jobjectArray b) { - LDKC2TupleTempl_Signature__CVecTempl_Signature* ret = MALLOC(sizeof(LDKC2TupleTempl_Signature__CVecTempl_Signature), "LDKC2TupleTempl_Signature__CVecTempl_Signature"); - LDKSignature a_ref; - CHECK((*_env)->GetArrayLength (_env, a) == 64); - (*_env)->GetByteArrayRegion (_env, a, 0, 64, a_ref.compact_form); - ret->a = a_ref; - LDKCVecTempl_Signature b_constr; - b_constr.datalen = (*_env)->GetArrayLength (_env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVecTempl_Signature Elements"); - else - b_constr.data = NULL; - for (size_t i = 0; i < b_constr.datalen; i++) { - jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, b, i); - LDKSignature arr_conv_8_ref; - CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 64); - (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form); - b_constr.data[i] = arr_conv_8_ref; - } - ret->b = b_constr; - return (long)ret; -} -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_Signature__CVecTempl_Signature *tuple = (LDKC2TupleTempl_Signature__CVecTempl_Signature*)ptr; - jbyteArray a_arr = (*_env)->NewByteArray(_env, 64); - (*_env)->SetByteArrayRegion(_env, a_arr, 0, 64, tuple->a.compact_form); - return a_arr; -} -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_Signature__CVecTempl_Signature *tuple = (LDKC2TupleTempl_Signature__CVecTempl_Signature*)ptr; - LDKCVecTempl_Signature b_var = tuple->b; - jobjectArray b_arr = (*_env)->NewObjectArray(_env, b_var.datalen, arr_of_B_clz, NULL); - for (size_t i = 0; i < b_var.datalen; i++) { - jbyteArray arr_conv_8_arr = (*_env)->NewByteArray(_env, 64); - (*_env)->SetByteArrayRegion(_env, arr_conv_8_arr, 0, 64, b_var.data[i].compact_form); - (*_env)->SetObjectArrayElement(_env, b_arr, i, arr_conv_8_arr); - } - return b_arr; -} -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *val = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg; - CHECK(val->result_ok); - long res_ref = (long)&(*val->contents.result); - return res_ref; -} -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *val = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg; - CHECK(!val->result_ok); - return *val->contents.err; -} -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_SignatureNoneZ*)arg)->result_ok; -} -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_SignatureNoneZ *val = (LDKCResult_SignatureNoneZ*)arg; - CHECK(val->result_ok); - jbyteArray res_arr = (*_env)->NewByteArray(_env, 64); - (*_env)->SetByteArrayRegion(_env, res_arr, 0, 64, (*val->contents.result).compact_form); - return res_arr; -} -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_SignatureNoneZ *val = (LDKCResult_SignatureNoneZ*)arg; - CHECK(!val->result_ok); - return *val->contents.err; -} -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok; -} -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)arg; - CHECK(val->result_ok); - LDKCVecTempl_Signature res_var = (*val->contents.result); - jobjectArray res_arr = (*_env)->NewObjectArray(_env, res_var.datalen, arr_of_B_clz, NULL); - for (size_t i = 0; i < res_var.datalen; i++) { - jbyteArray arr_conv_8_arr = (*_env)->NewByteArray(_env, 64); - (*_env)->SetByteArrayRegion(_env, arr_conv_8_arr, 0, 64, res_var.data[i].compact_form); - (*_env)->SetObjectArrayElement(_env, res_arr, i, arr_conv_8_arr); - } - return res_arr; -} -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)arg; - CHECK(!val->result_ok); - return *val->contents.err; -} -static jclass LDKAPIError_APIMisuseError_class = NULL; -static jmethodID LDKAPIError_APIMisuseError_meth = NULL; -static jclass LDKAPIError_FeeRateTooHigh_class = NULL; -static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL; -static jclass LDKAPIError_RouteError_class = NULL; -static jmethodID LDKAPIError_RouteError_meth = NULL; -static jclass LDKAPIError_ChannelUnavailable_class = NULL; -static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL; -static jclass LDKAPIError_MonitorUpdateFailed_class = NULL; -static jmethodID LDKAPIError_MonitorUpdateFailed_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv * env, jclass _a) { - LDKAPIError_APIMisuseError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$APIMisuseError;")); - CHECK(LDKAPIError_APIMisuseError_class != NULL); - LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "", "([B)V"); - CHECK(LDKAPIError_APIMisuseError_meth != NULL); - LDKAPIError_FeeRateTooHigh_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh;")); - CHECK(LDKAPIError_FeeRateTooHigh_class != NULL); - LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "", "([BI)V"); - CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL); - LDKAPIError_RouteError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$RouteError;")); - CHECK(LDKAPIError_RouteError_class != NULL); - LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKAPIError_RouteError_meth != NULL); - LDKAPIError_ChannelUnavailable_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$ChannelUnavailable;")); - CHECK(LDKAPIError_ChannelUnavailable_class != NULL); - LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "", "([B)V"); - CHECK(LDKAPIError_ChannelUnavailable_meth != NULL); - LDKAPIError_MonitorUpdateFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed;")); - CHECK(LDKAPIError_MonitorUpdateFailed_class != NULL); - LDKAPIError_MonitorUpdateFailed_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateFailed_class, "", "()V"); - CHECK(LDKAPIError_MonitorUpdateFailed_meth != NULL); +static jclass LDKMessageSendEvent_SendAcceptChannel_class = NULL; +static jmethodID LDKMessageSendEvent_SendAcceptChannel_meth = NULL; +static jclass LDKMessageSendEvent_SendOpenChannel_class = NULL; +static jmethodID LDKMessageSendEvent_SendOpenChannel_meth = NULL; +static jclass LDKMessageSendEvent_SendFundingCreated_class = NULL; +static jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL; +static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL; +static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL; +static jclass LDKMessageSendEvent_SendFundingLocked_class = NULL; +static jmethodID LDKMessageSendEvent_SendFundingLocked_meth = NULL; +static jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL; +static jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL; +static jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL; +static jmethodID LDKMessageSendEvent_UpdateHTLCs_meth = NULL; +static jclass LDKMessageSendEvent_SendRevokeAndACK_class = NULL; +static jmethodID LDKMessageSendEvent_SendRevokeAndACK_meth = NULL; +static jclass LDKMessageSendEvent_SendClosingSigned_class = NULL; +static jmethodID LDKMessageSendEvent_SendClosingSigned_meth = NULL; +static jclass LDKMessageSendEvent_SendShutdown_class = NULL; +static jmethodID LDKMessageSendEvent_SendShutdown_meth = NULL; +static jclass LDKMessageSendEvent_SendChannelReestablish_class = NULL; +static jmethodID LDKMessageSendEvent_SendChannelReestablish_meth = NULL; +static jclass LDKMessageSendEvent_BroadcastChannelAnnouncement_class = NULL; +static jmethodID LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = NULL; +static jclass LDKMessageSendEvent_BroadcastNodeAnnouncement_class = NULL; +static jmethodID LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = NULL; +static jclass LDKMessageSendEvent_BroadcastChannelUpdate_class = NULL; +static jmethodID LDKMessageSendEvent_BroadcastChannelUpdate_meth = NULL; +static jclass LDKMessageSendEvent_HandleError_class = NULL; +static jmethodID LDKMessageSendEvent_HandleError_meth = NULL; +static jclass LDKMessageSendEvent_PaymentFailureNetworkUpdate_class = NULL; +static jmethodID LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth = NULL; +static jclass LDKMessageSendEvent_SendChannelRangeQuery_class = NULL; +static jmethodID LDKMessageSendEvent_SendChannelRangeQuery_meth = NULL; +static jclass LDKMessageSendEvent_SendShortIdsQuery_class = NULL; +static jmethodID LDKMessageSendEvent_SendShortIdsQuery_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv * env, jclass _a) { + LDKMessageSendEvent_SendAcceptChannel_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel;")); + CHECK(LDKMessageSendEvent_SendAcceptChannel_class != NULL); + LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendAcceptChannel_meth != NULL); + LDKMessageSendEvent_SendOpenChannel_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel;")); + CHECK(LDKMessageSendEvent_SendOpenChannel_class != NULL); + LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendOpenChannel_meth != NULL); + LDKMessageSendEvent_SendFundingCreated_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated;")); + CHECK(LDKMessageSendEvent_SendFundingCreated_class != NULL); + LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendFundingCreated_meth != NULL); + LDKMessageSendEvent_SendFundingSigned_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned;")); + CHECK(LDKMessageSendEvent_SendFundingSigned_class != NULL); + LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendFundingSigned_meth != NULL); + LDKMessageSendEvent_SendFundingLocked_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked;")); + CHECK(LDKMessageSendEvent_SendFundingLocked_class != NULL); + LDKMessageSendEvent_SendFundingLocked_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingLocked_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendFundingLocked_meth != NULL); + LDKMessageSendEvent_SendAnnouncementSignatures_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures;")); + CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL); + LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL); + LDKMessageSendEvent_UpdateHTLCs_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs;")); + CHECK(LDKMessageSendEvent_UpdateHTLCs_class != NULL); + LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_UpdateHTLCs_meth != NULL); + LDKMessageSendEvent_SendRevokeAndACK_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK;")); + CHECK(LDKMessageSendEvent_SendRevokeAndACK_class != NULL); + LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL); + LDKMessageSendEvent_SendClosingSigned_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned;")); + CHECK(LDKMessageSendEvent_SendClosingSigned_class != NULL); + LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendClosingSigned_meth != NULL); + LDKMessageSendEvent_SendShutdown_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown;")); + CHECK(LDKMessageSendEvent_SendShutdown_class != NULL); + LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendShutdown_meth != NULL); + LDKMessageSendEvent_SendChannelReestablish_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish;")); + CHECK(LDKMessageSendEvent_SendChannelReestablish_class != NULL); + LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendChannelReestablish_meth != NULL); + LDKMessageSendEvent_BroadcastChannelAnnouncement_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement;")); + CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL); + LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "", "(JJ)V"); + CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL); + LDKMessageSendEvent_BroadcastNodeAnnouncement_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement;")); + CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_class != NULL); + LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, "", "(J)V"); + CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_meth != NULL); + LDKMessageSendEvent_BroadcastChannelUpdate_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate;")); + CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL); + LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "", "(J)V"); + CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL); + LDKMessageSendEvent_HandleError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$HandleError;")); + CHECK(LDKMessageSendEvent_HandleError_class != NULL); + LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_HandleError_meth != NULL); + LDKMessageSendEvent_PaymentFailureNetworkUpdate_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$PaymentFailureNetworkUpdate;")); + CHECK(LDKMessageSendEvent_PaymentFailureNetworkUpdate_class != NULL); + LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_PaymentFailureNetworkUpdate_class, "", "(J)V"); + CHECK(LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth != NULL); + LDKMessageSendEvent_SendChannelRangeQuery_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelRangeQuery;")); + CHECK(LDKMessageSendEvent_SendChannelRangeQuery_class != NULL); + LDKMessageSendEvent_SendChannelRangeQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelRangeQuery_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendChannelRangeQuery_meth != NULL); + LDKMessageSendEvent_SendShortIdsQuery_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendShortIdsQuery;")); + CHECK(LDKMessageSendEvent_SendShortIdsQuery_class != NULL); + LDKMessageSendEvent_SendShortIdsQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShortIdsQuery_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendShortIdsQuery_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { - LDKAPIError *obj = (LDKAPIError*)ptr; +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)ptr; switch(obj->tag) { - case LDKAPIError_APIMisuseError: { - LDKCVec_u8Z err_var = obj->api_misuse_error.err; - jbyteArray err_arr = (*_env)->NewByteArray(_env, err_var.datalen); - (*_env)->SetByteArrayRegion(_env, err_arr, 0, err_var.datalen, err_var.data); - return (*_env)->NewObject(_env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_arr); - } - case LDKAPIError_FeeRateTooHigh: { - LDKCVec_u8Z err_var = obj->fee_rate_too_high.err; - jbyteArray err_arr = (*_env)->NewByteArray(_env, err_var.datalen); - (*_env)->SetByteArrayRegion(_env, err_arr, 0, err_var.datalen, err_var.data); - return (*_env)->NewObject(_env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_arr, obj->fee_rate_too_high.feerate); + case LDKMessageSendEvent_SendAcceptChannel: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_accept_channel.node_id.compressed_form); + LDKAcceptChannel msg_var = obj->send_accept_channel.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref); } - case LDKAPIError_RouteError: { - LDKStr err_str = obj->route_error.err; - char* err_buf = MALLOC(err_str.len + 1, "str conv buf"); - memcpy(err_buf, err_str.chars, err_str.len); - err_buf[err_str.len] = 0; - jstring err_conv = (*_env)->NewStringUTF(_env, err_str.chars); - FREE(err_buf); - return (*_env)->NewObject(_env, LDKAPIError_RouteError_class, LDKAPIError_RouteError_meth, err_conv); + case LDKMessageSendEvent_SendOpenChannel: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_open_channel.node_id.compressed_form); + LDKOpenChannel msg_var = obj->send_open_channel.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref); } - case LDKAPIError_ChannelUnavailable: { - LDKCVec_u8Z err_var = obj->channel_unavailable.err; - jbyteArray err_arr = (*_env)->NewByteArray(_env, err_var.datalen); - (*_env)->SetByteArrayRegion(_env, err_arr, 0, err_var.datalen, err_var.data); - return (*_env)->NewObject(_env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_arr); + case LDKMessageSendEvent_SendFundingCreated: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_funding_created.node_id.compressed_form); + LDKFundingCreated msg_var = obj->send_funding_created.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref); } - case LDKAPIError_MonitorUpdateFailed: { - return (*_env)->NewObject(_env, LDKAPIError_MonitorUpdateFailed_class, LDKAPIError_MonitorUpdateFailed_meth); + case LDKMessageSendEvent_SendFundingSigned: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_funding_signed.node_id.compressed_form); + LDKFundingSigned msg_var = obj->send_funding_signed.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref); + } + case LDKMessageSendEvent_SendFundingLocked: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_funding_locked.node_id.compressed_form); + LDKFundingLocked msg_var = obj->send_funding_locked.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_arr, msg_ref); + } + case LDKMessageSendEvent_SendAnnouncementSignatures: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_announcement_signatures.node_id.compressed_form); + LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref); + } + case LDKMessageSendEvent_UpdateHTLCs: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->update_htl_cs.node_id.compressed_form); + LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates; + CHECK((((long)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long updates_ref = (long)updates_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref); + } + case LDKMessageSendEvent_SendRevokeAndACK: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_revoke_and_ack.node_id.compressed_form); + LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref); + } + case LDKMessageSendEvent_SendClosingSigned: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_closing_signed.node_id.compressed_form); + LDKClosingSigned msg_var = obj->send_closing_signed.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref); + } + case LDKMessageSendEvent_SendShutdown: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_shutdown.node_id.compressed_form); + LDKShutdown msg_var = obj->send_shutdown.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref); + } + case LDKMessageSendEvent_SendChannelReestablish: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_channel_reestablish.node_id.compressed_form); + LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref); + } + case LDKMessageSendEvent_BroadcastChannelAnnouncement: { + LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg; + CHECK((((long)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long update_msg_ref = (long)update_msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref); + } + case LDKMessageSendEvent_BroadcastNodeAnnouncement: { + LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref); + } + case LDKMessageSendEvent_BroadcastChannelUpdate: { + LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref); + } + case LDKMessageSendEvent_HandleError: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->handle_error.node_id.compressed_form); + long action_ref = (long)&obj->handle_error.action; + return (*_env)->NewObject(_env, LDKMessageSendEvent_HandleError_class, LDKMessageSendEvent_HandleError_meth, node_id_arr, action_ref); + } + case LDKMessageSendEvent_PaymentFailureNetworkUpdate: { + long update_ref = (long)&obj->payment_failure_network_update.update; + return (*_env)->NewObject(_env, LDKMessageSendEvent_PaymentFailureNetworkUpdate_class, LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth, update_ref); + } + case LDKMessageSendEvent_SendChannelRangeQuery: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_channel_range_query.node_id.compressed_form); + LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref); + } + case LDKMessageSendEvent_SendShortIdsQuery: { + jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_short_ids_query.node_id.compressed_form); + LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner & ~1; + return (*_env)->NewObject(_env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref); } default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok; -} -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_NoneAPIErrorZ *val = (LDKCResult_NoneAPIErrorZ*)arg; - CHECK(val->result_ok); - return *val->contents.result; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_NoneAPIErrorZ *val = (LDKCResult_NoneAPIErrorZ*)arg; - CHECK(!val->result_ok); - long err_ref = (long)&(*val->contents.err); - return err_ref; -} -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok; -} -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)arg; - CHECK(val->result_ok); - return *val->contents.result; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)arg; - CHECK(!val->result_ok); - LDKPaymentSendFailure err_var = (*val->contents.err); - CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long err_ref = (long)err_var.inner & ~1; - return err_ref; +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MessageSendEventZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_MessageSendEventZ *vec = (LDKCVec_MessageSendEventZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMessageSendEvent)); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1new(JNIEnv *_env, jclass _b, jlong a, jlong b, jlong c) { - LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate* ret = MALLOC(sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate), "LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate"); - LDKChannelAnnouncement a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - if (a_conv.inner != NULL) - a_conv = ChannelAnnouncement_clone(&a_conv); - ret->a = a_conv; - LDKChannelUpdate b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = (b & 1) || (b == 0); - if (b_conv.inner != NULL) - b_conv = ChannelUpdate_clone(&b_conv); - ret->b = b_conv; - LDKChannelUpdate c_conv; - c_conv.inner = (void*)(c & (~1)); - c_conv.is_owned = (c & 1) || (c == 0); - if (c_conv.inner != NULL) - c_conv = ChannelUpdate_clone(&c_conv); - ret->c = c_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MessageSendEventZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_MessageSendEventZ *ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKMessageSendEvent) * ret->datalen, "LDKCVec_MessageSendEventZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } return (long)ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *tuple = (LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)ptr; - LDKChannelAnnouncement a_var = tuple->a; - CHECK((((long)a_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&a_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long a_ref = (long)a_var.inner & ~1; - return a_ref; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *tuple = (LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)ptr; - LDKChannelUpdate b_var = tuple->b; - CHECK((((long)b_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&b_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long b_ref = (long)b_var.inner & ~1; - return b_ref; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *tuple = (LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)ptr; - LDKChannelUpdate c_var = tuple->c; - CHECK((((long)c_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&c_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long c_ref = (long)c_var.inner & ~1; - return c_ref; -} -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok; -} -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)arg; - CHECK(val->result_ok); - return *val->contents.result; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)arg; - CHECK(!val->result_ok); - LDKPeerHandleError err_var = (*val->contents.err); - CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long err_ref = (long)err_var.inner & ~1; - return err_ref; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1new(JNIEnv *_env, jclass _b, jlong a, jbyteArray b) { - LDKC2TupleTempl_HTLCOutputInCommitment__Signature* ret = MALLOC(sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature), "LDKC2TupleTempl_HTLCOutputInCommitment__Signature"); - LDKHTLCOutputInCommitment a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - if (a_conv.inner != NULL) - a_conv = HTLCOutputInCommitment_clone(&a_conv); - ret->a = a_conv; - LDKSignature b_ref; - CHECK((*_env)->GetArrayLength (_env, b) == 64); - (*_env)->GetByteArrayRegion (_env, b, 0, 64, b_ref.compact_form); - ret->b = b_ref; - return (long)ret; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1HTLCOutputInCommitmentSignatureZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_HTLCOutputInCommitment__Signature *tuple = (LDKC2TupleTempl_HTLCOutputInCommitment__Signature*)ptr; - LDKHTLCOutputInCommitment a_var = tuple->a; - CHECK((((long)a_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&a_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long a_ref = (long)a_var.inner & ~1; - return a_ref; -} -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1HTLCOutputInCommitmentSignatureZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { - LDKC2TupleTempl_HTLCOutputInCommitment__Signature *tuple = (LDKC2TupleTempl_HTLCOutputInCommitment__Signature*)ptr; - jbyteArray b_arr = (*_env)->NewByteArray(_env, 64); - (*_env)->SetByteArrayRegion(_env, b_arr, 0, 64, tuple->b.compact_form); - return b_arr; -} -static jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL; -static jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL; -static jclass LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class = NULL; -static jmethodID LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = NULL; -static jclass LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class = NULL; -static jmethodID LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv * env, jclass _a) { - LDKSpendableOutputDescriptor_StaticOutput_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput;")); - CHECK(LDKSpendableOutputDescriptor_StaticOutput_class != NULL); - LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "", "(JJ)V"); - CHECK(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL); - LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$DynamicOutputP2WSH;")); - CHECK(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class != NULL); - LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, "", "(J[BSJJ[B)V"); - CHECK(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth != NULL); - LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutputCounterpartyPayment;")); - CHECK(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class != NULL); - LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, "", "(JJJ)V"); - CHECK(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { - LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)ptr; - switch(obj->tag) { - case LDKSpendableOutputDescriptor_StaticOutput: { - LDKOutPoint outpoint_var = obj->static_output.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 & ~1; - long output_ref = (long)&obj->static_output.output; - return (*_env)->NewObject(_env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, output_ref); - } - case LDKSpendableOutputDescriptor_DynamicOutputP2WSH: { - LDKOutPoint outpoint_var = obj->dynamic_output_p2wsh.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 & ~1; - jbyteArray per_commitment_point_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, per_commitment_point_arr, 0, 33, obj->dynamic_output_p2wsh.per_commitment_point.compressed_form); - long output_ref = (long)&obj->dynamic_output_p2wsh.output; - long key_derivation_params_ref = (long)&obj->dynamic_output_p2wsh.key_derivation_params; - jbyteArray revocation_pubkey_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, revocation_pubkey_arr, 0, 33, obj->dynamic_output_p2wsh.revocation_pubkey.compressed_form); - return (*_env)->NewObject(_env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth, outpoint_ref, per_commitment_point_arr, obj->dynamic_output_p2wsh.to_self_delay, output_ref, key_derivation_params_ref, revocation_pubkey_arr); - } - case LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment: { - LDKOutPoint outpoint_var = obj->static_output_counterparty_payment.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 & ~1; - long output_ref = (long)&obj->static_output_counterparty_payment.output; - long key_derivation_params_ref = (long)&obj->static_output_counterparty_payment.key_derivation_params; - return (*_env)->NewObject(_env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth, outpoint_ref, output_ref, key_derivation_params_ref); - } - default: abort(); - } -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_SpendableOutputDescriptor *vec = (LDKCVecTempl_SpendableOutputDescriptor*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSpendableOutputDescriptor)); -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_SpendableOutputDescriptor *ret = MALLOC(sizeof(LDKCVecTempl_SpendableOutputDescriptor), "LDKCVecTempl_SpendableOutputDescriptor"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * ret->datalen, "LDKCVecTempl_SpendableOutputDescriptor Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)arr_elem; - FREE((void*)arr_elem); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (long)ret; -} -static jclass LDKEvent_FundingGenerationReady_class = NULL; -static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; -static jclass LDKEvent_FundingBroadcastSafe_class = NULL; -static jmethodID LDKEvent_FundingBroadcastSafe_meth = NULL; -static jclass LDKEvent_PaymentReceived_class = NULL; -static jmethodID LDKEvent_PaymentReceived_meth = NULL; -static jclass LDKEvent_PaymentSent_class = NULL; -static jmethodID LDKEvent_PaymentSent_meth = NULL; -static jclass LDKEvent_PaymentFailed_class = NULL; -static jmethodID LDKEvent_PaymentFailed_meth = NULL; -static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; -static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; -static jclass LDKEvent_SpendableOutputs_class = NULL; -static jmethodID LDKEvent_SpendableOutputs_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv * env, jclass _a) { - LDKEvent_FundingGenerationReady_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;")); - CHECK(LDKEvent_FundingGenerationReady_class != NULL); - LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([BJ[BJ)V"); - CHECK(LDKEvent_FundingGenerationReady_meth != NULL); - LDKEvent_FundingBroadcastSafe_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingBroadcastSafe;")); - CHECK(LDKEvent_FundingBroadcastSafe_class != NULL); - LDKEvent_FundingBroadcastSafe_meth = (*env)->GetMethodID(env, LDKEvent_FundingBroadcastSafe_class, "", "(JJ)V"); - CHECK(LDKEvent_FundingBroadcastSafe_meth != NULL); - LDKEvent_PaymentReceived_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;")); - CHECK(LDKEvent_PaymentReceived_class != NULL); - LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "([B[BJ)V"); - CHECK(LDKEvent_PaymentReceived_meth != NULL); - LDKEvent_PaymentSent_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;")); - CHECK(LDKEvent_PaymentSent_class != NULL); - LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "([B)V"); - CHECK(LDKEvent_PaymentSent_meth != NULL); - LDKEvent_PaymentFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentFailed;")); - CHECK(LDKEvent_PaymentFailed_class != NULL); - LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "", "([BZ)V"); - CHECK(LDKEvent_PaymentFailed_meth != NULL); - LDKEvent_PendingHTLCsForwardable_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;")); - CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); - LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); - CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL); - LDKEvent_SpendableOutputs_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;")); - CHECK(LDKEvent_SpendableOutputs_class != NULL); - LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "", "([J)V"); - CHECK(LDKEvent_SpendableOutputs_meth != NULL); +static jclass LDKEvent_FundingGenerationReady_class = NULL; +static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; +static jclass LDKEvent_FundingBroadcastSafe_class = NULL; +static jmethodID LDKEvent_FundingBroadcastSafe_meth = NULL; +static jclass LDKEvent_PaymentReceived_class = NULL; +static jmethodID LDKEvent_PaymentReceived_meth = NULL; +static jclass LDKEvent_PaymentSent_class = NULL; +static jmethodID LDKEvent_PaymentSent_meth = NULL; +static jclass LDKEvent_PaymentFailed_class = NULL; +static jmethodID LDKEvent_PaymentFailed_meth = NULL; +static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; +static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; +static jclass LDKEvent_SpendableOutputs_class = NULL; +static jmethodID LDKEvent_SpendableOutputs_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv * env, jclass _a) { + LDKEvent_FundingGenerationReady_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;")); + CHECK(LDKEvent_FundingGenerationReady_class != NULL); + LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([BJ[BJ)V"); + CHECK(LDKEvent_FundingGenerationReady_meth != NULL); + LDKEvent_FundingBroadcastSafe_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingBroadcastSafe;")); + CHECK(LDKEvent_FundingBroadcastSafe_class != NULL); + LDKEvent_FundingBroadcastSafe_meth = (*env)->GetMethodID(env, LDKEvent_FundingBroadcastSafe_class, "", "(JJ)V"); + CHECK(LDKEvent_FundingBroadcastSafe_meth != NULL); + LDKEvent_PaymentReceived_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;")); + CHECK(LDKEvent_PaymentReceived_class != NULL); + LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "([B[BJ)V"); + CHECK(LDKEvent_PaymentReceived_meth != NULL); + LDKEvent_PaymentSent_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;")); + CHECK(LDKEvent_PaymentSent_class != NULL); + LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "([B)V"); + CHECK(LDKEvent_PaymentSent_meth != NULL); + LDKEvent_PaymentFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentFailed;")); + CHECK(LDKEvent_PaymentFailed_class != NULL); + LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "", "([BZ)V"); + CHECK(LDKEvent_PaymentFailed_meth != NULL); + LDKEvent_PendingHTLCsForwardable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;")); + CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); + LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); + CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL); + LDKEvent_SpendableOutputs_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;")); + CHECK(LDKEvent_SpendableOutputs_class != NULL); + LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "", "([J)V"); + CHECK(LDKEvent_SpendableOutputs_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { LDKEvent *obj = (LDKEvent*)ptr; @@ -1102,473 +1067,2067 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr (J default: abort(); } } -static jclass LDKErrorAction_DisconnectPeer_class = NULL; -static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL; -static jclass LDKErrorAction_IgnoreError_class = NULL; -static jmethodID LDKErrorAction_IgnoreError_meth = NULL; -static jclass LDKErrorAction_SendErrorMessage_class = NULL; -static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv * env, jclass _a) { - LDKErrorAction_DisconnectPeer_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$DisconnectPeer;")); - CHECK(LDKErrorAction_DisconnectPeer_class != NULL); - LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "", "(J)V"); - CHECK(LDKErrorAction_DisconnectPeer_meth != NULL); - LDKErrorAction_IgnoreError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$IgnoreError;")); - CHECK(LDKErrorAction_IgnoreError_class != NULL); - LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "", "()V"); - CHECK(LDKErrorAction_IgnoreError_meth != NULL); - LDKErrorAction_SendErrorMessage_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$SendErrorMessage;")); - CHECK(LDKErrorAction_SendErrorMessage_class != NULL); - LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "", "(J)V"); - CHECK(LDKErrorAction_SendErrorMessage_meth != NULL); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1EventZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_EventZ *vec = (LDKCVec_EventZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKEvent)); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { - LDKErrorAction *obj = (LDKErrorAction*)ptr; - switch(obj->tag) { - case LDKErrorAction_DisconnectPeer: { - LDKErrorMessage msg_var = obj->disconnect_peer.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref); - } - case LDKErrorAction_IgnoreError: { - return (*_env)->NewObject(_env, LDKErrorAction_IgnoreError_class, LDKErrorAction_IgnoreError_meth); - } - case LDKErrorAction_SendErrorMessage: { - LDKErrorMessage msg_var = obj->send_error_message.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1EventZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_EventZ *ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKEvent) * ret->datalen, "LDKCVec_EventZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKEvent arr_elem_conv = *(LDKEvent*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; } - default: abort(); + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); } + return (long)ret; } -static jclass LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class = NULL; -static jmethodID LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth = NULL; -static jclass LDKHTLCFailChannelUpdate_ChannelClosed_class = NULL; -static jmethodID LDKHTLCFailChannelUpdate_ChannelClosed_meth = NULL; -static jclass LDKHTLCFailChannelUpdate_NodeFailure_class = NULL; -static jmethodID LDKHTLCFailChannelUpdate_NodeFailure_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCFailChannelUpdate_init (JNIEnv * env, jclass _a) { - LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$ChannelUpdateMessage;")); - CHECK(LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class != NULL); - LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class, "", "(J)V"); - CHECK(LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth != NULL); - LDKHTLCFailChannelUpdate_ChannelClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$ChannelClosed;")); - CHECK(LDKHTLCFailChannelUpdate_ChannelClosed_class != NULL); - LDKHTLCFailChannelUpdate_ChannelClosed_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_ChannelClosed_class, "", "(JZ)V"); - CHECK(LDKHTLCFailChannelUpdate_ChannelClosed_meth != NULL); - LDKHTLCFailChannelUpdate_NodeFailure_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$NodeFailure;")); - CHECK(LDKHTLCFailChannelUpdate_NodeFailure_class != NULL); - LDKHTLCFailChannelUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_NodeFailure_class, "", "([BZ)V"); - CHECK(LDKHTLCFailChannelUpdate_NodeFailure_meth != NULL); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1new(JNIEnv *_env, jclass _b, jlong a, jbyteArray b) { + LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + ret->a = a; + LDKTransaction b_ref; + b_ref.datalen = (*_env)->GetArrayLength (_env, b); + b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); + (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data); + b_ref.data_is_owned = false; + ret->b = b_ref; + return (long)ret; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { - LDKHTLCFailChannelUpdate *obj = (LDKHTLCFailChannelUpdate*)ptr; - switch(obj->tag) { - case LDKHTLCFailChannelUpdate_ChannelUpdateMessage: { - LDKChannelUpdate msg_var = obj->channel_update_message.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth, msg_ref); - } - case LDKHTLCFailChannelUpdate_ChannelClosed: { - return (*_env)->NewObject(_env, LDKHTLCFailChannelUpdate_ChannelClosed_class, LDKHTLCFailChannelUpdate_ChannelClosed_meth, obj->channel_closed.short_channel_id, obj->channel_closed.is_permanent); - } - case LDKHTLCFailChannelUpdate_NodeFailure: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->node_failure.node_id.compressed_form); - return (*_env)->NewObject(_env, LDKHTLCFailChannelUpdate_NodeFailure_class, LDKHTLCFailChannelUpdate_NodeFailure_meth, node_id_arr, obj->node_failure.is_permanent); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_usizeTransactionZ *tuple = (LDKC2Tuple_usizeTransactionZ*)ptr; + return tuple->a; +} +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_usizeTransactionZ *tuple = (LDKC2Tuple_usizeTransactionZ*)ptr; + LDKTransaction b_var = tuple->b; + jbyteArray b_arr = (*_env)->NewByteArray(_env, b_var.datalen); + (*_env)->SetByteArrayRegion(_env, b_arr, 0, b_var.datalen, b_var.data); + return b_arr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1usizeTransactionZZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_C2Tuple_usizeTransactionZZ *vec = (LDKCVec_C2Tuple_usizeTransactionZZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2Tuple_usizeTransactionZ)); +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1usizeTransactionZZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_C2Tuple_usizeTransactionZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "LDKCVec_C2Tuple_usizeTransactionZZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * ret->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; } - default: abort(); + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); } + return (long)ret; } -static jclass LDKMessageSendEvent_SendAcceptChannel_class = NULL; -static jmethodID LDKMessageSendEvent_SendAcceptChannel_meth = NULL; -static jclass LDKMessageSendEvent_SendOpenChannel_class = NULL; -static jmethodID LDKMessageSendEvent_SendOpenChannel_meth = NULL; -static jclass LDKMessageSendEvent_SendFundingCreated_class = NULL; -static jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL; -static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL; -static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL; -static jclass LDKMessageSendEvent_SendFundingLocked_class = NULL; -static jmethodID LDKMessageSendEvent_SendFundingLocked_meth = NULL; -static jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL; -static jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL; -static jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL; -static jmethodID LDKMessageSendEvent_UpdateHTLCs_meth = NULL; -static jclass LDKMessageSendEvent_SendRevokeAndACK_class = NULL; -static jmethodID LDKMessageSendEvent_SendRevokeAndACK_meth = NULL; -static jclass LDKMessageSendEvent_SendClosingSigned_class = NULL; -static jmethodID LDKMessageSendEvent_SendClosingSigned_meth = NULL; -static jclass LDKMessageSendEvent_SendShutdown_class = NULL; -static jmethodID LDKMessageSendEvent_SendShutdown_meth = NULL; -static jclass LDKMessageSendEvent_SendChannelReestablish_class = NULL; -static jmethodID LDKMessageSendEvent_SendChannelReestablish_meth = NULL; -static jclass LDKMessageSendEvent_BroadcastChannelAnnouncement_class = NULL; -static jmethodID LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = NULL; -static jclass LDKMessageSendEvent_BroadcastNodeAnnouncement_class = NULL; -static jmethodID LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = NULL; -static jclass LDKMessageSendEvent_BroadcastChannelUpdate_class = NULL; -static jmethodID LDKMessageSendEvent_BroadcastChannelUpdate_meth = NULL; -static jclass LDKMessageSendEvent_HandleError_class = NULL; -static jmethodID LDKMessageSendEvent_HandleError_meth = NULL; -static jclass LDKMessageSendEvent_PaymentFailureNetworkUpdate_class = NULL; -static jmethodID LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv * env, jclass _a) { - LDKMessageSendEvent_SendAcceptChannel_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel;")); - CHECK(LDKMessageSendEvent_SendAcceptChannel_class != NULL); - LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendAcceptChannel_meth != NULL); - LDKMessageSendEvent_SendOpenChannel_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel;")); - CHECK(LDKMessageSendEvent_SendOpenChannel_class != NULL); - LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendOpenChannel_meth != NULL); - LDKMessageSendEvent_SendFundingCreated_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated;")); - CHECK(LDKMessageSendEvent_SendFundingCreated_class != NULL); - LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendFundingCreated_meth != NULL); - LDKMessageSendEvent_SendFundingSigned_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned;")); - CHECK(LDKMessageSendEvent_SendFundingSigned_class != NULL); - LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendFundingSigned_meth != NULL); - LDKMessageSendEvent_SendFundingLocked_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked;")); - CHECK(LDKMessageSendEvent_SendFundingLocked_class != NULL); - LDKMessageSendEvent_SendFundingLocked_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingLocked_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendFundingLocked_meth != NULL); - LDKMessageSendEvent_SendAnnouncementSignatures_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures;")); - CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL); - LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL); - LDKMessageSendEvent_UpdateHTLCs_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs;")); - CHECK(LDKMessageSendEvent_UpdateHTLCs_class != NULL); - LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_UpdateHTLCs_meth != NULL); - LDKMessageSendEvent_SendRevokeAndACK_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK;")); - CHECK(LDKMessageSendEvent_SendRevokeAndACK_class != NULL); - LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL); - LDKMessageSendEvent_SendClosingSigned_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned;")); - CHECK(LDKMessageSendEvent_SendClosingSigned_class != NULL); - LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendClosingSigned_meth != NULL); - LDKMessageSendEvent_SendShutdown_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown;")); - CHECK(LDKMessageSendEvent_SendShutdown_class != NULL); - LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendShutdown_meth != NULL); - LDKMessageSendEvent_SendChannelReestablish_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish;")); - CHECK(LDKMessageSendEvent_SendChannelReestablish_class != NULL); - LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendChannelReestablish_meth != NULL); - LDKMessageSendEvent_BroadcastChannelAnnouncement_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement;")); - CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL); - LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "", "(JJ)V"); - CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL); - LDKMessageSendEvent_BroadcastNodeAnnouncement_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement;")); - CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_class != NULL); - LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, "", "(J)V"); - CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_meth != NULL); - LDKMessageSendEvent_BroadcastChannelUpdate_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate;")); - CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL); - LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "", "(J)V"); - CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL); - LDKMessageSendEvent_HandleError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$HandleError;")); - CHECK(LDKMessageSendEvent_HandleError_class != NULL); - LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_HandleError_meth != NULL); - LDKMessageSendEvent_PaymentFailureNetworkUpdate_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$PaymentFailureNetworkUpdate;")); - CHECK(LDKMessageSendEvent_PaymentFailureNetworkUpdate_class != NULL); - LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_PaymentFailureNetworkUpdate_class, "", "(J)V"); - CHECK(LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth != NULL); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { - LDKMessageSendEvent *obj = (LDKMessageSendEvent*)ptr; - switch(obj->tag) { - case LDKMessageSendEvent_SendAcceptChannel: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_accept_channel.node_id.compressed_form); - LDKAcceptChannel msg_var = obj->send_accept_channel.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref); - } - case LDKMessageSendEvent_SendOpenChannel: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_open_channel.node_id.compressed_form); - LDKOpenChannel msg_var = obj->send_open_channel.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref); - } - case LDKMessageSendEvent_SendFundingCreated: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_funding_created.node_id.compressed_form); - LDKFundingCreated msg_var = obj->send_funding_created.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref); - } - case LDKMessageSendEvent_SendFundingSigned: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_funding_signed.node_id.compressed_form); - LDKFundingSigned msg_var = obj->send_funding_signed.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref); - } - case LDKMessageSendEvent_SendFundingLocked: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_funding_locked.node_id.compressed_form); - LDKFundingLocked msg_var = obj->send_funding_locked.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_arr, msg_ref); - } - case LDKMessageSendEvent_SendAnnouncementSignatures: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_announcement_signatures.node_id.compressed_form); - LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref); - } - case LDKMessageSendEvent_UpdateHTLCs: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->update_htl_cs.node_id.compressed_form); - LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates; - CHECK((((long)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long updates_ref = (long)updates_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref); - } - case LDKMessageSendEvent_SendRevokeAndACK: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_revoke_and_ack.node_id.compressed_form); - LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref); - } - case LDKMessageSendEvent_SendClosingSigned: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_closing_signed.node_id.compressed_form); - LDKClosingSigned msg_var = obj->send_closing_signed.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ *val = (LDKCResult_NoneChannelMonitorUpdateErrZ*)arg; + CHECK(val->result_ok); + return *val->contents.result; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ *val = (LDKCResult_NoneChannelMonitorUpdateErrZ*)arg; + CHECK(!val->result_ok); + jclass err_conv = LDKChannelMonitorUpdateErr_to_java(_env, (*val->contents.err)); + return err_conv; +} +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_MonitorEventZ *vec = (LDKCVec_MonitorEventZ*)ptr; + jlongArray ret = (*env)->NewLongArray(env, vec->datalen); + jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); + for (size_t i = 0; i < vec->datalen; i++) { + CHECK((((long)vec->data[i].inner) & 1) == 0); + ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); + return ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_MonitorEventZ *ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKMonitorEvent) * ret->datalen, "LDKCVec_MonitorEventZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKMonitorEvent arr_elem_conv; + arr_elem_conv.inner = (void*)(arr_elem & (~1)); + arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); + if (arr_elem_conv.inner != NULL) + arr_elem_conv = MonitorEvent_clone(&arr_elem_conv); + ret->data[i] = arr_elem_conv; } - case LDKMessageSendEvent_SendShutdown: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_shutdown.node_id.compressed_form); - LDKShutdown msg_var = obj->send_shutdown.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref); - } - case LDKMessageSendEvent_SendChannelReestablish: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->send_channel_reestablish.node_id.compressed_form); - LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref); - } - case LDKMessageSendEvent_BroadcastChannelAnnouncement: { - LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg; - CHECK((((long)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long update_msg_ref = (long)update_msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref); - } - case LDKMessageSendEvent_BroadcastNodeAnnouncement: { - LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref); - } - case LDKMessageSendEvent_BroadcastChannelUpdate: { - LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg; - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner & ~1; - return (*_env)->NewObject(_env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref); + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKChannelMonitorUpdate res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)arg; + CHECK(val->result_ok); + return *val->contents.result; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)arg; + CHECK(!val->result_ok); + LDKMonitorUpdateError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1new(JNIEnv *_env, jclass _b, jlong a, jbyteArray b) { + LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + if (a_conv.inner != NULL) + a_conv = OutPoint_clone(&a_conv); + ret->a = a_conv; + LDKCVec_u8Z b_ref; + b_ref.datalen = (*_env)->GetArrayLength (_env, b); + b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); + (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data); + ret->b = b_ref; + return (long)ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_OutPointScriptZ *tuple = (LDKC2Tuple_OutPointScriptZ*)ptr; + LDKOutPoint a_var = tuple->a; + CHECK((((long)a_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&a_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long a_ref = (long)a_var.inner & ~1; + return a_ref; +} +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_OutPointScriptZ *tuple = (LDKC2Tuple_OutPointScriptZ*)ptr; + LDKCVec_u8Z b_var = tuple->b; + jbyteArray b_arr = (*_env)->NewByteArray(_env, b_var.datalen); + (*_env)->SetByteArrayRegion(_env, b_arr, 0, b_var.datalen, b_var.data); + return b_arr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TransactionZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_TransactionZ *vec = (LDKCVec_TransactionZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTransaction)); +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32TxOutZ_1new(JNIEnv *_env, jclass _b, jint a, jlong b) { + LDKC2Tuple_u32TxOutZ* ret = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + ret->a = a; + LDKTxOut b_conv = *(LDKTxOut*)b; + FREE((void*)b); + ret->b = b_conv; + return (long)ret; +} +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32TxOutZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_u32TxOutZ *tuple = (LDKC2Tuple_u32TxOutZ*)ptr; + return tuple->a; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32TxOutZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_u32TxOutZ *tuple = (LDKC2Tuple_u32TxOutZ*)ptr; + long b_ref = (long)&tuple->b; + return (long)b_ref; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32TxOutZZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_C2Tuple_u32TxOutZZ *vec = (LDKCVec_C2Tuple_u32TxOutZZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2Tuple_u32TxOutZ)); +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32TxOutZZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_C2Tuple_u32TxOutZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32TxOutZZ), "LDKCVec_C2Tuple_u32TxOutZZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * ret->datalen, "LDKCVec_C2Tuple_u32TxOutZZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; } - case LDKMessageSendEvent_HandleError: { - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, obj->handle_error.node_id.compressed_form); - long action_ref = (long)&obj->handle_error.action; - return (*_env)->NewObject(_env, LDKMessageSendEvent_HandleError_class, LDKMessageSendEvent_HandleError_meth, node_id_arr, action_ref); + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *_env, jclass _b, jbyteArray a, jlongArray b) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + LDKThirtyTwoBytes a_ref; + CHECK((*_env)->GetArrayLength (_env, a) == 32); + (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data); + ret->a = a_ref; + LDKCVec_C2Tuple_u32TxOutZZ b_constr; + b_constr.datalen = (*_env)->GetArrayLength (_env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); + else + b_constr.data = NULL; + long* b_vals = (*_env)->GetLongArrayElements (_env, b, NULL); + for (size_t a = 0; a < b_constr.datalen; a++) { + long arr_conv_26 = b_vals[a]; + LDKC2Tuple_u32TxOutZ arr_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)arr_conv_26; + FREE((void*)arr_conv_26); + b_constr.data[a] = arr_conv_26_conv; + } + (*_env)->ReleaseLongArrayElements (_env, b, b_vals, 0); + ret->b = b_constr; + return (long)ret; +} +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *tuple = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)ptr; + jbyteArray a_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, a_arr, 0, 32, tuple->a.data); + return a_arr; +} +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *tuple = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)ptr; + LDKCVec_C2Tuple_u32TxOutZZ b_var = tuple->b; + jlongArray b_arr = (*_env)->NewLongArray(_env, b_var.datalen); + jlong *b_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, b_arr, NULL); + for (size_t a = 0; a < b_var.datalen; a++) { + long arr_conv_26_ref = (long)&b_var.data[a]; + b_arr_ptr[a] = arr_conv_26_ref; + } + (*_env)->ReleasePrimitiveArrayCritical(_env, b_arr, b_arr_ptr, 0); + return b_arr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *vec = (LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ)); +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; } - case LDKMessageSendEvent_PaymentFailureNetworkUpdate: { - long update_ref = (long)&obj->payment_failure_network_update.update; - return (*_env)->NewObject(_env, LDKMessageSendEvent_PaymentFailureNetworkUpdate_class, LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth, update_ref); + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SignatureZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_SignatureZ *vec = (LDKCVec_SignatureZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSignature)); +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *_env, jclass _b, jbyteArray a, jobjectArray b) { + LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + LDKSignature a_ref; + CHECK((*_env)->GetArrayLength (_env, a) == 64); + (*_env)->GetByteArrayRegion (_env, a, 0, 64, a_ref.compact_form); + ret->a = a_ref; + LDKCVec_SignatureZ b_constr; + b_constr.datalen = (*_env)->GetArrayLength (_env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + b_constr.data = NULL; + for (size_t i = 0; i < b_constr.datalen; i++) { + jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, b, i); + LDKSignature arr_conv_8_ref; + CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 64); + (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form); + b_constr.data[i] = arr_conv_8_ref; + } + ret->b = b_constr; + return (long)ret; +} +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_SignatureCVec_SignatureZZ *tuple = (LDKC2Tuple_SignatureCVec_SignatureZZ*)ptr; + jbyteArray a_arr = (*_env)->NewByteArray(_env, 64); + (*_env)->SetByteArrayRegion(_env, a_arr, 0, 64, tuple->a.compact_form); + return a_arr; +} +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_SignatureCVec_SignatureZZ *tuple = (LDKC2Tuple_SignatureCVec_SignatureZZ*)ptr; + LDKCVec_SignatureZ b_var = tuple->b; + jobjectArray b_arr = (*_env)->NewObjectArray(_env, b_var.datalen, arr_of_B_clz, NULL); + for (size_t i = 0; i < b_var.datalen; i++) { + jbyteArray arr_conv_8_arr = (*_env)->NewByteArray(_env, 64); + (*_env)->SetByteArrayRegion(_env, arr_conv_8_arr, 0, 64, b_var.data[i].compact_form); + (*_env)->SetObjectArrayElement(_env, b_arr, i, arr_conv_8_arr); + } + return b_arr; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *val = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg; + CHECK(val->result_ok); + long res_ref = (long)&(*val->contents.result); + return res_ref; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *val = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg; + CHECK(!val->result_ok); + return *val->contents.err; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_SignatureNoneZ*)arg)->result_ok; +} +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_SignatureNoneZ *val = (LDKCResult_SignatureNoneZ*)arg; + CHECK(val->result_ok); + jbyteArray res_arr = (*_env)->NewByteArray(_env, 64); + (*_env)->SetByteArrayRegion(_env, res_arr, 0, 64, (*val->contents.result).compact_form); + return res_arr; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_SignatureNoneZ *val = (LDKCResult_SignatureNoneZ*)arg; + CHECK(!val->result_ok); + return *val->contents.err; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok; +} +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)arg; + CHECK(val->result_ok); + LDKCVec_SignatureZ res_var = (*val->contents.result); + jobjectArray res_arr = (*_env)->NewObjectArray(_env, res_var.datalen, arr_of_B_clz, NULL); + for (size_t i = 0; i < res_var.datalen; i++) { + jbyteArray arr_conv_8_arr = (*_env)->NewByteArray(_env, 64); + (*_env)->SetByteArrayRegion(_env, arr_conv_8_arr, 0, 64, res_var.data[i].compact_form); + (*_env)->SetObjectArrayElement(_env, res_arr, i, arr_conv_8_arr); + } + return res_arr; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)arg; + CHECK(!val->result_ok); + return *val->contents.err; +} +typedef struct LDKChannelKeys_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID get_per_commitment_point_meth; + jmethodID release_commitment_secret_meth; + jmethodID key_derivation_params_meth; + jmethodID sign_counterparty_commitment_meth; + jmethodID sign_holder_commitment_meth; + jmethodID sign_holder_commitment_htlc_transactions_meth; + jmethodID sign_justice_transaction_meth; + jmethodID sign_counterparty_htlc_transaction_meth; + jmethodID sign_closing_transaction_meth; + jmethodID sign_channel_announcement_meth; + jmethodID ready_channel_meth; + jmethodID write_meth; +} LDKChannelKeys_JCalls; +LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_per_commitment_point_meth, idx); + LDKPublicKey arg_ref; + CHECK((*_env)->GetArrayLength (_env, arg) == 33); + (*_env)->GetByteArrayRegion (_env, arg, 0, 33, arg_ref.compressed_form); + return arg_ref; +} +LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->release_commitment_secret_meth, idx); + LDKThirtyTwoBytes arg_ref; + CHECK((*_env)->GetArrayLength (_env, arg) == 32); + (*_env)->GetByteArrayRegion (_env, arg, 0, 32, arg_ref.data); + return arg_ref; +} +LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*_env)->CallLongMethod(_env, obj, j_calls->key_derivation_params_meth); + LDKC2Tuple_u64u64Z ret_conv = *(LDKC2Tuple_u64u64Z*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_jcall(const void* this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKCommitmentTransaction commitment_tx_var = *commitment_tx; + if (commitment_tx->inner != NULL) + commitment_tx_var = CommitmentTransaction_clone(commitment_tx); + CHECK((((long)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long commitment_tx_ref = (long)commitment_tx_var.inner; + if (commitment_tx_var.is_owned) { + commitment_tx_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_counterparty_commitment_meth, commitment_tx_ref); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx; + if (commitment_tx->inner != NULL) + commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); + CHECK((((long)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long commitment_tx_ref = (long)commitment_tx_var.inner; + if (commitment_tx_var.is_owned) { + commitment_tx_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_holder_commitment_meth, commitment_tx_ref); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(const void* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx; + if (commitment_tx->inner != NULL) + commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); + CHECK((((long)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long commitment_tx_ref = (long)commitment_tx_var.inner; + if (commitment_tx_var.is_owned) { + commitment_tx_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_CVec_SignatureZNoneZ* ret = (LDKCResult_CVec_SignatureZNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_holder_commitment_htlc_transactions_meth, commitment_tx_ref); + LDKCResult_CVec_SignatureZNoneZ ret_conv = *(LDKCResult_CVec_SignatureZNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKTransaction justice_tx_var = justice_tx; + jbyteArray justice_tx_arr = (*_env)->NewByteArray(_env, justice_tx_var.datalen); + (*_env)->SetByteArrayRegion(_env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data); + Transaction_free(justice_tx_var); + jbyteArray per_commitment_key_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, per_commitment_key_arr, 0, 32, *per_commitment_key); + LDKHTLCOutputInCommitment htlc_var = *htlc; + if (htlc->inner != NULL) + htlc_var = HTLCOutputInCommitment_clone(htlc); + CHECK((((long)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long htlc_ref = (long)htlc_var.inner; + if (htlc_var.is_owned) { + htlc_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_justice_transaction_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKTransaction htlc_tx_var = htlc_tx; + jbyteArray htlc_tx_arr = (*_env)->NewByteArray(_env, htlc_tx_var.datalen); + (*_env)->SetByteArrayRegion(_env, htlc_tx_arr, 0, htlc_tx_var.datalen, htlc_tx_var.data); + Transaction_free(htlc_tx_var); + jbyteArray per_commitment_point_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, per_commitment_point_arr, 0, 33, per_commitment_point.compressed_form); + LDKHTLCOutputInCommitment htlc_var = *htlc; + if (htlc->inner != NULL) + htlc_var = HTLCOutputInCommitment_clone(htlc); + CHECK((((long)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long htlc_ref = (long)htlc_var.inner; + if (htlc_var.is_owned) { + htlc_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, struct LDKTransaction closing_tx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKTransaction closing_tx_var = closing_tx; + jbyteArray closing_tx_arr = (*_env)->NewByteArray(_env, closing_tx_var.datalen); + (*_env)->SetByteArrayRegion(_env, closing_tx_arr, 0, closing_tx_var.datalen, closing_tx_var.data); + Transaction_free(closing_tx_var); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_closing_transaction_meth, closing_tx_arr); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKUnsignedChannelAnnouncement msg_var = *msg; + if (msg->inner != NULL) + msg_var = UnsignedChannelAnnouncement_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_channel_announcement_meth, msg_ref); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +void ready_channel_jcall(void* this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKChannelTransactionParameters channel_parameters_var = *channel_parameters; + if (channel_parameters->inner != NULL) + channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters); + CHECK((((long)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long channel_parameters_ref = (long)channel_parameters_var.inner; + if (channel_parameters_var.is_owned) { + channel_parameters_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->ready_channel_meth, channel_parameters_ref); +} +LDKCVec_u8Z write_jcall(const void* this_arg) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->write_meth); + LDKCVec_u8Z arg_ref; + arg_ref.datalen = (*_env)->GetArrayLength (_env, arg); + arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*_env)->GetByteArrayRegion(_env, arg, 0, arg_ref.datalen, arg_ref.data); + return arg_ref; +} +static void LDKChannelKeys_JCalls_free(void* this_arg) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + FREE(j_calls); + } +} +static void* LDKChannelKeys_JCalls_clone(const void* this_arg) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobject o, jlong pubkeys) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)[B"); + CHECK(calls->get_per_commitment_point_meth != NULL); + calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B"); + CHECK(calls->release_commitment_secret_meth != NULL); + calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J"); + CHECK(calls->key_derivation_params_meth != NULL); + calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(J)J"); + CHECK(calls->sign_counterparty_commitment_meth != NULL); + calls->sign_holder_commitment_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment", "(J)J"); + CHECK(calls->sign_holder_commitment_meth != NULL); + calls->sign_holder_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_htlc_transactions", "(J)J"); + CHECK(calls->sign_holder_commitment_htlc_transactions_meth != NULL); + calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "([BJJ[BJ)J"); + CHECK(calls->sign_justice_transaction_meth != NULL); + calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "([BJJ[BJ)J"); + CHECK(calls->sign_counterparty_htlc_transaction_meth != NULL); + calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "([B)J"); + CHECK(calls->sign_closing_transaction_meth != NULL); + calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J"); + CHECK(calls->sign_channel_announcement_meth != NULL); + calls->ready_channel_meth = (*env)->GetMethodID(env, c, "ready_channel", "(J)V"); + CHECK(calls->ready_channel_meth != NULL); + calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B"); + CHECK(calls->write_meth != NULL); + + LDKChannelPublicKeys pubkeys_conv; + pubkeys_conv.inner = (void*)(pubkeys & (~1)); + pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); + if (pubkeys_conv.inner != NULL) + pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + + LDKChannelKeys ret = { + .this_arg = (void*) calls, + .get_per_commitment_point = get_per_commitment_point_jcall, + .release_commitment_secret = release_commitment_secret_jcall, + .key_derivation_params = key_derivation_params_jcall, + .sign_counterparty_commitment = sign_counterparty_commitment_jcall, + .sign_holder_commitment = sign_holder_commitment_jcall, + .sign_holder_commitment_htlc_transactions = sign_holder_commitment_htlc_transactions_jcall, + .sign_justice_transaction = sign_justice_transaction_jcall, + .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall, + .sign_closing_transaction = sign_closing_transaction_jcall, + .sign_channel_announcement = sign_channel_announcement_jcall, + .ready_channel = ready_channel_jcall, + .clone = LDKChannelKeys_JCalls_clone, + .write = write_jcall, + .free = LDKChannelKeys_JCalls_free, + .pubkeys = pubkeys_conv, + .set_pubkeys = NULL, + }; + return ret; +} +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o, jlong pubkeys) { + LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys"); + *res_ptr = LDKChannelKeys_init(env, _a, o, pubkeys); + return (long)res_ptr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKChannelKeys_JCalls*)val)->o); + CHECK(ret != NULL); + return ret; +} +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg, jlong idx) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form); + return arg_arr; +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1release_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_arg, jlong idx) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data); + return arg_arr; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1key_1derivation_1params(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKC2Tuple_u64u64Z* ret_ref = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); + *ret_ref = (this_arg_conv->key_derivation_params)(this_arg_conv->this_arg); + return (long)ret_ref; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1commitment(JNIEnv * _env, jclass _b, jlong this_arg, jlong commitment_tx) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKCommitmentTransaction commitment_tx_conv; + commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); + commitment_tx_conv.is_owned = false; + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1holder_1commitment(JNIEnv * _env, jclass _b, jlong this_arg, jlong commitment_tx) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKHolderCommitmentTransaction commitment_tx_conv; + commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); + commitment_tx_conv.is_owned = false; + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_holder_commitment)(this_arg_conv->this_arg, &commitment_tx_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1holder_1commitment_1htlc_1transactions(JNIEnv * _env, jclass _b, jlong this_arg, jlong commitment_tx) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKHolderCommitmentTransaction commitment_tx_conv; + commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); + commitment_tx_conv.is_owned = false; + LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = (this_arg_conv->sign_holder_commitment_htlc_transactions)(this_arg_conv->this_arg, &commitment_tx_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1justice_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray justice_tx, jlong input, jlong amount, jbyteArray per_commitment_key, jlong htlc) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKTransaction justice_tx_ref; + justice_tx_ref.datalen = (*_env)->GetArrayLength (_env, justice_tx); + justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); + (*_env)->GetByteArrayRegion(_env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data); + justice_tx_ref.data_is_owned = true; + unsigned char per_commitment_key_arr[32]; + CHECK((*_env)->GetArrayLength (_env, per_commitment_key) == 32); + (*_env)->GetByteArrayRegion (_env, per_commitment_key, 0, 32, per_commitment_key_arr); + unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr; + LDKHTLCOutputInCommitment htlc_conv; + htlc_conv.inner = (void*)(htlc & (~1)); + htlc_conv.is_owned = false; + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_justice_transaction)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref, &htlc_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1htlc_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_tx, jlong input, jlong amount, jbyteArray per_commitment_point, jlong htlc) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKTransaction htlc_tx_ref; + htlc_tx_ref.datalen = (*_env)->GetArrayLength (_env, htlc_tx); + htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes"); + (*_env)->GetByteArrayRegion(_env, htlc_tx, 0, htlc_tx_ref.datalen, htlc_tx_ref.data); + htlc_tx_ref.data_is_owned = true; + LDKPublicKey per_commitment_point_ref; + CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); + (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKHTLCOutputInCommitment htlc_conv; + htlc_conv.inner = (void*)(htlc & (~1)); + htlc_conv.is_owned = false; + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_ref, input, amount, per_commitment_point_ref, &htlc_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1closing_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray closing_tx) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKTransaction closing_tx_ref; + closing_tx_ref.datalen = (*_env)->GetArrayLength (_env, closing_tx); + closing_tx_ref.data = MALLOC(closing_tx_ref.datalen, "LDKTransaction Bytes"); + (*_env)->GetByteArrayRegion(_env, closing_tx, 0, closing_tx_ref.datalen, closing_tx_ref.data); + closing_tx_ref.data_is_owned = true; + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, closing_tx_ref); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1channel_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKUnsignedChannelAnnouncement msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv); + return (long)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1ready_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong channel_parameters) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKChannelTransactionParameters channel_parameters_conv; + channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); + channel_parameters_conv.is_owned = false; + (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv); +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1write(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKCVec_u8Z arg_var = (this_arg_conv->write)(this_arg_conv->this_arg); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; +} + +LDKChannelPublicKeys LDKChannelKeys_set_get_pubkeys(LDKChannelKeys* this_arg) { + if (this_arg->set_pubkeys != NULL) + this_arg->set_pubkeys(this_arg); + return this_arg->pubkeys; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1get_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; + LDKChannelPublicKeys ret_var = LDKChannelKeys_set_get_pubkeys(this_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 jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *_env, jclass _b, jbyteArray a, jlong b) { + LDKC2Tuple_BlockHashChannelMonitorZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + LDKThirtyTwoBytes a_ref; + CHECK((*_env)->GetArrayLength (_env, a) == 32); + (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data); + ret->a = a_ref; + LDKChannelMonitor b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + // Warning: we may need a move here but can't clone! + ret->b = b_conv; + return (long)ret; +} +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelMonitorZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_BlockHashChannelMonitorZ *tuple = (LDKC2Tuple_BlockHashChannelMonitorZ*)ptr; + jbyteArray a_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, a_arr, 0, 32, tuple->a.data); + return a_arr; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelMonitorZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_BlockHashChannelMonitorZ *tuple = (LDKC2Tuple_BlockHashChannelMonitorZ*)ptr; + LDKChannelMonitor b_var = tuple->b; + CHECK((((long)b_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&b_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long b_ref = (long)b_var.inner & ~1; + return b_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)arg; + CHECK(val->result_ok); + long res_ref = (long)&(*val->contents.result); + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)arg; + CHECK(val->result_ok); + long res_ref = (long)&(*val->contents.result); + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChanKeySignerDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_ChanKeySignerDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChanKeySignerDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ChanKeySignerDecodeErrorZ *val = (LDKCResult_ChanKeySignerDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys"); + *ret = (*val->contents.result); + return (long)ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChanKeySignerDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ChanKeySignerDecodeErrorZ *val = (LDKCResult_ChanKeySignerDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_InMemoryChannelKeysDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_InMemoryChannelKeysDecodeErrorZ *val = (LDKCResult_InMemoryChannelKeysDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKInMemoryChannelKeys res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_InMemoryChannelKeysDecodeErrorZ *val = (LDKCResult_InMemoryChannelKeysDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_TxOutAccessErrorZ *val = (LDKCResult_TxOutAccessErrorZ*)arg; + CHECK(val->result_ok); + long res_ref = (long)&(*val->contents.result); + return (long)res_ref; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_TxOutAccessErrorZ *val = (LDKCResult_TxOutAccessErrorZ*)arg; + CHECK(!val->result_ok); + jclass err_conv = LDKAccessError_to_java(_env, (*val->contents.err)); + return err_conv; +} +static jclass LDKAPIError_APIMisuseError_class = NULL; +static jmethodID LDKAPIError_APIMisuseError_meth = NULL; +static jclass LDKAPIError_FeeRateTooHigh_class = NULL; +static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL; +static jclass LDKAPIError_RouteError_class = NULL; +static jmethodID LDKAPIError_RouteError_meth = NULL; +static jclass LDKAPIError_ChannelUnavailable_class = NULL; +static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL; +static jclass LDKAPIError_MonitorUpdateFailed_class = NULL; +static jmethodID LDKAPIError_MonitorUpdateFailed_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv * env, jclass _a) { + LDKAPIError_APIMisuseError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$APIMisuseError;")); + CHECK(LDKAPIError_APIMisuseError_class != NULL); + LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "", "([B)V"); + CHECK(LDKAPIError_APIMisuseError_meth != NULL); + LDKAPIError_FeeRateTooHigh_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh;")); + CHECK(LDKAPIError_FeeRateTooHigh_class != NULL); + LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "", "([BI)V"); + CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL); + LDKAPIError_RouteError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$RouteError;")); + CHECK(LDKAPIError_RouteError_class != NULL); + LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKAPIError_RouteError_meth != NULL); + LDKAPIError_ChannelUnavailable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$ChannelUnavailable;")); + CHECK(LDKAPIError_ChannelUnavailable_class != NULL); + LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "", "([B)V"); + CHECK(LDKAPIError_ChannelUnavailable_meth != NULL); + LDKAPIError_MonitorUpdateFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed;")); + CHECK(LDKAPIError_MonitorUpdateFailed_class != NULL); + LDKAPIError_MonitorUpdateFailed_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateFailed_class, "", "()V"); + CHECK(LDKAPIError_MonitorUpdateFailed_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { + LDKAPIError *obj = (LDKAPIError*)ptr; + switch(obj->tag) { + case LDKAPIError_APIMisuseError: { + LDKCVec_u8Z err_var = obj->api_misuse_error.err; + jbyteArray err_arr = (*_env)->NewByteArray(_env, err_var.datalen); + (*_env)->SetByteArrayRegion(_env, err_arr, 0, err_var.datalen, err_var.data); + return (*_env)->NewObject(_env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_arr); + } + case LDKAPIError_FeeRateTooHigh: { + LDKCVec_u8Z err_var = obj->fee_rate_too_high.err; + jbyteArray err_arr = (*_env)->NewByteArray(_env, err_var.datalen); + (*_env)->SetByteArrayRegion(_env, err_arr, 0, err_var.datalen, err_var.data); + return (*_env)->NewObject(_env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_arr, obj->fee_rate_too_high.feerate); + } + case LDKAPIError_RouteError: { + LDKStr err_str = obj->route_error.err; + char* err_buf = MALLOC(err_str.len + 1, "str conv buf"); + memcpy(err_buf, err_str.chars, err_str.len); + err_buf[err_str.len] = 0; + jstring err_conv = (*_env)->NewStringUTF(_env, err_str.chars); + FREE(err_buf); + return (*_env)->NewObject(_env, LDKAPIError_RouteError_class, LDKAPIError_RouteError_meth, err_conv); + } + case LDKAPIError_ChannelUnavailable: { + LDKCVec_u8Z err_var = obj->channel_unavailable.err; + jbyteArray err_arr = (*_env)->NewByteArray(_env, err_var.datalen); + (*_env)->SetByteArrayRegion(_env, err_arr, 0, err_var.datalen, err_var.data); + return (*_env)->NewObject(_env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_arr); + } + case LDKAPIError_MonitorUpdateFailed: { + return (*_env)->NewObject(_env, LDKAPIError_MonitorUpdateFailed_class, LDKAPIError_MonitorUpdateFailed_meth); + } + default: abort(); + } +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NoneAPIErrorZ *val = (LDKCResult_NoneAPIErrorZ*)arg; + CHECK(val->result_ok); + return *val->contents.result; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NoneAPIErrorZ *val = (LDKCResult_NoneAPIErrorZ*)arg; + CHECK(!val->result_ok); + long err_ref = (long)&(*val->contents.err); + return err_ref; +} +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_ChannelDetailsZ *vec = (LDKCVec_ChannelDetailsZ*)ptr; + jlongArray ret = (*env)->NewLongArray(env, vec->datalen); + jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); + for (size_t i = 0; i < vec->datalen; i++) { + CHECK((((long)vec->data[i].inner) & 1) == 0); + ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); + return ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKChannelDetails arr_elem_conv; + arr_elem_conv.inner = (void*)(arr_elem & (~1)); + arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); + if (arr_elem_conv.inner != NULL) + arr_elem_conv = ChannelDetails_clone(&arr_elem_conv); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)arg; + CHECK(val->result_ok); + return *val->contents.result; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)arg; + CHECK(!val->result_ok); + LDKPaymentSendFailure err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +static jclass LDKNetAddress_IPv4_class = NULL; +static jmethodID LDKNetAddress_IPv4_meth = NULL; +static jclass LDKNetAddress_IPv6_class = NULL; +static jmethodID LDKNetAddress_IPv6_meth = NULL; +static jclass LDKNetAddress_OnionV2_class = NULL; +static jmethodID LDKNetAddress_OnionV2_meth = NULL; +static jclass LDKNetAddress_OnionV3_class = NULL; +static jmethodID LDKNetAddress_OnionV3_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv * env, jclass _a) { + LDKNetAddress_IPv4_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv4;")); + CHECK(LDKNetAddress_IPv4_class != NULL); + LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "", "([BS)V"); + CHECK(LDKNetAddress_IPv4_meth != NULL); + LDKNetAddress_IPv6_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv6;")); + CHECK(LDKNetAddress_IPv6_class != NULL); + LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "", "([BS)V"); + CHECK(LDKNetAddress_IPv6_meth != NULL); + LDKNetAddress_OnionV2_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV2;")); + CHECK(LDKNetAddress_OnionV2_class != NULL); + LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "", "([BS)V"); + CHECK(LDKNetAddress_OnionV2_meth != NULL); + LDKNetAddress_OnionV3_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV3;")); + CHECK(LDKNetAddress_OnionV3_class != NULL); + LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "", "([BSBS)V"); + CHECK(LDKNetAddress_OnionV3_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { + LDKNetAddress *obj = (LDKNetAddress*)ptr; + switch(obj->tag) { + case LDKNetAddress_IPv4: { + jbyteArray addr_arr = (*_env)->NewByteArray(_env, 4); + (*_env)->SetByteArrayRegion(_env, addr_arr, 0, 4, obj->i_pv4.addr.data); + return (*_env)->NewObject(_env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_arr, obj->i_pv4.port); + } + case LDKNetAddress_IPv6: { + jbyteArray addr_arr = (*_env)->NewByteArray(_env, 16); + (*_env)->SetByteArrayRegion(_env, addr_arr, 0, 16, obj->i_pv6.addr.data); + return (*_env)->NewObject(_env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, obj->i_pv6.port); + } + case LDKNetAddress_OnionV2: { + jbyteArray addr_arr = (*_env)->NewByteArray(_env, 10); + (*_env)->SetByteArrayRegion(_env, addr_arr, 0, 10, obj->onion_v2.addr.data); + return (*_env)->NewObject(_env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, addr_arr, obj->onion_v2.port); + } + case LDKNetAddress_OnionV3: { + jbyteArray ed25519_pubkey_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data); + return (*_env)->NewObject(_env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, obj->onion_v3.checksum, obj->onion_v3.version, obj->onion_v3.port); + } + default: abort(); + } +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NetAddressZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_NetAddressZ *vec = (LDKCVec_NetAddressZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNetAddress)); +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NetAddressZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_NetAddressZ *ret = MALLOC(sizeof(LDKCVec_NetAddressZ), "LDKCVec_NetAddressZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKNetAddress) * ret->datalen, "LDKCVec_NetAddressZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKNetAddress arr_elem_conv = *(LDKNetAddress*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_ChannelMonitorZ *vec = (LDKCVec_ChannelMonitorZ*)ptr; + jlongArray ret = (*env)->NewLongArray(env, vec->datalen); + jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); + for (size_t i = 0; i < vec->datalen; i++) { + CHECK((((long)vec->data[i].inner) & 1) == 0); + ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); + return ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_ChannelMonitorZ *ret = MALLOC(sizeof(LDKCVec_ChannelMonitorZ), "LDKCVec_ChannelMonitorZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKChannelMonitor) * ret->datalen, "LDKCVec_ChannelMonitorZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKChannelMonitor arr_elem_conv; + arr_elem_conv.inner = (void*)(arr_elem & (~1)); + arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); + // Warning: we may need a move here but can't clone! + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +typedef struct LDKWatch_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID watch_channel_meth; + jmethodID update_channel_meth; + jmethodID release_pending_monitor_events_meth; +} LDKWatch_JCalls; +LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor) { + LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKOutPoint funding_txo_var = funding_txo; + CHECK((((long)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long funding_txo_ref = (long)funding_txo_var.inner; + if (funding_txo_var.is_owned) { + funding_txo_ref |= 1; + } + LDKChannelMonitor monitor_var = monitor; + CHECK((((long)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long monitor_ref = (long)monitor_var.inner; + if (monitor_var.is_owned) { + monitor_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*_env)->CallLongMethod(_env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref); + LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update) { + LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKOutPoint funding_txo_var = funding_txo; + CHECK((((long)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long funding_txo_ref = (long)funding_txo_var.inner; + if (funding_txo_var.is_owned) { + funding_txo_ref |= 1; + } + LDKChannelMonitorUpdate update_var = update; + CHECK((((long)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long update_ref = (long)update_var.inner; + if (update_var.is_owned) { + update_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*_env)->CallLongMethod(_env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref); + LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) { + LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + jlongArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->release_pending_monitor_events_meth); + LDKCVec_MonitorEventZ arg_constr; + arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); + if (arg_constr.datalen > 0) + arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + else + arg_constr.data = NULL; + long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); + for (size_t o = 0; o < arg_constr.datalen; o++) { + long arr_conv_14 = arg_vals[o]; + LDKMonitorEvent arr_conv_14_conv; + arr_conv_14_conv.inner = (void*)(arr_conv_14 & (~1)); + arr_conv_14_conv.is_owned = (arr_conv_14 & 1) || (arr_conv_14 == 0); + if (arr_conv_14_conv.inner != NULL) + arr_conv_14_conv = MonitorEvent_clone(&arr_conv_14_conv); + arg_constr.data[o] = arr_conv_14_conv; + } + (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); + return arg_constr; +} +static void LDKWatch_JCalls_free(void* this_arg) { + LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + FREE(j_calls); + } +} +static void* LDKWatch_JCalls_clone(const void* this_arg) { + LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKWatch LDKWatch_init (JNIEnv * env, jclass _a, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J"); + CHECK(calls->watch_channel_meth != NULL); + calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J"); + CHECK(calls->update_channel_meth != NULL); + calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()[J"); + CHECK(calls->release_pending_monitor_events_meth != NULL); + + LDKWatch ret = { + .this_arg = (void*) calls, + .watch_channel = watch_channel_jcall, + .update_channel = update_channel_jcall, + .release_pending_monitor_events = release_pending_monitor_events_jcall, + .free = LDKWatch_JCalls_free, + }; + return ret; +} +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv * env, jclass _a, jobject o) { + LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch"); + *res_ptr = LDKWatch_init(env, _a, o); + return (long)res_ptr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKWatch_JCalls*)val)->o); + CHECK(ret != NULL); + return ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong funding_txo, jlong monitor) { + LDKWatch* this_arg_conv = (LDKWatch*)this_arg; + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = (void*)(funding_txo & (~1)); + funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + if (funding_txo_conv.inner != NULL) + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKChannelMonitor monitor_conv; + monitor_conv.inner = (void*)(monitor & (~1)); + monitor_conv.is_owned = (monitor & 1) || (monitor == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong funding_txo, jlong update) { + LDKWatch* this_arg_conv = (LDKWatch*)this_arg; + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = (void*)(funding_txo & (~1)); + funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + if (funding_txo_conv.inner != NULL) + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKChannelMonitorUpdate update_conv; + update_conv.inner = (void*)(update & (~1)); + update_conv.is_owned = (update & 1) || (update == 0); + if (update_conv.inner != NULL) + update_conv = ChannelMonitorUpdate_clone(&update_conv); + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv); + return (long)ret_conv; +} + +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKWatch* this_arg_conv = (LDKWatch*)this_arg; + LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); + jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen); + jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); + for (size_t o = 0; o < ret_var.datalen; o++) { + LDKMonitorEvent arr_conv_14_var = ret_var.data[o]; + CHECK((((long)arr_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&arr_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long arr_conv_14_ref = (long)arr_conv_14_var.inner; + if (arr_conv_14_var.is_owned) { + arr_conv_14_ref |= 1; + } + ret_arr_ptr[o] = arr_conv_14_ref; + } + (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +typedef struct LDKBroadcasterInterface_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID broadcast_transaction_meth; +} LDKBroadcasterInterface_JCalls; +void broadcast_transaction_jcall(const void* this_arg, struct LDKTransaction tx) { + LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKTransaction tx_var = tx; + jbyteArray tx_arr = (*_env)->NewByteArray(_env, tx_var.datalen); + (*_env)->SetByteArrayRegion(_env, tx_arr, 0, tx_var.datalen, tx_var.data); + Transaction_free(tx_var); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->broadcast_transaction_meth, tx_arr); +} +static void LDKBroadcasterInterface_JCalls_free(void* this_arg) { + LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + FREE(j_calls); + } +} +static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) { + LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env, jclass _a, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "([B)V"); + CHECK(calls->broadcast_transaction_meth != NULL); + + LDKBroadcasterInterface ret = { + .this_arg = (void*) calls, + .broadcast_transaction = broadcast_transaction_jcall, + .free = LDKBroadcasterInterface_JCalls_free, + }; + return ret; +} +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) { + LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface"); + *res_ptr = LDKBroadcasterInterface_init(env, _a, o); + return (long)res_ptr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKBroadcasterInterface_JCalls*)val)->o); + CHECK(ret != NULL); + return ret; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray tx) { + LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg; + LDKTransaction tx_ref; + tx_ref.datalen = (*_env)->GetArrayLength (_env, tx); + tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); + (*_env)->GetByteArrayRegion(_env, tx, 0, tx_ref.datalen, tx_ref.data); + tx_ref.data_is_owned = true; + (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref); +} + +typedef struct LDKKeysInterface_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID get_node_secret_meth; + jmethodID get_destination_script_meth; + jmethodID get_shutdown_pubkey_meth; + jmethodID get_channel_keys_meth; + jmethodID get_secure_random_bytes_meth; + jmethodID read_chan_signer_meth; +} LDKKeysInterface_JCalls; +LDKSecretKey get_node_secret_jcall(const void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_node_secret_meth); + LDKSecretKey arg_ref; + CHECK((*_env)->GetArrayLength (_env, arg) == 32); + (*_env)->GetByteArrayRegion (_env, arg, 0, 32, arg_ref.bytes); + return arg_ref; +} +LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_destination_script_meth); + LDKCVec_u8Z arg_ref; + arg_ref.datalen = (*_env)->GetArrayLength (_env, arg); + arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*_env)->GetByteArrayRegion(_env, arg, 0, arg_ref.datalen, arg_ref.data); + return arg_ref; +} +LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_shutdown_pubkey_meth); + LDKPublicKey arg_ref; + CHECK((*_env)->GetArrayLength (_env, arg) == 33); + (*_env)->GetByteArrayRegion (_env, arg, 0, 33, arg_ref.compressed_form); + return arg_ref; +} +LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKChannelKeys* ret = (LDKChannelKeys*)(*_env)->CallLongMethod(_env, obj, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis); + LDKChannelKeys ret_conv = *(LDKChannelKeys*)ret; + ret_conv = ChannelKeys_clone(ret); + return ret_conv; +} +LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_secure_random_bytes_meth); + LDKThirtyTwoBytes arg_ref; + CHECK((*_env)->GetArrayLength (_env, arg) == 32); + (*_env)->GetByteArrayRegion (_env, arg, 0, 32, arg_ref.data); + return arg_ref; +} +LDKCResult_ChanKeySignerDecodeErrorZ read_chan_signer_jcall(const void* this_arg, struct LDKu8slice reader) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKu8slice reader_var = reader; + jbyteArray reader_arr = (*_env)->NewByteArray(_env, reader_var.datalen); + (*_env)->SetByteArrayRegion(_env, reader_arr, 0, reader_var.datalen, reader_var.data); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_ChanKeySignerDecodeErrorZ* ret = (LDKCResult_ChanKeySignerDecodeErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->read_chan_signer_meth, reader_arr); + LDKCResult_ChanKeySignerDecodeErrorZ ret_conv = *(LDKCResult_ChanKeySignerDecodeErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +static void LDKKeysInterface_JCalls_free(void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + FREE(j_calls); + } +} +static void* LDKKeysInterface_JCalls_clone(const void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv * env, jclass _a, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()[B"); + CHECK(calls->get_node_secret_meth != NULL); + calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()[B"); + CHECK(calls->get_destination_script_meth != NULL); + calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()[B"); + CHECK(calls->get_shutdown_pubkey_meth != NULL); + calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J"); + CHECK(calls->get_channel_keys_meth != NULL); + calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B"); + CHECK(calls->get_secure_random_bytes_meth != NULL); + calls->read_chan_signer_meth = (*env)->GetMethodID(env, c, "read_chan_signer", "([B)J"); + CHECK(calls->read_chan_signer_meth != NULL); + + LDKKeysInterface ret = { + .this_arg = (void*) calls, + .get_node_secret = get_node_secret_jcall, + .get_destination_script = get_destination_script_jcall, + .get_shutdown_pubkey = get_shutdown_pubkey_jcall, + .get_channel_keys = get_channel_keys_jcall, + .get_secure_random_bytes = get_secure_random_bytes_jcall, + .read_chan_signer = read_chan_signer_jcall, + .free = LDKKeysInterface_JCalls_free, + }; + return ret; +} +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) { + LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); + *res_ptr = LDKKeysInterface_init(env, _a, o); + return (long)res_ptr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKKeysInterface_JCalls*)val)->o); + CHECK(ret != NULL); + return ret; +} +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes); + return arg_arr; +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1destination_1script(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKCVec_u8Z arg_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, (this_arg_conv->get_shutdown_pubkey)(this_arg_conv->this_arg).compressed_form); + return arg_arr; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1keys(JNIEnv * _env, jclass _b, jlong this_arg, jboolean inbound, jlong channel_value_satoshis) { + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys"); + *ret = (this_arg_conv->get_channel_keys)(this_arg_conv->this_arg, inbound, channel_value_satoshis); + return (long)ret; +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1secure_1random_1bytes(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data); + return arg_arr; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1read_1chan_1signer(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray reader) { + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKu8slice reader_ref; + reader_ref.datalen = (*_env)->GetArrayLength (_env, reader); + reader_ref.data = (*_env)->GetByteArrayElements (_env, reader, NULL); + LDKCResult_ChanKeySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChanKeySignerDecodeErrorZ), "LDKCResult_ChanKeySignerDecodeErrorZ"); + *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref); + (*_env)->ReleaseByteArrayElements(_env, reader, (int8_t*)reader_ref.data, 0); + return (long)ret_conv; +} + +typedef struct LDKFeeEstimator_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID get_est_sat_per_1000_weight_meth; +} LDKFeeEstimator_JCalls; +uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, enum LDKConfirmationTarget confirmation_target) { + LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jclass confirmation_target_conv = LDKConfirmationTarget_to_java(_env, confirmation_target); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallIntMethod(_env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv); +} +static void LDKFeeEstimator_JCalls_free(void* this_arg) { + LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + FREE(j_calls); + } +} +static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) { + LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv * env, jclass _a, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/enums/LDKConfirmationTarget;)I"); + CHECK(calls->get_est_sat_per_1000_weight_meth != NULL); + + LDKFeeEstimator ret = { + .this_arg = (void*) calls, + .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall, + .free = LDKFeeEstimator_JCalls_free, + }; + return ret; +} +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) { + LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator"); + *res_ptr = LDKFeeEstimator_init(env, _a, o); + return (long)res_ptr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKFeeEstimator_JCalls*)val)->o); + CHECK(ret != NULL); + return ret; +} +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1per_11000_1weight(JNIEnv * _env, jclass _b, jlong this_arg, jclass confirmation_target) { + LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg; + LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(_env, confirmation_target); + jint ret_val = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv); + return ret_val; +} + +typedef struct LDKLogger_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID log_meth; +} LDKLogger_JCalls; +void log_jcall(const void* this_arg, const char *record) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jstring record_conv = (*_env)->NewStringUTF(_env, record); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->log_meth, record_conv); +} +static void LDKLogger_JCalls_free(void* this_arg) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + FREE(j_calls); + } +} +static void* LDKLogger_JCalls_clone(const void* this_arg) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKLogger LDKLogger_init (JNIEnv * env, jclass _a, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V"); + CHECK(calls->log_meth != NULL); + + LDKLogger ret = { + .this_arg = (void*) calls, + .log = log_jcall, + .free = LDKLogger_JCalls_free, + }; + return ret; +} +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) { + LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger"); + *res_ptr = LDKLogger_init(env, _a, o); + return (long)res_ptr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKLogger_JCalls*)val)->o); + CHECK(ret != NULL); + return ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *_env, jclass _b, jbyteArray a, jlong b) { + LDKC2Tuple_BlockHashChannelManagerZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); + LDKThirtyTwoBytes a_ref; + CHECK((*_env)->GetArrayLength (_env, a) == 32); + (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data); + ret->a = a_ref; + LDKChannelManager b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + // Warning: we may need a move here but can't clone! + ret->b = b_conv; + return (long)ret; +} +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelManagerZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_BlockHashChannelManagerZ *tuple = (LDKC2Tuple_BlockHashChannelManagerZ*)ptr; + jbyteArray a_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, a_arr, 0, 32, tuple->a.data); + return a_arr; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelManagerZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC2Tuple_BlockHashChannelManagerZ *tuple = (LDKC2Tuple_BlockHashChannelManagerZ*)ptr; + LDKChannelManager b_var = tuple->b; + CHECK((((long)b_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&b_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long b_ref = (long)b_var.inner & ~1; + return b_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)arg; + CHECK(val->result_ok); + long res_ref = (long)&(*val->contents.result); + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_NetAddressu8Z*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NetAddressu8Z *val = (LDKCResult_NetAddressu8Z*)arg; + CHECK(val->result_ok); + long res_ref = (long)&(*val->contents.result); + return res_ref; +} +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NetAddressu8Z *val = (LDKCResult_NetAddressu8Z*)arg; + CHECK(!val->result_ok); + return *val->contents.err; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *val = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKCResult_NetAddressu8Z* res_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z"); + *res_conv = (*val->contents.result); + return (long)res_conv; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *val = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_u64Z *vec = (LDKCVec_u64Z*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint64_t)); +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_u64Z *ret = MALLOC(sizeof(LDKCVec_u64Z), "LDKCVec_u64Z"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(uint64_t) * ret->datalen, "LDKCVec_u64Z Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + ret->data[i] = java_elems[i]; } - default: abort(); + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); } + return (long)ret; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_MessageSendEvent *vec = (LDKCVecTempl_MessageSendEvent*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMessageSendEvent)); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_UpdateAddHTLCZ *vec = (LDKCVec_UpdateAddHTLCZ*)ptr; + jlongArray ret = (*env)->NewLongArray(env, vec->datalen); + jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); + for (size_t i = 0; i < vec->datalen; i++) { + CHECK((((long)vec->data[i].inner) & 1) == 0); + ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); + return ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_MessageSendEvent *ret = MALLOC(sizeof(LDKCVecTempl_MessageSendEvent), "LDKCVecTempl_MessageSendEvent"); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_UpdateAddHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateAddHTLCZ), "LDKCVec_UpdateAddHTLCZ"); ret->datalen = (*env)->GetArrayLength(env, elems); if (ret->datalen == 0) { ret->data = NULL; } else { - ret->data = MALLOC(sizeof(LDKMessageSendEvent) * ret->datalen, "LDKCVecTempl_MessageSendEvent Data"); + ret->data = MALLOC(sizeof(LDKUpdateAddHTLC) * ret->datalen, "LDKCVec_UpdateAddHTLCZ Data"); jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); for (size_t i = 0; i < ret->datalen; i++) { jlong arr_elem = java_elems[i]; - LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)arr_elem; - FREE((void*)arr_elem); + LDKUpdateAddHTLC arr_elem_conv; + arr_elem_conv.inner = (void*)(arr_elem & (~1)); + arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); + if (arr_elem_conv.inner != NULL) + arr_elem_conv = UpdateAddHTLC_clone(&arr_elem_conv); ret->data[i] = arr_elem_conv; } (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); } return (long)ret; } -typedef struct LDKMessageSendEventsProvider_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID get_and_clear_pending_msg_events_meth; -} LDKMessageSendEventsProvider_JCalls; -LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) { - LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - jlongArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_and_clear_pending_msg_events_meth); - LDKCVec_MessageSendEventZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t s = 0; s < arg_constr.datalen; s++) { - long arr_conv_18 = arg_vals[s]; - LDKMessageSendEvent arr_conv_18_conv = *(LDKMessageSendEvent*)arr_conv_18; - FREE((void*)arr_conv_18); - arg_constr.data[s] = arr_conv_18_conv; +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFulfillHTLCZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_UpdateFulfillHTLCZ *vec = (LDKCVec_UpdateFulfillHTLCZ*)ptr; + jlongArray ret = (*env)->NewLongArray(env, vec->datalen); + jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); + for (size_t i = 0; i < vec->datalen; i++) { + CHECK((((long)vec->data[i].inner) & 1) == 0); + ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - return arg_constr; + (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); + return ret; } -static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) { - LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - JNIEnv *env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - FREE(j_calls); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFulfillHTLCZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_UpdateFulfillHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFulfillHTLCZ), "LDKCVec_UpdateFulfillHTLCZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * ret->datalen, "LDKCVec_UpdateFulfillHTLCZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKUpdateFulfillHTLC arr_elem_conv; + arr_elem_conv.inner = (void*)(arr_elem & (~1)); + arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); + if (arr_elem_conv.inner != NULL) + arr_elem_conv = UpdateFulfillHTLC_clone(&arr_elem_conv); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); } + return (long)ret; } -static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) { - LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - return (void*) this_arg; -} -static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv * env, jclass _a, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()[J"); - CHECK(calls->get_and_clear_pending_msg_events_meth != NULL); - - LDKMessageSendEventsProvider ret = { - .this_arg = (void*) calls, - .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall, - .free = LDKMessageSendEventsProvider_JCalls_free, - }; +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailHTLCZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_UpdateFailHTLCZ *vec = (LDKCVec_UpdateFailHTLCZ*)ptr; + jlongArray ret = (*env)->NewLongArray(env, vec->datalen); + jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); + for (size_t i = 0; i < vec->datalen; i++) { + CHECK((((long)vec->data[i].inner) & 1) == 0); + ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); return ret; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) { - LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *res_ptr = LDKMessageSendEventsProvider_init(env, _a, o); - return (long)res_ptr; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailHTLCZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_UpdateFailHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailHTLCZ), "LDKCVec_UpdateFailHTLCZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKUpdateFailHTLC) * ret->datalen, "LDKCVec_UpdateFailHTLCZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKUpdateFailHTLC arr_elem_conv; + arr_elem_conv.inner = (void*)(arr_elem & (~1)); + arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); + if (arr_elem_conv.inner != NULL) + arr_elem_conv = UpdateFailHTLC_clone(&arr_elem_conv); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKMessageSendEventsProvider_JCalls*)val)->o); - CHECK(ret != NULL); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailMalformedHTLCZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_UpdateFailMalformedHTLCZ *vec = (LDKCVec_UpdateFailMalformedHTLCZ*)ptr; + jlongArray ret = (*env)->NewLongArray(env, vec->datalen); + jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); + for (size_t i = 0; i < vec->datalen; i++) { + CHECK((((long)vec->data[i].inner) & 1) == 0); + ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); return ret; } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg; - LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg); - jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen); - jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); - for (size_t s = 0; s < ret_var.datalen; s++) { - LDKMessageSendEvent *arr_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *arr_conv_18_copy = MessageSendEvent_clone(&ret_var.data[s]); - long arr_conv_18_ref = (long)arr_conv_18_copy; - ret_arr_ptr[s] = arr_conv_18_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailMalformedHTLCZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_UpdateFailMalformedHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailMalformedHTLCZ), "LDKCVec_UpdateFailMalformedHTLCZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen, "LDKCVec_UpdateFailMalformedHTLCZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKUpdateFailMalformedHTLC arr_elem_conv; + arr_elem_conv.inner = (void*)(arr_elem & (~1)); + arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); + if (arr_elem_conv.inner != NULL) + arr_elem_conv = UpdateFailMalformedHTLC_clone(&arr_elem_conv); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); } - (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); - CVec_MessageSendEventZ_free(ret_var); - return ret_arr; + return (long)ret; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)arg; + CHECK(val->result_ok); + return *val->contents.result; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)arg; + CHECK(!val->result_ok); + LDKLightningError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv *_env, jclass _b, jlong a, jlong b, jlong c) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + LDKChannelAnnouncement a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + if (a_conv.inner != NULL) + a_conv = ChannelAnnouncement_clone(&a_conv); + ret->a = a_conv; + LDKChannelUpdate b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + if (b_conv.inner != NULL) + b_conv = ChannelUpdate_clone(&b_conv); + ret->b = b_conv; + LDKChannelUpdate c_conv; + c_conv.inner = (void*)(c & (~1)); + c_conv.is_owned = (c & 1) || (c == 0); + if (c_conv.inner != NULL) + c_conv = ChannelUpdate_clone(&c_conv); + ret->c = c_conv; + return (long)ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *tuple = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)ptr; + LDKChannelAnnouncement a_var = tuple->a; + CHECK((((long)a_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&a_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long a_ref = (long)a_var.inner & ~1; + return a_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *tuple = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)ptr; + LDKChannelUpdate b_var = tuple->b; + CHECK((((long)b_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&b_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long b_ref = (long)b_var.inner & ~1; + return b_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *_env, jclass _b, jlong ptr) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *tuple = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)ptr; + LDKChannelUpdate c_var = tuple->c; + CHECK((((long)c_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&c_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long c_ref = (long)c_var.inner & ~1; + return c_ref; } - -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_Event *vec = (LDKCVecTempl_Event*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKEvent)); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *vec = (LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ)); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_Event *ret = MALLOC(sizeof(LDKCVecTempl_Event), "LDKCVecTempl_Event"); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ"); ret->datalen = (*env)->GetArrayLength(env, elems); if (ret->datalen == 0) { ret->data = NULL; } else { - ret->data = MALLOC(sizeof(LDKEvent) * ret->datalen, "LDKCVecTempl_Event Data"); + ret->data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * ret->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Data"); jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); for (size_t i = 0; i < ret->datalen; i++) { jlong arr_elem = java_elems[i]; - LDKEvent arr_elem_conv = *(LDKEvent*)arr_elem; + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arr_elem; FREE((void*)arr_elem); ret->data[i] = arr_elem_conv; } @@ -1576,763 +3135,512 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1new(JNIE } return (long)ret; } -typedef struct LDKEventsProvider_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID get_and_clear_pending_events_meth; -} LDKEventsProvider_JCalls; -LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) { - LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - jlongArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_and_clear_pending_events_meth); - LDKCVec_EventZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t h = 0; h < arg_constr.datalen; h++) { - long arr_conv_7 = arg_vals[h]; - LDKEvent arr_conv_7_conv = *(LDKEvent*)arr_conv_7; - FREE((void*)arr_conv_7); - arg_constr.data[h] = arr_conv_7_conv; +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NodeAnnouncementZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_NodeAnnouncementZ *vec = (LDKCVec_NodeAnnouncementZ*)ptr; + jlongArray ret = (*env)->NewLongArray(env, vec->datalen); + jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); + for (size_t i = 0; i < vec->datalen; i++) { + CHECK((((long)vec->data[i].inner) & 1) == 0); + ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - return arg_constr; + (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); + return ret; } -static void LDKEventsProvider_JCalls_free(void* this_arg) { - LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - JNIEnv *env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - FREE(j_calls); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NodeAnnouncementZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_NodeAnnouncementZ *ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKNodeAnnouncement) * ret->datalen, "LDKCVec_NodeAnnouncementZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKNodeAnnouncement arr_elem_conv; + arr_elem_conv.inner = (void*)(arr_elem & (~1)); + arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); + if (arr_elem_conv.inner != NULL) + arr_elem_conv = NodeAnnouncement_clone(&arr_elem_conv); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); } + return (long)ret; } -static void* LDKEventsProvider_JCalls_clone(const void* this_arg) { - LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - return (void*) this_arg; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_NoneLightningErrorZ*)arg)->result_ok; } -static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv * env, jclass _a, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()[J"); - CHECK(calls->get_and_clear_pending_events_meth != NULL); - - LDKEventsProvider ret = { - .this_arg = (void*) calls, - .get_and_clear_pending_events = get_and_clear_pending_events_jcall, - .free = LDKEventsProvider_JCalls_free, - }; - return ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)arg; + CHECK(val->result_ok); + return *val->contents.result; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) { - LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *res_ptr = LDKEventsProvider_init(env, _a, o); - return (long)res_ptr; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)arg; + CHECK(!val->result_ok); + LDKLightningError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKEventsProvider_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_ChannelReestablishDecodeErrorZ*)arg)->result_ok; } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_EventsProvider_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg; - LDKCVec_EventZ ret_var = (this_arg_conv->get_and_clear_pending_events)(this_arg_conv->this_arg); - jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen); - jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); - for (size_t h = 0; h < ret_var.datalen; h++) { - LDKEvent *arr_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *arr_conv_7_copy = Event_clone(&ret_var.data[h]); - long arr_conv_7_ref = (long)arr_conv_7_copy; - ret_arr_ptr[h] = arr_conv_7_ref; - } - (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); - CVec_EventZ_free(ret_var); - return ret_arr; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKChannelReestablish res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } - -typedef struct LDKLogger_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID log_meth; -} LDKLogger_JCalls; -void log_jcall(const void* this_arg, const char *record) { - LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jstring record_conv = (*_env)->NewStringUTF(_env, record); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->log_meth, record_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -static void LDKLogger_JCalls_free(void* this_arg) { - LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - JNIEnv *env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - FREE(j_calls); - } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_InitDecodeErrorZ*)arg)->result_ok; } -static void* LDKLogger_JCalls_clone(const void* this_arg) { - LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - return (void*) this_arg; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKInit res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } -static inline LDKLogger LDKLogger_init (JNIEnv * env, jclass _a, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V"); - CHECK(calls->log_meth != NULL); - - LDKLogger ret = { - .this_arg = (void*) calls, - .log = log_jcall, - .free = LDKLogger_JCalls_free, - }; - return ret; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) { - LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger"); - *res_ptr = LDKLogger_init(env, _a, o); - return (long)res_ptr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_PingDecodeErrorZ*)arg)->result_ok; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKLogger_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKPing res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_TxOutAccessErrorZ *val = (LDKCResult_TxOutAccessErrorZ*)arg; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_PongDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)arg; CHECK(val->result_ok); - long res_ref = (long)&(*val->contents.result); + LDKPong res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; return res_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_TxOutAccessErrorZ *val = (LDKCResult_TxOutAccessErrorZ*)arg; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)arg; CHECK(!val->result_ok); - jclass err_conv = LDKAccessError_to_java(_env, (*val->contents.err)); - return err_conv; + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -typedef struct LDKAccess_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID get_utxo_meth; -} LDKAccess_JCalls; -LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id) { - LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray genesis_hash_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, genesis_hash_arr, 0, 32, *genesis_hash); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id); - LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)ret; - FREE((void*)ret); - return ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)arg)->result_ok; } -static void LDKAccess_JCalls_free(void* this_arg) { - LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - JNIEnv *env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - FREE(j_calls); - } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKUnsignedChannelAnnouncement res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKUnsignedChannelUpdate res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -static void* LDKAccess_JCalls_clone(const void* this_arg) { - LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - return (void*) this_arg; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_ErrorMessageDecodeErrorZ*)arg)->result_ok; } -static inline LDKAccess LDKAccess_init (JNIEnv * env, jclass _a, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J"); - CHECK(calls->get_utxo_meth != NULL); - - LDKAccess ret = { - .this_arg = (void*) calls, - .get_utxo = get_utxo_jcall, - .free = LDKAccess_JCalls_free, - }; - return ret; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKErrorMessage res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv * env, jclass _a, jobject o) { - LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); - *res_ptr = LDKAccess_init(env, _a, o); - return (long)res_ptr; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKAccess_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)arg)->result_ok; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray genesis_hash, jlong short_channel_id) { - LDKAccess* this_arg_conv = (LDKAccess*)this_arg; - unsigned char genesis_hash_arr[32]; - CHECK((*_env)->GetArrayLength (_env, genesis_hash) == 32); - (*_env)->GetByteArrayRegion (_env, genesis_hash, 0, 32, genesis_hash_arr); - unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr; - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id); - return (long)ret_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKUnsignedNodeAnnouncement res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } - -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_HTLCOutputInCommitment *vec = (LDKCVecTempl_HTLCOutputInCommitment*)ptr; - jlongArray ret = (*env)->NewLongArray(env, vec->datalen); - jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); - for (size_t i = 0; i < vec->datalen; i++) { - CHECK((((long)vec->data[i].inner) & 1) == 0); - ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); - return ret; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_HTLCOutputInCommitment *ret = MALLOC(sizeof(LDKCVecTempl_HTLCOutputInCommitment), "LDKCVecTempl_HTLCOutputInCommitment"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKHTLCOutputInCommitment) * ret->datalen, "LDKCVecTempl_HTLCOutputInCommitment Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKHTLCOutputInCommitment arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - if (arr_elem_conv.inner != NULL) - arr_elem_conv = HTLCOutputInCommitment_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (long)ret; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_QueryShortChannelIdsDecodeErrorZ*)arg)->result_ok; } -typedef struct LDKChannelKeys_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID get_per_commitment_point_meth; - jmethodID release_commitment_secret_meth; - jmethodID key_derivation_params_meth; - jmethodID sign_counterparty_commitment_meth; - jmethodID sign_holder_commitment_meth; - jmethodID sign_holder_commitment_htlc_transactions_meth; - jmethodID sign_justice_transaction_meth; - jmethodID sign_counterparty_htlc_transaction_meth; - jmethodID sign_closing_transaction_meth; - jmethodID sign_channel_announcement_meth; - jmethodID on_accept_meth; - jmethodID write_meth; -} LDKChannelKeys_JCalls; -LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_per_commitment_point_meth, idx); - LDKPublicKey arg_ref; - CHECK((*_env)->GetArrayLength (_env, arg) == 33); - (*_env)->GetByteArrayRegion (_env, arg, 0, 33, arg_ref.compressed_form); - return arg_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKQueryShortChannelIds res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } -LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->release_commitment_secret_meth, idx); - LDKThirtyTwoBytes arg_ref; - CHECK((*_env)->GetArrayLength (_env, arg) == 32); - (*_env)->GetByteArrayRegion (_env, arg, 0, 32, arg_ref.data); - return arg_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*_env)->CallLongMethod(_env, obj, j_calls->key_derivation_params_meth); - LDKC2Tuple_u64u64Z ret_conv = *(LDKC2Tuple_u64u64Z*)ret; - FREE((void*)ret); - return ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)arg)->result_ok; } -LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_jcall(const void* this_arg, uint32_t feerate_per_kw, LDKTransaction commitment_tx, const LDKPreCalculatedTxCreationKeys *keys, LDKCVec_HTLCOutputInCommitmentZ htlcs) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKTransaction commitment_tx_var = commitment_tx; - jbyteArray commitment_tx_arr = (*_env)->NewByteArray(_env, commitment_tx_var.datalen); - (*_env)->SetByteArrayRegion(_env, commitment_tx_arr, 0, commitment_tx_var.datalen, commitment_tx_var.data); - Transaction_free(commitment_tx_var); - LDKPreCalculatedTxCreationKeys keys_var = *keys; - if (keys->inner != NULL) - keys_var = PreCalculatedTxCreationKeys_clone(keys); - CHECK((((long)keys_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&keys_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long keys_ref = (long)keys_var.inner; - if (keys_var.is_owned) { - keys_ref |= 1; - } - LDKCVec_HTLCOutputInCommitmentZ htlcs_var = htlcs; - jlongArray htlcs_arr = (*_env)->NewLongArray(_env, htlcs_var.datalen); - jlong *htlcs_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, htlcs_arr, NULL); - for (size_t y = 0; y < htlcs_var.datalen; y++) { - LDKHTLCOutputInCommitment arr_conv_24_var = htlcs_var.data[y]; - CHECK((((long)arr_conv_24_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&arr_conv_24_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long arr_conv_24_ref = (long)arr_conv_24_var.inner; - if (arr_conv_24_var.is_owned) { - arr_conv_24_ref |= 1; - } - htlcs_arr_ptr[y] = arr_conv_24_ref; - } - (*_env)->ReleasePrimitiveArrayCritical(_env, htlcs_arr, htlcs_arr_ptr, 0); - FREE(htlcs_var.data); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_counterparty_commitment_meth, feerate_per_kw, commitment_tx_arr, keys_ref, htlcs_arr); - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)ret; - FREE((void*)ret); - return ret_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKReplyShortChannelIdsEnd res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } -LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKHolderCommitmentTransaction holder_commitment_tx_var = *holder_commitment_tx; - if (holder_commitment_tx->inner != NULL) - holder_commitment_tx_var = HolderCommitmentTransaction_clone(holder_commitment_tx); - CHECK((((long)holder_commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&holder_commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long holder_commitment_tx_ref = (long)holder_commitment_tx_var.inner; - if (holder_commitment_tx_var.is_owned) { - holder_commitment_tx_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_holder_commitment_meth, holder_commitment_tx_ref); - LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; - FREE((void*)ret); - return ret_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKHolderCommitmentTransaction holder_commitment_tx_var = *holder_commitment_tx; - if (holder_commitment_tx->inner != NULL) - holder_commitment_tx_var = HolderCommitmentTransaction_clone(holder_commitment_tx); - CHECK((((long)holder_commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&holder_commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long holder_commitment_tx_ref = (long)holder_commitment_tx_var.inner; - if (holder_commitment_tx_var.is_owned) { - holder_commitment_tx_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_CVec_SignatureZNoneZ* ret = (LDKCResult_CVec_SignatureZNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_holder_commitment_htlc_transactions_meth, holder_commitment_tx_ref); - LDKCResult_CVec_SignatureZNoneZ ret_conv = *(LDKCResult_CVec_SignatureZNoneZ*)ret; - FREE((void*)ret); - return ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_QueryChannelRangeDecodeErrorZ*)arg)->result_ok; } -LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const LDKHTLCOutputInCommitment *htlc) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKTransaction justice_tx_var = justice_tx; - jbyteArray justice_tx_arr = (*_env)->NewByteArray(_env, justice_tx_var.datalen); - (*_env)->SetByteArrayRegion(_env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data); - Transaction_free(justice_tx_var); - jbyteArray per_commitment_key_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, per_commitment_key_arr, 0, 32, *per_commitment_key); - LDKHTLCOutputInCommitment htlc_var = *htlc; - if (htlc->inner != NULL) - htlc_var = HTLCOutputInCommitment_clone(htlc); - CHECK((((long)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long htlc_ref = (long)htlc_var.inner; - if (htlc_var.is_owned) { - htlc_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_justice_transaction_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref); - LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; - FREE((void*)ret); - return ret_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKQueryChannelRange res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } -LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment *htlc) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKTransaction htlc_tx_var = htlc_tx; - jbyteArray htlc_tx_arr = (*_env)->NewByteArray(_env, htlc_tx_var.datalen); - (*_env)->SetByteArrayRegion(_env, htlc_tx_arr, 0, htlc_tx_var.datalen, htlc_tx_var.data); - Transaction_free(htlc_tx_var); - jbyteArray per_commitment_point_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, per_commitment_point_arr, 0, 33, per_commitment_point.compressed_form); - LDKHTLCOutputInCommitment htlc_var = *htlc; - if (htlc->inner != NULL) - htlc_var = HTLCOutputInCommitment_clone(htlc); - CHECK((((long)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long htlc_ref = (long)htlc_var.inner; - if (htlc_var.is_owned) { - htlc_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref); - LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; - FREE((void*)ret); - return ret_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKTransaction closing_tx_var = closing_tx; - jbyteArray closing_tx_arr = (*_env)->NewByteArray(_env, closing_tx_var.datalen); - (*_env)->SetByteArrayRegion(_env, closing_tx_arr, 0, closing_tx_var.datalen, closing_tx_var.data); - Transaction_free(closing_tx_var); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_closing_transaction_meth, closing_tx_arr); - LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; - FREE((void*)ret); - return ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_ReplyChannelRangeDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKReplyChannelRange res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } -LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement *msg) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKUnsignedChannelAnnouncement msg_var = *msg; - if (msg->inner != NULL) - msg_var = UnsignedChannelAnnouncement_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*_env)->CallLongMethod(_env, obj, j_calls->sign_channel_announcement_meth, msg_ref); - LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; - FREE((void*)ret); - return ret_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKChannelPublicKeys channel_points_var = *channel_points; - if (channel_points->inner != NULL) - channel_points_var = ChannelPublicKeys_clone(channel_points); - CHECK((((long)channel_points_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&channel_points_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long channel_points_ref = (long)channel_points_var.inner; - if (channel_points_var.is_owned) { - channel_points_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->on_accept_meth, channel_points_ref, counterparty_selected_contest_delay, holder_selected_contest_delay); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_GossipTimestampFilterDecodeErrorZ*)arg)->result_ok; } -LDKCVec_u8Z write_jcall(const void* this_arg) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->write_meth); - LDKCVec_u8Z arg_ref; - arg_ref.datalen = (*_env)->GetArrayLength (_env, arg); - arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*_env)->GetByteArrayRegion(_env, arg, 0, arg_ref.datalen, arg_ref.data); - return arg_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKGossipTimestampFilter res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } -static void LDKChannelKeys_JCalls_free(void* this_arg) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - JNIEnv *env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - FREE(j_calls); - } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -static void* LDKChannelKeys_JCalls_clone(const void* this_arg) { - LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - return (void*) this_arg; +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1PublicKeyZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_PublicKeyZ *vec = (LDKCVec_PublicKeyZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKPublicKey)); } -static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobject o, jlong pubkeys) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)[B"); - CHECK(calls->get_per_commitment_point_meth != NULL); - calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B"); - CHECK(calls->release_commitment_secret_meth != NULL); - calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J"); - CHECK(calls->key_derivation_params_meth != NULL); - calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(I[BJ[J)J"); - CHECK(calls->sign_counterparty_commitment_meth != NULL); - calls->sign_holder_commitment_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment", "(J)J"); - CHECK(calls->sign_holder_commitment_meth != NULL); - calls->sign_holder_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_htlc_transactions", "(J)J"); - CHECK(calls->sign_holder_commitment_htlc_transactions_meth != NULL); - calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "([BJJ[BJ)J"); - CHECK(calls->sign_justice_transaction_meth != NULL); - calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "([BJJ[BJ)J"); - CHECK(calls->sign_counterparty_htlc_transaction_meth != NULL); - calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "([B)J"); - CHECK(calls->sign_closing_transaction_meth != NULL); - calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J"); - CHECK(calls->sign_channel_announcement_meth != NULL); - calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "(JSS)V"); - CHECK(calls->on_accept_meth != NULL); - - LDKChannelPublicKeys pubkeys_conv; - pubkeys_conv.inner = (void*)(pubkeys & (~1)); - pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - if (pubkeys_conv.inner != NULL) - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); - - LDKChannelKeys ret = { - .this_arg = (void*) calls, - .get_per_commitment_point = get_per_commitment_point_jcall, - .release_commitment_secret = release_commitment_secret_jcall, - .key_derivation_params = key_derivation_params_jcall, - .sign_counterparty_commitment = sign_counterparty_commitment_jcall, - .sign_holder_commitment = sign_holder_commitment_jcall, - .sign_holder_commitment_htlc_transactions = sign_holder_commitment_htlc_transactions_jcall, - .sign_justice_transaction = sign_justice_transaction_jcall, - .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall, - .sign_closing_transaction = sign_closing_transaction_jcall, - .sign_channel_announcement = sign_channel_announcement_jcall, - .on_accept = on_accept_jcall, - .clone = LDKChannelKeys_JCalls_clone, - .write = write_jcall, - .free = LDKChannelKeys_JCalls_free, - .pubkeys = pubkeys_conv, - .set_pubkeys = NULL, - }; - return ret; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o, jlong pubkeys) { - LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys"); - *res_ptr = LDKChannelKeys_init(env, _a, o, pubkeys); - return (long)res_ptr; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg; + CHECK(val->result_ok); + LDKCVec_u8Z res_var = (*val->contents.result); + jbyteArray res_arr = (*_env)->NewByteArray(_env, res_var.datalen); + (*_env)->SetByteArrayRegion(_env, res_arr, 0, res_var.datalen, res_var.data); + return res_arr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKChannelKeys_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg; + CHECK(!val->result_ok); + LDKPeerHandleError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg, jlong idx) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form); - return arg_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok; } - -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1release_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_arg, jlong idx) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data); - return arg_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)arg; + CHECK(val->result_ok); + return *val->contents.result; } - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1key_1derivation_1params(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKC2Tuple_u64u64Z* ret_ref = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); - *ret_ref = (this_arg_conv->key_derivation_params)(this_arg_conv->this_arg); - return (long)ret_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)arg; + CHECK(!val->result_ok); + LDKPeerHandleError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1commitment(JNIEnv * _env, jclass _b, jlong this_arg, jint feerate_per_kw, jbyteArray commitment_tx, jlong keys, jlongArray htlcs) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKTransaction commitment_tx_ref; - commitment_tx_ref.datalen = (*_env)->GetArrayLength (_env, commitment_tx); - commitment_tx_ref.data = MALLOC(commitment_tx_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, commitment_tx, 0, commitment_tx_ref.datalen, commitment_tx_ref.data); - commitment_tx_ref.data_is_owned = true; - LDKPreCalculatedTxCreationKeys keys_conv; - keys_conv.inner = (void*)(keys & (~1)); - keys_conv.is_owned = false; - LDKCVec_HTLCOutputInCommitmentZ htlcs_constr; - htlcs_constr.datalen = (*_env)->GetArrayLength (_env, htlcs); - if (htlcs_constr.datalen > 0) - htlcs_constr.data = MALLOC(htlcs_constr.datalen * sizeof(LDKHTLCOutputInCommitment), "LDKCVec_HTLCOutputInCommitmentZ Elements"); - else - htlcs_constr.data = NULL; - long* htlcs_vals = (*_env)->GetLongArrayElements (_env, htlcs, NULL); - for (size_t y = 0; y < htlcs_constr.datalen; y++) { - long arr_conv_24 = htlcs_vals[y]; - LDKHTLCOutputInCommitment arr_conv_24_conv; - arr_conv_24_conv.inner = (void*)(arr_conv_24 & (~1)); - arr_conv_24_conv.is_owned = (arr_conv_24 & 1) || (arr_conv_24 == 0); - if (arr_conv_24_conv.inner != NULL) - arr_conv_24_conv = HTLCOutputInCommitment_clone(&arr_conv_24_conv); - htlcs_constr.data[y] = arr_conv_24_conv; - } - (*_env)->ReleaseLongArrayElements (_env, htlcs, htlcs_vals, 0); - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, feerate_per_kw, commitment_tx_ref, &keys_conv, htlcs_constr); - return (long)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok; } - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1holder_1commitment(JNIEnv * _env, jclass _b, jlong this_arg, jlong holder_commitment_tx) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKHolderCommitmentTransaction holder_commitment_tx_conv; - holder_commitment_tx_conv.inner = (void*)(holder_commitment_tx & (~1)); - holder_commitment_tx_conv.is_owned = false; - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_holder_commitment)(this_arg_conv->this_arg, &holder_commitment_tx_conv); - return (long)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)arg; + CHECK(val->result_ok); + return *val->contents.result; } - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1holder_1commitment_1htlc_1transactions(JNIEnv * _env, jclass _b, jlong this_arg, jlong holder_commitment_tx) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKHolderCommitmentTransaction holder_commitment_tx_conv; - holder_commitment_tx_conv.inner = (void*)(holder_commitment_tx & (~1)); - holder_commitment_tx_conv.is_owned = false; - LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); - *ret_conv = (this_arg_conv->sign_holder_commitment_htlc_transactions)(this_arg_conv->this_arg, &holder_commitment_tx_conv); - return (long)ret_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)arg; + CHECK(!val->result_ok); + LDKPeerHandleError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; } - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1justice_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray justice_tx, jlong input, jlong amount, jbyteArray per_commitment_key, jlong htlc) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKTransaction justice_tx_ref; - justice_tx_ref.datalen = (*_env)->GetArrayLength (_env, justice_tx); - justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data); - justice_tx_ref.data_is_owned = true; - unsigned char per_commitment_key_arr[32]; - CHECK((*_env)->GetArrayLength (_env, per_commitment_key) == 32); - (*_env)->GetByteArrayRegion (_env, per_commitment_key, 0, 32, per_commitment_key_arr); - unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr; - LDKHTLCOutputInCommitment htlc_conv; - htlc_conv.inner = (void*)(htlc & (~1)); - htlc_conv.is_owned = false; - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_justice_transaction)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref, &htlc_conv); - return (long)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok; } - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1htlc_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_tx, jlong input, jlong amount, jbyteArray per_commitment_point, jlong htlc) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKTransaction htlc_tx_ref; - htlc_tx_ref.datalen = (*_env)->GetArrayLength (_env, htlc_tx); - htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, htlc_tx, 0, htlc_tx_ref.datalen, htlc_tx_ref.data); - htlc_tx_ref.data_is_owned = true; - LDKPublicKey per_commitment_point_ref; - CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); - (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - LDKHTLCOutputInCommitment htlc_conv; - htlc_conv.inner = (void*)(htlc & (~1)); - htlc_conv.is_owned = false; - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_ref, input, amount, per_commitment_point_ref, &htlc_conv); - return (long)ret_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_SecretKeySecpErrorZ *val = (LDKCResult_SecretKeySecpErrorZ*)arg; + CHECK(val->result_ok); + jbyteArray res_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, res_arr, 0, 32, (*val->contents.result).bytes); + return res_arr; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_SecretKeySecpErrorZ *val = (LDKCResult_SecretKeySecpErrorZ*)arg; + CHECK(!val->result_ok); + jclass err_conv = LDKSecp256k1Error_to_java(_env, (*val->contents.err)); + return err_conv; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok; +} +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_PublicKeySecpErrorZ *val = (LDKCResult_PublicKeySecpErrorZ*)arg; + CHECK(val->result_ok); + jbyteArray res_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, res_arr, 0, 33, (*val->contents.result).compressed_form); + return res_arr; } - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1closing_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray closing_tx) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKTransaction closing_tx_ref; - closing_tx_ref.datalen = (*_env)->GetArrayLength (_env, closing_tx); - closing_tx_ref.data = MALLOC(closing_tx_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, closing_tx, 0, closing_tx_ref.datalen, closing_tx_ref.data); - closing_tx_ref.data_is_owned = true; - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, closing_tx_ref); - return (long)ret_conv; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_PublicKeySecpErrorZ *val = (LDKCResult_PublicKeySecpErrorZ*)arg; + CHECK(!val->result_ok); + jclass err_conv = LDKSecp256k1Error_to_java(_env, (*val->contents.err)); + return err_conv; } - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1channel_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKUnsignedChannelAnnouncement msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv); - return (long)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1on_1accept(JNIEnv * _env, jclass _b, jlong this_arg, jlong channel_points, jshort counterparty_selected_contest_delay, jshort holder_selected_contest_delay) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKChannelPublicKeys channel_points_conv; - channel_points_conv.inner = (void*)(channel_points & (~1)); - channel_points_conv.is_owned = false; - (this_arg_conv->on_accept)(this_arg_conv->this_arg, &channel_points_conv, counterparty_selected_contest_delay, holder_selected_contest_delay); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_TxCreationKeysSecpErrorZ *val = (LDKCResult_TxCreationKeysSecpErrorZ*)arg; + CHECK(val->result_ok); + LDKTxCreationKeys res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; } - -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1write(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKCVec_u8Z arg_var = (this_arg_conv->write)(this_arg_conv->this_arg); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); - return arg_arr; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_TxCreationKeysSecpErrorZ *val = (LDKCResult_TxCreationKeysSecpErrorZ*)arg; + CHECK(!val->result_ok); + jclass err_conv = LDKSecp256k1Error_to_java(_env, (*val->contents.err)); + return err_conv; } - -LDKChannelPublicKeys LDKChannelKeys_set_get_pubkeys(LDKChannelKeys* this_arg) { - if (this_arg->set_pubkeys != NULL) - this_arg->set_pubkeys(this_arg); - return this_arg->pubkeys; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_TrustedCommitmentTransactionNoneZ*)arg)->result_ok; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1get_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; - LDKChannelPublicKeys ret_var = LDKChannelKeys_set_get_pubkeys(this_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; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)arg; + CHECK(val->result_ok); + LDKTrustedCommitmentTransaction res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)arg; + CHECK(!val->result_ok); + return *val->contents.err; +} +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_RouteHopZ *vec = (LDKCVec_RouteHopZ*)ptr; + jlongArray ret = (*env)->NewLongArray(env, vec->datalen); + jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); + for (size_t i = 0; i < vec->datalen; i++) { + CHECK((((long)vec->data[i].inner) & 1) == 0); + ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); } - return ret_ref; + (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); + return ret; } - -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_MonitorEvent *vec = (LDKCVecTempl_MonitorEvent*)ptr; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_RouteHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHopZ), "LDKCVec_RouteHopZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKRouteHop) * ret->datalen, "LDKCVec_RouteHopZ Data"); + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKRouteHop arr_elem_conv; + arr_elem_conv.inner = (void*)(arr_elem & (~1)); + arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); + if (arr_elem_conv.inner != NULL) + arr_elem_conv = RouteHop_clone(&arr_elem_conv); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1CVec_1RouteHopZZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_CVec_RouteHopZZ *vec = (LDKCVec_CVec_RouteHopZZ*)ptr; + return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKCVec_RouteHopZ)); +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_RouteDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKRoute res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { + LDKCVec_RouteHintZ *vec = (LDKCVec_RouteHintZ*)ptr; jlongArray ret = (*env)->NewLongArray(env, vec->datalen); jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); for (size_t i = 0; i < vec->datalen; i++) { @@ -2342,113 +3650,249 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEve (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); return ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_MonitorEvent *ret = MALLOC(sizeof(LDKCVecTempl_MonitorEvent), "LDKCVecTempl_MonitorEvent"); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ"); ret->datalen = (*env)->GetArrayLength(env, elems); if (ret->datalen == 0) { ret->data = NULL; } else { - ret->data = MALLOC(sizeof(LDKMonitorEvent) * ret->datalen, "LDKCVecTempl_MonitorEvent Data"); + ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data"); jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); for (size_t i = 0; i < ret->datalen; i++) { jlong arr_elem = java_elems[i]; - LDKMonitorEvent arr_elem_conv; + LDKRouteHint arr_elem_conv; arr_elem_conv.inner = (void*)(arr_elem & (~1)); arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); if (arr_elem_conv.inner != NULL) - arr_elem_conv = MonitorEvent_clone(&arr_elem_conv); + arr_elem_conv = RouteHint_clone(&arr_elem_conv); ret->data[i] = arr_elem_conv; } (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); } - return (long)ret; + return (long)ret; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)arg; + CHECK(val->result_ok); + LDKRoute res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)arg; + CHECK(!val->result_ok); + LDKLightningError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_RoutingFeesDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKRoutingFees res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKNodeAnnouncementInfo res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_NodeInfoDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKNodeInfo res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { + return ((LDKCResult_NetworkGraphDecodeErrorZ*)arg)->result_ok; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)arg; + CHECK(val->result_ok); + LDKNetworkGraph res_var = (*val->contents.result); + CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long res_ref = (long)res_var.inner & ~1; + return res_ref; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { + LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)arg; + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long err_ref = (long)err_var.inner & ~1; + return err_ref; +} +typedef struct LDKMessageSendEventsProvider_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID get_and_clear_pending_msg_events_meth; +} LDKMessageSendEventsProvider_JCalls; +LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) { + LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + jlongArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_and_clear_pending_msg_events_meth); + LDKCVec_MessageSendEventZ arg_constr; + arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); + if (arg_constr.datalen > 0) + arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements"); + else + arg_constr.data = NULL; + long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); + for (size_t s = 0; s < arg_constr.datalen; s++) { + long arr_conv_18 = arg_vals[s]; + LDKMessageSendEvent arr_conv_18_conv = *(LDKMessageSendEvent*)arr_conv_18; + FREE((void*)arr_conv_18); + arg_constr.data[s] = arr_conv_18_conv; + } + (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); + return arg_constr; +} +static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) { + LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + FREE(j_calls); + } +} +static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) { + LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv * env, jclass _a, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()[J"); + CHECK(calls->get_and_clear_pending_msg_events_meth != NULL); + + LDKMessageSendEventsProvider ret = { + .this_arg = (void*) calls, + .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall, + .free = LDKMessageSendEventsProvider_JCalls_free, + }; + return ret; +} +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) { + LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *res_ptr = LDKMessageSendEventsProvider_init(env, _a, o); + return (long)res_ptr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKMessageSendEventsProvider_JCalls*)val)->o); + CHECK(ret != NULL); + return ret; +} +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg; + LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg); + jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen); + jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); + for (size_t s = 0; s < ret_var.datalen; s++) { + LDKMessageSendEvent *arr_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *arr_conv_18_copy = ret_var.data[s]; + long arr_conv_18_ref = (long)arr_conv_18_copy; + ret_arr_ptr[s] = arr_conv_18_ref; + } + (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -typedef struct LDKWatch_JCalls { + +typedef struct LDKEventsProvider_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID watch_channel_meth; - jmethodID update_channel_meth; - jmethodID release_pending_monitor_events_meth; -} LDKWatch_JCalls; -LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) { - LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKOutPoint funding_txo_var = funding_txo; - CHECK((((long)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long funding_txo_ref = (long)funding_txo_var.inner; - if (funding_txo_var.is_owned) { - funding_txo_ref |= 1; - } - LDKChannelMonitor monitor_var = monitor; - CHECK((((long)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long monitor_ref = (long)monitor_var.inner; - if (monitor_var.is_owned) { - monitor_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*_env)->CallLongMethod(_env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref); - LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)ret; - FREE((void*)ret); - return ret_conv; -} -LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) { - LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKOutPoint funding_txo_var = funding_txo; - CHECK((((long)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long funding_txo_ref = (long)funding_txo_var.inner; - if (funding_txo_var.is_owned) { - funding_txo_ref |= 1; - } - LDKChannelMonitorUpdate update_var = update; - CHECK((((long)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long update_ref = (long)update_var.inner; - if (update_var.is_owned) { - update_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*_env)->CallLongMethod(_env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref); - LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)ret; - FREE((void*)ret); - return ret_conv; -} -LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) { - LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + jmethodID get_and_clear_pending_events_meth; +} LDKEventsProvider_JCalls; +LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) { + LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - jlongArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->release_pending_monitor_events_meth); - LDKCVec_MonitorEventZ arg_constr; + jlongArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_and_clear_pending_events_meth); + LDKCVec_EventZ arg_constr; arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); else arg_constr.data = NULL; long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t o = 0; o < arg_constr.datalen; o++) { - long arr_conv_14 = arg_vals[o]; - LDKMonitorEvent arr_conv_14_conv; - arr_conv_14_conv.inner = (void*)(arr_conv_14 & (~1)); - arr_conv_14_conv.is_owned = (arr_conv_14 & 1) || (arr_conv_14 == 0); - if (arr_conv_14_conv.inner != NULL) - arr_conv_14_conv = MonitorEvent_clone(&arr_conv_14_conv); - arg_constr.data[o] = arr_conv_14_conv; + for (size_t h = 0; h < arg_constr.datalen; h++) { + long arr_conv_7 = arg_vals[h]; + LDKEvent arr_conv_7_conv = *(LDKEvent*)arr_conv_7; + FREE((void*)arr_conv_7); + arg_constr.data[h] = arr_conv_7_conv; } (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); return arg_constr; } -static void LDKWatch_JCalls_free(void* this_arg) { - LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; +static void LDKEventsProvider_JCalls_free(void* this_arg) { + LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { JNIEnv *env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); @@ -2456,97 +3900,125 @@ static void LDKWatch_JCalls_free(void* this_arg) { FREE(j_calls); } } -static void* LDKWatch_JCalls_clone(const void* this_arg) { - LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; +static void* LDKEventsProvider_JCalls_clone(const void* this_arg) { + LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); return (void*) this_arg; } -static inline LDKWatch LDKWatch_init (JNIEnv * env, jclass _a, jobject o) { +static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv * env, jclass _a, jobject o) { jclass c = (*env)->GetObjectClass(env, o); CHECK(c != NULL); - LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls"); + LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls"); atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J"); - CHECK(calls->watch_channel_meth != NULL); - calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J"); - CHECK(calls->update_channel_meth != NULL); - calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()[J"); - CHECK(calls->release_pending_monitor_events_meth != NULL); + calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()[J"); + CHECK(calls->get_and_clear_pending_events_meth != NULL); - LDKWatch ret = { + LDKEventsProvider ret = { .this_arg = (void*) calls, - .watch_channel = watch_channel_jcall, - .update_channel = update_channel_jcall, - .release_pending_monitor_events = release_pending_monitor_events_jcall, - .free = LDKWatch_JCalls_free, + .get_and_clear_pending_events = get_and_clear_pending_events_jcall, + .free = LDKEventsProvider_JCalls_free, }; return ret; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv * env, jclass _a, jobject o) { - LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch"); - *res_ptr = LDKWatch_init(env, _a, o); +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) { + LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *res_ptr = LDKEventsProvider_init(env, _a, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKWatch_JCalls*)val)->o); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKEventsProvider_JCalls*)val)->o); CHECK(ret != NULL); return ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong funding_txo, jlong monitor) { - LDKWatch* this_arg_conv = (LDKWatch*)this_arg; - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = (void*)(funding_txo & (~1)); - funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); - if (funding_txo_conv.inner != NULL) - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKChannelMonitor monitor_conv; - monitor_conv.inner = (void*)(monitor & (~1)); - monitor_conv.is_owned = (monitor & 1) || (monitor == 0); - // Warning: we may need a move here but can't clone! - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv); - return (long)ret_conv; -} - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong funding_txo, jlong update) { - LDKWatch* this_arg_conv = (LDKWatch*)this_arg; - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = (void*)(funding_txo & (~1)); - funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); - if (funding_txo_conv.inner != NULL) - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKChannelMonitorUpdate update_conv; - update_conv.inner = (void*)(update & (~1)); - update_conv.is_owned = (update & 1) || (update == 0); - if (update_conv.inner != NULL) - update_conv = ChannelMonitorUpdate_clone(&update_conv); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv); - return (long)ret_conv; -} - -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKWatch* this_arg_conv = (LDKWatch*)this_arg; - LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_EventsProvider_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg; + LDKCVec_EventZ ret_var = (this_arg_conv->get_and_clear_pending_events)(this_arg_conv->this_arg); jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen); jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); - for (size_t o = 0; o < ret_var.datalen; o++) { - LDKMonitorEvent arr_conv_14_var = ret_var.data[o]; - CHECK((((long)arr_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&arr_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long arr_conv_14_ref = (long)arr_conv_14_var.inner; - if (arr_conv_14_var.is_owned) { - arr_conv_14_ref |= 1; - } - ret_arr_ptr[o] = arr_conv_14_ref; + for (size_t h = 0; h < ret_var.datalen; h++) { + LDKEvent *arr_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *arr_conv_7_copy = ret_var.data[h]; + long arr_conv_7_ref = (long)arr_conv_7_copy; + ret_arr_ptr[h] = arr_conv_7_ref; } (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } +typedef struct LDKAccess_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID get_utxo_meth; +} LDKAccess_JCalls; +LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id) { + LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray genesis_hash_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, genesis_hash_arr, 0, 32, *genesis_hash); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id); + LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +static void LDKAccess_JCalls_free(void* this_arg) { + LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + FREE(j_calls); + } +} +static void* LDKAccess_JCalls_clone(const void* this_arg) { + LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKAccess LDKAccess_init (JNIEnv * env, jclass _a, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J"); + CHECK(calls->get_utxo_meth != NULL); + + LDKAccess ret = { + .this_arg = (void*) calls, + .get_utxo = get_utxo_jcall, + .free = LDKAccess_JCalls_free, + }; + return ret; +} +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv * env, jclass _a, jobject o) { + LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *res_ptr = LDKAccess_init(env, _a, o); + return (long)res_ptr; +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKAccess_JCalls*)val)->o); + CHECK(ret != NULL); + return ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray genesis_hash, jlong short_channel_id) { + LDKAccess* this_arg_conv = (LDKAccess*)this_arg; + unsigned char genesis_hash_arr[32]; + CHECK((*_env)->GetArrayLength (_env, genesis_hash) == 32); + (*_env)->GetByteArrayRegion (_env, genesis_hash, 0, 32, genesis_hash_arr); + unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr; + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id); + return (long)ret_conv; +} + typedef struct LDKFilter_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -2554,7 +4026,7 @@ typedef struct LDKFilter_JCalls { jmethodID register_tx_meth; jmethodID register_output_meth; } LDKFilter_JCalls; -void register_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pubkey) { +void register_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); @@ -2567,7 +4039,7 @@ void register_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8sli CHECK(obj != NULL); return (*_env)->CallVoidMethod(_env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr); } -void register_output_jcall(const void* this_arg, const LDKOutPoint *outpoint, LDKu8slice script_pubkey) { +void register_output_jcall(const void* this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); @@ -2656,26 +4128,76 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEn (*_env)->ReleaseByteArrayElements(_env, script_pubkey, (int8_t*)script_pubkey_ref.data, 0); } -typedef struct LDKBroadcasterInterface_JCalls { +typedef struct LDKPersist_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID broadcast_transaction_meth; -} LDKBroadcasterInterface_JCalls; -void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) { - LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; + jmethodID persist_new_channel_meth; + jmethodID update_persisted_channel_meth; +} LDKPersist_JCalls; +LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_jcall(const void* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKTransaction tx_var = tx; - jbyteArray tx_arr = (*_env)->NewByteArray(_env, tx_var.datalen); - (*_env)->SetByteArrayRegion(_env, tx_arr, 0, tx_var.datalen, tx_var.data); - Transaction_free(tx_var); + LDKOutPoint id_var = id; + CHECK((((long)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long id_ref = (long)id_var.inner; + if (id_var.is_owned) { + id_ref |= 1; + } + LDKChannelMonitor data_var = *data; + // Warning: we may need a move here but can't clone! + CHECK((((long)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long data_ref = (long)data_var.inner; + if (data_var.is_owned) { + data_ref |= 1; + } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->broadcast_transaction_meth, tx_arr); + LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*_env)->CallLongMethod(_env, obj, j_calls->persist_new_channel_meth, id_ref, data_ref); + LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)ret; + FREE((void*)ret); + return ret_conv; } -static void LDKBroadcasterInterface_JCalls_free(void* this_arg) { - LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; +LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_jcall(const void* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKOutPoint id_var = id; + CHECK((((long)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long id_ref = (long)id_var.inner; + if (id_var.is_owned) { + id_ref |= 1; + } + LDKChannelMonitorUpdate update_var = *update; + if (update->inner != NULL) + update_var = ChannelMonitorUpdate_clone(update); + CHECK((((long)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long update_ref = (long)update_var.inner; + if (update_var.is_owned) { + update_ref |= 1; + } + LDKChannelMonitor data_var = *data; + // Warning: we may need a move here but can't clone! + CHECK((((long)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long data_ref = (long)data_var.inner; + if (data_var.is_owned) { + data_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*_env)->CallLongMethod(_env, obj, j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref); + LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)ret; + FREE((void*)ret); + return ret_conv; +} +static void LDKPersist_JCalls_free(void* this_arg) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { JNIEnv *env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); @@ -2683,231 +4205,467 @@ static void LDKBroadcasterInterface_JCalls_free(void* this_arg) { FREE(j_calls); } } -static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) { - LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; +static void* LDKPersist_JCalls_clone(const void* this_arg) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); return (void*) this_arg; } -static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env, jclass _a, jobject o) { +static inline LDKPersist LDKPersist_init (JNIEnv * env, jclass _a, jobject o) { jclass c = (*env)->GetObjectClass(env, o); CHECK(c != NULL); - LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls"); + LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls"); atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "([B)V"); - CHECK(calls->broadcast_transaction_meth != NULL); + calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJ)J"); + CHECK(calls->persist_new_channel_meth != NULL); + calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJ)J"); + CHECK(calls->update_persisted_channel_meth != NULL); - LDKBroadcasterInterface ret = { + LDKPersist ret = { .this_arg = (void*) calls, - .broadcast_transaction = broadcast_transaction_jcall, - .free = LDKBroadcasterInterface_JCalls_free, + .persist_new_channel = persist_new_channel_jcall, + .update_persisted_channel = update_persisted_channel_jcall, + .free = LDKPersist_JCalls_free, }; return ret; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) { - LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface"); - *res_ptr = LDKBroadcasterInterface_init(env, _a, o); +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new (JNIEnv * env, jclass _a, jobject o) { + LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist"); + *res_ptr = LDKPersist_init(env, _a, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKBroadcasterInterface_JCalls*)val)->o); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPersist_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKPersist_JCalls*)val)->o); CHECK(ret != NULL); return ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray tx) { - LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg; - LDKTransaction tx_ref; - tx_ref.datalen = (*_env)->GetArrayLength (_env, tx); - tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, tx, 0, tx_ref.datalen, tx_ref.data); - tx_ref.data_is_owned = true; - (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong id, jlong data) { + LDKPersist* this_arg_conv = (LDKPersist*)this_arg; + LDKOutPoint id_conv; + id_conv.inner = (void*)(id & (~1)); + id_conv.is_owned = (id & 1) || (id == 0); + if (id_conv.inner != NULL) + id_conv = OutPoint_clone(&id_conv); + LDKChannelMonitor data_conv; + data_conv.inner = (void*)(data & (~1)); + data_conv.is_owned = false; + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, id_conv, &data_conv); + return (long)ret_conv; } -typedef struct LDKFeeEstimator_JCalls { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong id, jlong update, jlong data) { + LDKPersist* this_arg_conv = (LDKPersist*)this_arg; + LDKOutPoint id_conv; + id_conv.inner = (void*)(id & (~1)); + id_conv.is_owned = (id & 1) || (id == 0); + if (id_conv.inner != NULL) + id_conv = OutPoint_clone(&id_conv); + LDKChannelMonitorUpdate update_conv; + update_conv.inner = (void*)(update & (~1)); + update_conv.is_owned = false; + LDKChannelMonitor data_conv; + data_conv.inner = (void*)(data & (~1)); + data_conv.is_owned = false; + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, id_conv, &update_conv, &data_conv); + return (long)ret_conv; +} + +typedef struct LDKChannelMessageHandler_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID get_est_sat_per_1000_weight_meth; -} LDKFeeEstimator_JCalls; -uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) { - LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; + LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider; + jmethodID handle_open_channel_meth; + jmethodID handle_accept_channel_meth; + jmethodID handle_funding_created_meth; + jmethodID handle_funding_signed_meth; + jmethodID handle_funding_locked_meth; + jmethodID handle_shutdown_meth; + jmethodID handle_closing_signed_meth; + jmethodID handle_update_add_htlc_meth; + jmethodID handle_update_fulfill_htlc_meth; + jmethodID handle_update_fail_htlc_meth; + jmethodID handle_update_fail_malformed_htlc_meth; + jmethodID handle_commitment_signed_meth; + jmethodID handle_revoke_and_ack_meth; + jmethodID handle_update_fee_meth; + jmethodID handle_announcement_signatures_meth; + jmethodID peer_disconnected_meth; + jmethodID peer_connected_meth; + jmethodID handle_channel_reestablish_meth; + jmethodID handle_error_meth; +} LDKChannelMessageHandler_JCalls; +void handle_open_channel_jcall(const void* this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKInitFeatures their_features_var = their_features; + CHECK((((long)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long their_features_ref = (long)their_features_var.inner; + if (their_features_var.is_owned) { + their_features_ref |= 1; + } + LDKOpenChannel msg_var = *msg; + if (msg->inner != NULL) + msg_var = OpenChannel_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref); +} +void handle_accept_channel_jcall(const void* this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKInitFeatures their_features_var = their_features; + CHECK((((long)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long their_features_ref = (long)their_features_var.inner; + if (their_features_var.is_owned) { + their_features_ref |= 1; + } + LDKAcceptChannel msg_var = *msg; + if (msg->inner != NULL) + msg_var = AcceptChannel_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref); +} +void handle_funding_created_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKFundingCreated msg_var = *msg; + if (msg->inner != NULL) + msg_var = FundingCreated_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref); +} +void handle_funding_signed_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKFundingSigned msg_var = *msg; + if (msg->inner != NULL) + msg_var = FundingSigned_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref); +} +void handle_funding_locked_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKFundingLocked msg_var = *msg; + if (msg->inner != NULL) + msg_var = FundingLocked_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref); +} +void handle_shutdown_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKShutdown msg_var = *msg; + if (msg->inner != NULL) + msg_var = Shutdown_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, msg_ref); +} +void handle_closing_signed_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKClosingSigned msg_var = *msg; + if (msg->inner != NULL) + msg_var = ClosingSigned_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref); +} +void handle_update_add_htlc_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKUpdateAddHTLC msg_var = *msg; + if (msg->inner != NULL) + msg_var = UpdateAddHTLC_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref); +} +void handle_update_fulfill_htlc_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jclass confirmation_target_conv = LDKConfirmationTarget_to_java(_env, confirmation_target); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKUpdateFulfillHTLC msg_var = *msg; + if (msg->inner != NULL) + msg_var = UpdateFulfillHTLC_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallIntMethod(_env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref); } -static void LDKFeeEstimator_JCalls_free(void* this_arg) { - LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - JNIEnv *env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - FREE(j_calls); +void handle_update_fail_htlc_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKUpdateFailHTLC msg_var = *msg; + if (msg->inner != NULL) + msg_var = UpdateFailHTLC_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref); } -static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) { - LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - return (void*) this_arg; -} -static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv * env, jclass _a, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/enums/LDKConfirmationTarget;)I"); - CHECK(calls->get_est_sat_per_1000_weight_meth != NULL); - - LDKFeeEstimator ret = { - .this_arg = (void*) calls, - .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall, - .free = LDKFeeEstimator_JCalls_free, - }; - return ret; -} -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) { - LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator"); - *res_ptr = LDKFeeEstimator_init(env, _a, o); - return (long)res_ptr; -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKFeeEstimator_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1per_11000_1weight(JNIEnv * _env, jclass _b, jlong this_arg, jclass confirmation_target) { - LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg; - LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(_env, confirmation_target); - jint ret_val = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv); - return ret_val; -} - -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_C2TupleTempl_usize__Transaction *vec = (LDKCVecTempl_C2TupleTempl_usize__Transaction*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_usize__Transaction)); -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_C2TupleTempl_usize__Transaction *ret = MALLOC(sizeof(LDKCVecTempl_C2TupleTempl_usize__Transaction), "LDKCVecTempl_C2TupleTempl_usize__Transaction"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2TupleTempl_usize__Transaction) * ret->datalen, "LDKCVecTempl_C2TupleTempl_usize__Transaction Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKC2TupleTempl_usize__Transaction arr_elem_conv = *(LDKC2TupleTempl_usize__Transaction*)arr_elem; - FREE((void*)arr_elem); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); +void handle_update_fail_malformed_htlc_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKUpdateFailMalformedHTLC msg_var = *msg; + if (msg->inner != NULL) + msg_var = UpdateFailMalformedHTLC_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; } - return (long)ret; + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_Transaction *vec = (LDKCVecTempl_Transaction*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTransaction)); +void handle_commitment_signed_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKCommitmentSigned msg_var = *msg; + if (msg->inner != NULL) + msg_var = CommitmentSigned_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *vec = (LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut)); +void handle_revoke_and_ack_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKRevokeAndACK msg_var = *msg; + if (msg->inner != NULL) + msg_var = RevokeAndACK_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *ret = MALLOC(sizeof(LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut), "LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut) * ret->datalen, "LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut arr_elem_conv = *(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)arr_elem; - FREE((void*)arr_elem); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); +void handle_update_fee_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKUpdateFee msg_var = *msg; + if (msg->inner != NULL) + msg_var = UpdateFee_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; } - return (long)ret; + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref); } -typedef struct LDKKeysInterface_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID get_node_secret_meth; - jmethodID get_destination_script_meth; - jmethodID get_shutdown_pubkey_meth; - jmethodID get_channel_keys_meth; - jmethodID get_secure_random_bytes_meth; -} LDKKeysInterface_JCalls; -LDKSecretKey get_node_secret_jcall(const void* this_arg) { - LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; +void handle_announcement_signatures_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKAnnouncementSignatures msg_var = *msg; + if (msg->inner != NULL) + msg_var = AnnouncementSignatures_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_node_secret_meth); - LDKSecretKey arg_ref; - CHECK((*_env)->GetArrayLength (_env, arg) == 32); - (*_env)->GetByteArrayRegion (_env, arg, 0, 32, arg_ref.bytes); - return arg_ref; + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref); } -LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) { - LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; +void peer_disconnected_jcall(const void* this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_destination_script_meth); - LDKCVec_u8Z arg_ref; - arg_ref.datalen = (*_env)->GetArrayLength (_env, arg); - arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*_env)->GetByteArrayRegion(_env, arg, 0, arg_ref.datalen, arg_ref.data); - return arg_ref; + return (*_env)->CallVoidMethod(_env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible); } -LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) { - LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; +void peer_connected_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKInit msg_var = *msg; + if (msg->inner != NULL) + msg_var = Init_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_shutdown_pubkey_meth); - LDKPublicKey arg_ref; - CHECK((*_env)->GetArrayLength (_env, arg) == 33); - (*_env)->GetByteArrayRegion (_env, arg, 0, 33, arg_ref.compressed_form); - return arg_ref; + return (*_env)->CallVoidMethod(_env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref); } -LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) { - LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; +void handle_channel_reestablish_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKChannelReestablish msg_var = *msg; + if (msg->inner != NULL) + msg_var = ChannelReestablish_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - LDKChannelKeys* ret = (LDKChannelKeys*)(*_env)->CallLongMethod(_env, obj, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis); - LDKChannelKeys ret_conv = *(LDKChannelKeys*)ret; - ret_conv = ChannelKeys_clone(ret); - return ret_conv; + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref); } -LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) { - LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; +void handle_error_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKErrorMessage msg_var = *msg; + if (msg->inner != NULL) + msg_var = ErrorMessage_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - jbyteArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_secure_random_bytes_meth); - LDKThirtyTwoBytes arg_ref; - CHECK((*_env)->GetArrayLength (_env, arg) == 32); - (*_env)->GetByteArrayRegion (_env, arg, 0, 32, arg_ref.data); - return arg_ref; + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref); } -static void LDKKeysInterface_JCalls_free(void* this_arg) { - LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; +static void LDKChannelMessageHandler_JCalls_free(void* this_arg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { JNIEnv *env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); @@ -2915,340 +4673,333 @@ static void LDKKeysInterface_JCalls_free(void* this_arg) { FREE(j_calls); } } -static void* LDKKeysInterface_JCalls_clone(const void* this_arg) { - LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; +static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release); return (void*) this_arg; } -static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv * env, jclass _a, jobject o) { +static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) { jclass c = (*env)->GetObjectClass(env, o); CHECK(c != NULL); - LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls"); + LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls"); atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()[B"); - CHECK(calls->get_node_secret_meth != NULL); - calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()[B"); - CHECK(calls->get_destination_script_meth != NULL); - calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()[B"); - CHECK(calls->get_shutdown_pubkey_meth != NULL); - calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J"); - CHECK(calls->get_channel_keys_meth != NULL); - calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B"); - CHECK(calls->get_secure_random_bytes_meth != NULL); + calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "([BJJ)V"); + CHECK(calls->handle_open_channel_meth != NULL); + calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "([BJJ)V"); + CHECK(calls->handle_accept_channel_meth != NULL); + calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "([BJ)V"); + CHECK(calls->handle_funding_created_meth != NULL); + calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "([BJ)V"); + CHECK(calls->handle_funding_signed_meth != NULL); + calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "([BJ)V"); + CHECK(calls->handle_funding_locked_meth != NULL); + calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "([BJ)V"); + CHECK(calls->handle_shutdown_meth != NULL); + calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "([BJ)V"); + CHECK(calls->handle_closing_signed_meth != NULL); + calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "([BJ)V"); + CHECK(calls->handle_update_add_htlc_meth != NULL); + calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "([BJ)V"); + CHECK(calls->handle_update_fulfill_htlc_meth != NULL); + calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "([BJ)V"); + CHECK(calls->handle_update_fail_htlc_meth != NULL); + calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "([BJ)V"); + CHECK(calls->handle_update_fail_malformed_htlc_meth != NULL); + calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "([BJ)V"); + CHECK(calls->handle_commitment_signed_meth != NULL); + calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "([BJ)V"); + CHECK(calls->handle_revoke_and_ack_meth != NULL); + calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "([BJ)V"); + CHECK(calls->handle_update_fee_meth != NULL); + calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "([BJ)V"); + CHECK(calls->handle_announcement_signatures_meth != NULL); + calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([BZ)V"); + CHECK(calls->peer_disconnected_meth != NULL); + calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)V"); + CHECK(calls->peer_connected_meth != NULL); + calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "([BJ)V"); + CHECK(calls->handle_channel_reestablish_meth != NULL); + calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "([BJ)V"); + CHECK(calls->handle_error_meth != NULL); - LDKKeysInterface ret = { + LDKChannelMessageHandler ret = { .this_arg = (void*) calls, - .get_node_secret = get_node_secret_jcall, - .get_destination_script = get_destination_script_jcall, - .get_shutdown_pubkey = get_shutdown_pubkey_jcall, - .get_channel_keys = get_channel_keys_jcall, - .get_secure_random_bytes = get_secure_random_bytes_jcall, - .free = LDKKeysInterface_JCalls_free, + .handle_open_channel = handle_open_channel_jcall, + .handle_accept_channel = handle_accept_channel_jcall, + .handle_funding_created = handle_funding_created_jcall, + .handle_funding_signed = handle_funding_signed_jcall, + .handle_funding_locked = handle_funding_locked_jcall, + .handle_shutdown = handle_shutdown_jcall, + .handle_closing_signed = handle_closing_signed_jcall, + .handle_update_add_htlc = handle_update_add_htlc_jcall, + .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall, + .handle_update_fail_htlc = handle_update_fail_htlc_jcall, + .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall, + .handle_commitment_signed = handle_commitment_signed_jcall, + .handle_revoke_and_ack = handle_revoke_and_ack_jcall, + .handle_update_fee = handle_update_fee_jcall, + .handle_announcement_signatures = handle_announcement_signatures_jcall, + .peer_disconnected = peer_disconnected_jcall, + .peer_connected = peer_connected_jcall, + .handle_channel_reestablish = handle_channel_reestablish_jcall, + .handle_error = handle_error_jcall, + .free = LDKChannelMessageHandler_JCalls_free, + .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, _a, MessageSendEventsProvider), }; + calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg; return ret; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) { - LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); - *res_ptr = LDKKeysInterface_init(env, _a, o); +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) { + LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); + *res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKKeysInterface_JCalls*)val)->o); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKChannelMessageHandler_JCalls*)val)->o); CHECK(ret != NULL); return ret; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes); - return arg_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1open_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong their_features, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKInitFeatures their_features_conv; + their_features_conv.inner = (void*)(their_features & (~1)); + their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + // Warning: we may need a move here but can't clone! + LDKOpenChannel msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1accept_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong their_features, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKInitFeatures their_features_conv; + their_features_conv.inner = (void*)(their_features & (~1)); + their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + // Warning: we may need a move here but can't clone! + LDKAcceptChannel msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1created(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKFundingCreated msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1signed(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKFundingSigned msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1locked(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKFundingLocked msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKShutdown msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1closing_1signed(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKClosingSigned msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1add_1htlc(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKUpdateAddHTLC msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fulfill_1htlc(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKUpdateFulfillHTLC msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1htlc(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKUpdateFailHTLC msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1malformed_1htlc(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKUpdateFailMalformedHTLC msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKCommitmentSigned msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1destination_1script(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; - LDKCVec_u8Z arg_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); - return arg_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1revoke_1and_1ack(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKRevokeAndACK msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, (this_arg_conv->get_shutdown_pubkey)(this_arg_conv->this_arg).compressed_form); - return arg_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fee(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKUpdateFee msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1keys(JNIEnv * _env, jclass _b, jlong this_arg, jboolean inbound, jlong channel_value_satoshis) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; - LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys"); - *ret = (this_arg_conv->get_channel_keys)(this_arg_conv->this_arg, inbound, channel_value_satoshis); - return (long)ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1announcement_1signatures(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKAnnouncementSignatures msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1secure_1random_1bytes(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data); - return arg_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jboolean no_connection_possible) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible); } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_ChannelDetails *vec = (LDKCVecTempl_ChannelDetails*)ptr; - jlongArray ret = (*env)->NewLongArray(env, vec->datalen); - jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); - for (size_t i = 0; i < vec->datalen; i++) { - CHECK((((long)vec->data[i].inner) & 1) == 0); - ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); - return ret; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_ChannelDetails *ret = MALLOC(sizeof(LDKCVecTempl_ChannelDetails), "LDKCVecTempl_ChannelDetails"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVecTempl_ChannelDetails Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKChannelDetails arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - if (arr_elem_conv.inner != NULL) - arr_elem_conv = ChannelDetails_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (long)ret; -} -static jclass LDKNetAddress_IPv4_class = NULL; -static jmethodID LDKNetAddress_IPv4_meth = NULL; -static jclass LDKNetAddress_IPv6_class = NULL; -static jmethodID LDKNetAddress_IPv6_meth = NULL; -static jclass LDKNetAddress_OnionV2_class = NULL; -static jmethodID LDKNetAddress_OnionV2_meth = NULL; -static jclass LDKNetAddress_OnionV3_class = NULL; -static jmethodID LDKNetAddress_OnionV3_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv * env, jclass _a) { - LDKNetAddress_IPv4_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv4;")); - CHECK(LDKNetAddress_IPv4_class != NULL); - LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "", "([BS)V"); - CHECK(LDKNetAddress_IPv4_meth != NULL); - LDKNetAddress_IPv6_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv6;")); - CHECK(LDKNetAddress_IPv6_class != NULL); - LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "", "([BS)V"); - CHECK(LDKNetAddress_IPv6_meth != NULL); - LDKNetAddress_OnionV2_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV2;")); - CHECK(LDKNetAddress_OnionV2_class != NULL); - LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "", "([BS)V"); - CHECK(LDKNetAddress_OnionV2_meth != NULL); - LDKNetAddress_OnionV3_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV3;")); - CHECK(LDKNetAddress_OnionV3_class != NULL); - LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "", "([BSBS)V"); - CHECK(LDKNetAddress_OnionV3_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr (JNIEnv * _env, jclass _c, jlong ptr) { - LDKNetAddress *obj = (LDKNetAddress*)ptr; - switch(obj->tag) { - case LDKNetAddress_IPv4: { - jbyteArray addr_arr = (*_env)->NewByteArray(_env, 4); - (*_env)->SetByteArrayRegion(_env, addr_arr, 0, 4, obj->i_pv4.addr.data); - return (*_env)->NewObject(_env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_arr, obj->i_pv4.port); - } - case LDKNetAddress_IPv6: { - jbyteArray addr_arr = (*_env)->NewByteArray(_env, 16); - (*_env)->SetByteArrayRegion(_env, addr_arr, 0, 16, obj->i_pv6.addr.data); - return (*_env)->NewObject(_env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, obj->i_pv6.port); - } - case LDKNetAddress_OnionV2: { - jbyteArray addr_arr = (*_env)->NewByteArray(_env, 10); - (*_env)->SetByteArrayRegion(_env, addr_arr, 0, 10, obj->onion_v2.addr.data); - return (*_env)->NewObject(_env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, addr_arr, obj->onion_v2.port); - } - case LDKNetAddress_OnionV3: { - jbyteArray ed25519_pubkey_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data); - return (*_env)->NewObject(_env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, obj->onion_v3.checksum, obj->onion_v3.version, obj->onion_v3.port); - } - default: abort(); - } -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_NetAddress *vec = (LDKCVecTempl_NetAddress*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNetAddress)); -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_NetAddress *ret = MALLOC(sizeof(LDKCVecTempl_NetAddress), "LDKCVecTempl_NetAddress"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNetAddress) * ret->datalen, "LDKCVecTempl_NetAddress Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKNetAddress arr_elem_conv = *(LDKNetAddress*)arr_elem; - FREE((void*)arr_elem); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (long)ret; -} -typedef struct LDKChannelMessageHandler_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider; - jmethodID handle_open_channel_meth; - jmethodID handle_accept_channel_meth; - jmethodID handle_funding_created_meth; - jmethodID handle_funding_signed_meth; - jmethodID handle_funding_locked_meth; - jmethodID handle_shutdown_meth; - jmethodID handle_closing_signed_meth; - jmethodID handle_update_add_htlc_meth; - jmethodID handle_update_fulfill_htlc_meth; - jmethodID handle_update_fail_htlc_meth; - jmethodID handle_update_fail_malformed_htlc_meth; - jmethodID handle_commitment_signed_meth; - jmethodID handle_revoke_and_ack_meth; - jmethodID handle_update_fee_meth; - jmethodID handle_announcement_signatures_meth; - jmethodID peer_disconnected_meth; - jmethodID peer_connected_meth; - jmethodID handle_channel_reestablish_meth; - jmethodID handle_error_meth; -} LDKChannelMessageHandler_JCalls; -void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKInitFeatures their_features_var = their_features; - CHECK((((long)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long their_features_ref = (long)their_features_var.inner; - if (their_features_var.is_owned) { - their_features_ref |= 1; - } - LDKOpenChannel msg_var = *msg; - if (msg->inner != NULL) - msg_var = OpenChannel_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref); -} -void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKInitFeatures their_features_var = their_features; - CHECK((((long)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long their_features_ref = (long)their_features_var.inner; - if (their_features_var.is_owned) { - their_features_ref |= 1; - } - LDKAcceptChannel msg_var = *msg; - if (msg->inner != NULL) - msg_var = AcceptChannel_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref); -} -void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKFundingCreated msg_var = *msg; - if (msg->inner != NULL) - msg_var = FundingCreated_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKInit msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKFundingSigned msg_var = *msg; - if (msg->inner != NULL) - msg_var = FundingSigned_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKChannelReestablish msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKFundingLocked msg_var = *msg; - if (msg->inner != NULL) - msg_var = FundingLocked_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1error(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKErrorMessage msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + +typedef struct LDKRoutingMessageHandler_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider; + jmethodID handle_node_announcement_meth; + jmethodID handle_channel_announcement_meth; + jmethodID handle_channel_update_meth; + jmethodID handle_htlc_fail_channel_update_meth; + jmethodID get_next_channel_announcements_meth; + jmethodID get_next_node_announcements_meth; + jmethodID sync_routing_table_meth; + jmethodID handle_reply_channel_range_meth; + jmethodID handle_reply_short_channel_ids_end_meth; + jmethodID handle_query_channel_range_meth; + jmethodID handle_query_short_channel_ids_meth; +} LDKRoutingMessageHandler_JCalls; +LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKShutdown msg_var = *msg; + LDKNodeAnnouncement msg_var = *msg; if (msg->inner != NULL) - msg_var = Shutdown_clone(msg); + msg_var = NodeAnnouncement_clone(msg); CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. long msg_ref = (long)msg_var.inner; @@ -3257,17 +5008,18 @@ void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, con } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, msg_ref); + LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_node_announcement_meth, msg_ref); + LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; } -void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKClosingSigned msg_var = *msg; + LDKChannelAnnouncement msg_var = *msg; if (msg->inner != NULL) - msg_var = ClosingSigned_clone(msg); + msg_var = ChannelAnnouncement_clone(msg); CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. long msg_ref = (long)msg_var.inner; @@ -3276,17 +5028,18 @@ void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_i } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref); + LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_channel_announcement_meth, msg_ref); + LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; } -void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKUpdateAddHTLC msg_var = *msg; + LDKChannelUpdate msg_var = *msg; if (msg->inner != NULL) - msg_var = UpdateAddHTLC_clone(msg); + msg_var = ChannelUpdate_clone(msg); CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. long msg_ref = (long)msg_var.inner; @@ -3295,131 +5048,97 @@ void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_ } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref); + LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_channel_update_meth, msg_ref); + LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; } -void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +void handle_htlc_fail_channel_update_jcall(const void* this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKUpdateFulfillHTLC msg_var = *msg; - if (msg->inner != NULL) - msg_var = UpdateFulfillHTLC_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; - } + long ret_update = (long)update; jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref); + return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_htlc_fail_channel_update_meth, ret_update); } -void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKUpdateFailHTLC msg_var = *msg; - if (msg->inner != NULL) - msg_var = UpdateFailHTLC_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; - } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref); -} -void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKUpdateFailMalformedHTLC msg_var = *msg; - if (msg->inner != NULL) - msg_var = UpdateFailMalformedHTLC_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; + jlongArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount); + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_constr; + arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); + if (arg_constr.datalen > 0) + arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); + else + arg_constr.data = NULL; + long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); + for (size_t l = 0; l < arg_constr.datalen; l++) { + long arr_conv_63 = arg_vals[l]; + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arr_conv_63; + FREE((void*)arr_conv_63); + arg_constr.data[l] = arr_conv_63_conv; } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref); + (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); + return arg_constr; } -void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKCommitmentSigned msg_var = *msg; - if (msg->inner != NULL) - msg_var = CommitmentSigned_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; - } + jbyteArray starting_point_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, starting_point_arr, 0, 33, starting_point.compressed_form); jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref); -} -void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKRevokeAndACK msg_var = *msg; - if (msg->inner != NULL) - msg_var = RevokeAndACK_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; + jlongArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount); + LDKCVec_NodeAnnouncementZ arg_constr; + arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); + if (arg_constr.datalen > 0) + arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); + else + arg_constr.data = NULL; + long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); + for (size_t s = 0; s < arg_constr.datalen; s++) { + long arr_conv_18 = arg_vals[s]; + LDKNodeAnnouncement arr_conv_18_conv; + arr_conv_18_conv.inner = (void*)(arr_conv_18 & (~1)); + arr_conv_18_conv.is_owned = (arr_conv_18 & 1) || (arr_conv_18 == 0); + if (arr_conv_18_conv.inner != NULL) + arr_conv_18_conv = NodeAnnouncement_clone(&arr_conv_18_conv); + arg_constr.data[s] = arr_conv_18_conv; } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref); + (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); + return arg_constr; } -void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +void sync_routing_table_jcall(const void* this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKUpdateFee msg_var = *msg; - if (msg->inner != NULL) - msg_var = UpdateFee_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; + LDKInit init_var = *init; + if (init->inner != NULL) + init_var = Init_clone(init); + CHECK((((long)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long init_ref = (long)init_var.inner; + if (init_var.is_owned) { + init_ref |= 1; } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref); + return (*_env)->CallVoidMethod(_env, obj, j_calls->sync_routing_table_meth, their_node_id_arr, init_ref); } -void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +LDKCResult_NoneLightningErrorZ handle_reply_channel_range_jcall(const void* this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKAnnouncementSignatures msg_var = *msg; - if (msg->inner != NULL) - msg_var = AnnouncementSignatures_clone(msg); + LDKReplyChannelRange msg_var = msg; CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. long msg_ref = (long)msg_var.inner; @@ -3428,27 +5147,18 @@ void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey the } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref); -} -void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible); + LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; } -void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_jcall(const void* this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKInit msg_var = *msg; - if (msg->inner != NULL) - msg_var = Init_clone(msg); + jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); + LDKReplyShortChannelIdsEnd msg_var = msg; CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. long msg_ref = (long)msg_var.inner; @@ -3457,17 +5167,18 @@ void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, cons } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; } -void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +LDKCResult_NoneLightningErrorZ handle_query_channel_range_jcall(const void* this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKChannelReestablish msg_var = *msg; - if (msg->inner != NULL) - msg_var = ChannelReestablish_clone(msg); + LDKQueryChannelRange msg_var = msg; CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. long msg_ref = (long)msg_var.inner; @@ -3476,17 +5187,18 @@ void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_n } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; } -void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_jcall(const void* this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; JNIEnv *_env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); jbyteArray their_node_id_arr = (*_env)->NewByteArray(_env, 33); (*_env)->SetByteArrayRegion(_env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKErrorMessage msg_var = *msg; - if (msg->inner != NULL) - msg_var = ErrorMessage_clone(msg); + LDKQueryShortChannelIds msg_var = msg; CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. long msg_ref = (long)msg_var.inner; @@ -3495,10 +5207,13 @@ void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const } jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; } -static void LDKChannelMessageHandler_JCalls_free(void* this_arg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { JNIEnv *env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); @@ -3506,2154 +5221,2067 @@ static void LDKChannelMessageHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; +static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release); return (void*) this_arg; } -static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) { +static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) { jclass c = (*env)->GetObjectClass(env, o); CHECK(c != NULL); - LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls"); + LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls"); atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "([BJJ)V"); - CHECK(calls->handle_open_channel_meth != NULL); - calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "([BJJ)V"); - CHECK(calls->handle_accept_channel_meth != NULL); - calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "([BJ)V"); - CHECK(calls->handle_funding_created_meth != NULL); - calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "([BJ)V"); - CHECK(calls->handle_funding_signed_meth != NULL); - calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "([BJ)V"); - CHECK(calls->handle_funding_locked_meth != NULL); - calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "([BJ)V"); - CHECK(calls->handle_shutdown_meth != NULL); - calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "([BJ)V"); - CHECK(calls->handle_closing_signed_meth != NULL); - calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "([BJ)V"); - CHECK(calls->handle_update_add_htlc_meth != NULL); - calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "([BJ)V"); - CHECK(calls->handle_update_fulfill_htlc_meth != NULL); - calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "([BJ)V"); - CHECK(calls->handle_update_fail_htlc_meth != NULL); - calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "([BJ)V"); - CHECK(calls->handle_update_fail_malformed_htlc_meth != NULL); - calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "([BJ)V"); - CHECK(calls->handle_commitment_signed_meth != NULL); - calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "([BJ)V"); - CHECK(calls->handle_revoke_and_ack_meth != NULL); - calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "([BJ)V"); - CHECK(calls->handle_update_fee_meth != NULL); - calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "([BJ)V"); - CHECK(calls->handle_announcement_signatures_meth != NULL); - calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([BZ)V"); - CHECK(calls->peer_disconnected_meth != NULL); - calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)V"); - CHECK(calls->peer_connected_meth != NULL); - calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "([BJ)V"); - CHECK(calls->handle_channel_reestablish_meth != NULL); - calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "([BJ)V"); - CHECK(calls->handle_error_meth != NULL); + calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J"); + CHECK(calls->handle_node_announcement_meth != NULL); + calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J"); + CHECK(calls->handle_channel_announcement_meth != NULL); + calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J"); + CHECK(calls->handle_channel_update_meth != NULL); + calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V"); + CHECK(calls->handle_htlc_fail_channel_update_meth != NULL); + calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)[J"); + CHECK(calls->get_next_channel_announcements_meth != NULL); + calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "([BB)[J"); + CHECK(calls->get_next_node_announcements_meth != NULL); + calls->sync_routing_table_meth = (*env)->GetMethodID(env, c, "sync_routing_table", "([BJ)V"); + CHECK(calls->sync_routing_table_meth != NULL); + calls->handle_reply_channel_range_meth = (*env)->GetMethodID(env, c, "handle_reply_channel_range", "([BJ)J"); + CHECK(calls->handle_reply_channel_range_meth != NULL); + calls->handle_reply_short_channel_ids_end_meth = (*env)->GetMethodID(env, c, "handle_reply_short_channel_ids_end", "([BJ)J"); + CHECK(calls->handle_reply_short_channel_ids_end_meth != NULL); + calls->handle_query_channel_range_meth = (*env)->GetMethodID(env, c, "handle_query_channel_range", "([BJ)J"); + CHECK(calls->handle_query_channel_range_meth != NULL); + calls->handle_query_short_channel_ids_meth = (*env)->GetMethodID(env, c, "handle_query_short_channel_ids", "([BJ)J"); + CHECK(calls->handle_query_short_channel_ids_meth != NULL); - LDKChannelMessageHandler ret = { + LDKRoutingMessageHandler ret = { .this_arg = (void*) calls, - .handle_open_channel = handle_open_channel_jcall, - .handle_accept_channel = handle_accept_channel_jcall, - .handle_funding_created = handle_funding_created_jcall, - .handle_funding_signed = handle_funding_signed_jcall, - .handle_funding_locked = handle_funding_locked_jcall, - .handle_shutdown = handle_shutdown_jcall, - .handle_closing_signed = handle_closing_signed_jcall, - .handle_update_add_htlc = handle_update_add_htlc_jcall, - .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall, - .handle_update_fail_htlc = handle_update_fail_htlc_jcall, - .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall, - .handle_commitment_signed = handle_commitment_signed_jcall, - .handle_revoke_and_ack = handle_revoke_and_ack_jcall, - .handle_update_fee = handle_update_fee_jcall, - .handle_announcement_signatures = handle_announcement_signatures_jcall, - .peer_disconnected = peer_disconnected_jcall, - .peer_connected = peer_connected_jcall, - .handle_channel_reestablish = handle_channel_reestablish_jcall, - .handle_error = handle_error_jcall, - .free = LDKChannelMessageHandler_JCalls_free, + .handle_node_announcement = handle_node_announcement_jcall, + .handle_channel_announcement = handle_channel_announcement_jcall, + .handle_channel_update = handle_channel_update_jcall, + .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall, + .get_next_channel_announcements = get_next_channel_announcements_jcall, + .get_next_node_announcements = get_next_node_announcements_jcall, + .sync_routing_table = sync_routing_table_jcall, + .handle_reply_channel_range = handle_reply_channel_range_jcall, + .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_jcall, + .handle_query_channel_range = handle_query_channel_range_jcall, + .handle_query_short_channel_ids = handle_query_short_channel_ids_jcall, + .free = LDKRoutingMessageHandler_JCalls_free, .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, _a, MessageSendEventsProvider), }; calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg; return ret; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) { - LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); - *res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider); +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) { + LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); + *res_ptr = LDKRoutingMessageHandler_init(env, _a, o, MessageSendEventsProvider); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKChannelMessageHandler_JCalls*)val)->o); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKRoutingMessageHandler_JCalls*)val)->o); CHECK(ret != NULL); return ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1open_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong their_features, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKInitFeatures their_features_conv; - their_features_conv.inner = (void*)(their_features & (~1)); - their_features_conv.is_owned = (their_features & 1) || (their_features == 0); - // Warning: we may need a move here but can't clone! - LDKOpenChannel msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1accept_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong their_features, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKInitFeatures their_features_conv; - their_features_conv.inner = (void*)(their_features & (~1)); - their_features_conv.is_owned = (their_features & 1) || (their_features == 0); - // Warning: we may need a move here but can't clone! - LDKAcceptChannel msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1created(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKFundingCreated msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1signed(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKFundingSigned msg_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; - (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1locked(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKFundingLocked msg_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; - (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKShutdown msg_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; - (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1closing_1signed(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKClosingSigned msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1htlc_1fail_1channel_1update(JNIEnv * _env, jclass _b, jlong this_arg, jlong update) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKHTLCFailChannelUpdate* update_conv = (LDKHTLCFailChannelUpdate*)update; + (this_arg_conv->handle_htlc_fail_channel_update)(this_arg_conv->this_arg, update_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1add_1htlc(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKUpdateAddHTLC msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1channel_1announcements(JNIEnv * _env, jclass _b, jlong this_arg, jlong starting_point, jbyte batch_amount) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount); + jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen); + jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); + for (size_t l = 0; l < ret_var.datalen; l++) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arr_conv_63_ref = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *arr_conv_63_ref = ret_var.data[l]; + ret_arr_ptr[l] = (long)arr_conv_63_ref; + } + (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fulfill_1htlc(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKUpdateFulfillHTLC msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1node_1announcements(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray starting_point, jbyte batch_amount) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKPublicKey starting_point_ref; + CHECK((*_env)->GetArrayLength (_env, starting_point) == 33); + (*_env)->GetByteArrayRegion (_env, starting_point, 0, 33, starting_point_ref.compressed_form); + LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount); + jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen); + jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); + for (size_t s = 0; s < ret_var.datalen; s++) { + LDKNodeAnnouncement arr_conv_18_var = ret_var.data[s]; + CHECK((((long)arr_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&arr_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long arr_conv_18_ref = (long)arr_conv_18_var.inner; + if (arr_conv_18_var.is_owned) { + arr_conv_18_ref |= 1; + } + ret_arr_ptr[s] = arr_conv_18_ref; + } + (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1htlc(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1sync_1routing_1table(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong init) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; LDKPublicKey their_node_id_ref; CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKUpdateFailHTLC msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + LDKInit init_conv; + init_conv.inner = (void*)(init & (~1)); + init_conv.is_owned = false; + (this_arg_conv->sync_routing_table)(this_arg_conv->this_arg, their_node_id_ref, &init_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1malformed_1htlc(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1channel_1range(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; LDKPublicKey their_node_id_ref; CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKUpdateFailMalformedHTLC msg_conv; + LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + msg_conv.is_owned = (msg & 1) || (msg == 0); + if (msg_conv.inner != NULL) + msg_conv = ReplyChannelRange_clone(&msg_conv); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1short_1channel_1ids_1end(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; LDKPublicKey their_node_id_ref; CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKCommitmentSigned msg_conv; + LDKReplyShortChannelIdsEnd msg_conv; msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + msg_conv.is_owned = (msg & 1) || (msg == 0); + if (msg_conv.inner != NULL) + msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1revoke_1and_1ack(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1channel_1range(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; LDKPublicKey their_node_id_ref; CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKRevokeAndACK msg_conv; + LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + msg_conv.is_owned = (msg & 1) || (msg == 0); + if (msg_conv.inner != NULL) + msg_conv = QueryChannelRange_clone(&msg_conv); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fee(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; LDKPublicKey their_node_id_ref; CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKUpdateFee msg_conv; + LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + msg_conv.is_owned = (msg & 1) || (msg == 0); + if (msg_conv.inner != NULL) + msg_conv = QueryShortChannelIds_clone(&msg_conv); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1announcement_1signatures(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKAnnouncementSignatures msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +typedef struct LDKSocketDescriptor_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID send_data_meth; + jmethodID disconnect_socket_meth; + jmethodID eq_meth; + jmethodID hash_meth; +} LDKSocketDescriptor_JCalls; +uintptr_t send_data_jcall(void* this_arg, struct LDKu8slice data, bool resume_read) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKu8slice data_var = data; + jbyteArray data_arr = (*_env)->NewByteArray(_env, data_var.datalen); + (*_env)->SetByteArrayRegion(_env, data_arr, 0, data_var.datalen, data_var.data); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallLongMethod(_env, obj, j_calls->send_data_meth, data_arr, resume_read); } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jboolean no_connection_possible) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible); +void disconnect_socket_jcall(void* this_arg) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallVoidMethod(_env, obj, j_calls->disconnect_socket_meth); } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKInit msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +bool eq_jcall(const void* this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *other_arg_clone = SocketDescriptor_clone(other_arg); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallBooleanMethod(_env, obj, j_calls->eq_meth, (long)other_arg_clone); } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKChannelReestablish msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +uint64_t hash_jcall(const void* this_arg) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + JNIEnv *_env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); + jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); + CHECK(obj != NULL); + return (*_env)->CallLongMethod(_env, obj, j_calls->hash_meth); } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1error(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKErrorMessage msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); +static void LDKSocketDescriptor_JCalls_free(void* this_arg) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + JNIEnv *env; + DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); + (*env)->DeleteWeakGlobalRef(env, j_calls->o); + FREE(j_calls); + } +} +static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; } +static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "([BZ)J"); + CHECK(calls->send_data_meth != NULL); + calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V"); + CHECK(calls->disconnect_socket_meth != NULL); + calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z"); + CHECK(calls->eq_meth != NULL); + calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J"); + CHECK(calls->hash_meth != NULL); -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_ChannelMonitor *vec = (LDKCVecTempl_ChannelMonitor*)ptr; - jlongArray ret = (*env)->NewLongArray(env, vec->datalen); - jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); - for (size_t i = 0; i < vec->datalen; i++) { - CHECK((((long)vec->data[i].inner) & 1) == 0); - ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); + LDKSocketDescriptor ret = { + .this_arg = (void*) calls, + .send_data = send_data_jcall, + .disconnect_socket = disconnect_socket_jcall, + .eq = eq_jcall, + .hash = hash_jcall, + .clone = LDKSocketDescriptor_JCalls_clone, + .free = LDKSocketDescriptor_JCalls_free, + }; return ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_ChannelMonitor *ret = MALLOC(sizeof(LDKCVecTempl_ChannelMonitor), "LDKCVecTempl_ChannelMonitor"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelMonitor) * ret->datalen, "LDKCVecTempl_ChannelMonitor Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKChannelMonitor arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - // Warning: we may need a move here but can't clone! - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (long)ret; +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) { + LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *res_ptr = LDKSocketDescriptor_init(env, _a, o); + return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_u64 *vec = (LDKCVecTempl_u64*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint64_t)); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { + jobject ret = (*env)->NewLocalRef(env, ((LDKSocketDescriptor_JCalls*)val)->o); + CHECK(ret != NULL); + return ret; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_u64 *ret = MALLOC(sizeof(LDKCVecTempl_u64), "LDKCVecTempl_u64"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint64_t) * ret->datalen, "LDKCVecTempl_u64 Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (long)ret; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray data, jboolean resume_read) { + LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; + LDKu8slice data_ref; + data_ref.datalen = (*_env)->GetArrayLength (_env, data); + data_ref.data = (*_env)->GetByteArrayElements (_env, data, NULL); + jlong ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read); + (*_env)->ReleaseByteArrayElements(_env, data, (int8_t*)data_ref.data, 0); + return ret_val; } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_UpdateAddHTLC *vec = (LDKCVecTempl_UpdateAddHTLC*)ptr; - jlongArray ret = (*env)->NewLongArray(env, vec->datalen); - jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); - for (size_t i = 0; i < vec->datalen; i++) { - CHECK((((long)vec->data[i].inner) & 1) == 0); - ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); - return ret; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; + (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_UpdateAddHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateAddHTLC), "LDKCVecTempl_UpdateAddHTLC"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateAddHTLC) * ret->datalen, "LDKCVecTempl_UpdateAddHTLC Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKUpdateAddHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - if (arr_elem_conv.inner != NULL) - arr_elem_conv = UpdateAddHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (long)ret; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; + jlong ret_val = (this_arg_conv->hash)(this_arg_conv->this_arg); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jbyteArray _res) { + LDKTransaction _res_ref; + _res_ref.datalen = (*_env)->GetArrayLength (_env, _res); + _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes"); + (*_env)->GetByteArrayRegion(_env, _res, 0, _res_ref.datalen, _res_ref.data); + _res_ref.data_is_owned = true; + Transaction_free(_res_ref); } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_UpdateFulfillHTLC *vec = (LDKCVecTempl_UpdateFulfillHTLC*)ptr; - jlongArray ret = (*env)->NewLongArray(env, vec->datalen); - jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); - for (size_t i = 0; i < vec->datalen; i++) { - CHECK((((long)vec->data[i].inner) & 1) == 0); - ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); - return ret; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKTxOut _res_conv = *(LDKTxOut*)_res; + FREE((void*)_res); + TxOut_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_UpdateFulfillHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateFulfillHTLC), "LDKCVecTempl_UpdateFulfillHTLC"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * ret->datalen, "LDKCVecTempl_UpdateFulfillHTLC Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKUpdateFulfillHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - if (arr_elem_conv.inner != NULL) - arr_elem_conv = UpdateFulfillHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKTxOut* orig_conv = (LDKTxOut*)orig; + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_clone(orig_conv); + return (long)ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_SpendableOutputDescriptorZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t b = 0; b < _res_constr.datalen; b++) { + long arr_conv_27 = _res_vals[b]; + LDKSpendableOutputDescriptor arr_conv_27_conv = *(LDKSpendableOutputDescriptor*)arr_conv_27; + FREE((void*)arr_conv_27); + _res_constr.data[b] = arr_conv_27_conv; } - return (long)ret; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_SpendableOutputDescriptorZ_free(_res_constr); } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_UpdateFailHTLC *vec = (LDKCVecTempl_UpdateFailHTLC*)ptr; - jlongArray ret = (*env)->NewLongArray(env, vec->datalen); - jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); - for (size_t i = 0; i < vec->datalen; i++) { - CHECK((((long)vec->data[i].inner) & 1) == 0); - ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_MessageSendEventZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t s = 0; s < _res_constr.datalen; s++) { + long arr_conv_18 = _res_vals[s]; + LDKMessageSendEvent arr_conv_18_conv = *(LDKMessageSendEvent*)arr_conv_18; + FREE((void*)arr_conv_18); + _res_constr.data[s] = arr_conv_18_conv; } - (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); - return ret; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_MessageSendEventZ_free(_res_constr); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_UpdateFailHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateFailHTLC), "LDKCVecTempl_UpdateFailHTLC"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailHTLC) * ret->datalen, "LDKCVecTempl_UpdateFailHTLC Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKUpdateFailHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - if (arr_elem_conv.inner != NULL) - arr_elem_conv = UpdateFailHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_EventZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t h = 0; h < _res_constr.datalen; h++) { + long arr_conv_7 = _res_vals[h]; + LDKEvent arr_conv_7_conv = *(LDKEvent*)arr_conv_7; + FREE((void*)arr_conv_7); + _res_constr.data[h] = arr_conv_7_conv; } - return (long)ret; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_EventZ_free(_res_constr); } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_UpdateFailMalformedHTLC *vec = (LDKCVecTempl_UpdateFailMalformedHTLC*)ptr; - jlongArray ret = (*env)->NewLongArray(env, vec->datalen); - jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); - for (size_t i = 0; i < vec->datalen; i++) { - CHECK((((long)vec->data[i].inner) & 1) == 0); - ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)_res; + FREE((void*)_res); + C2Tuple_usizeTransactionZ_free(_res_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jbyteArray b) { + LDKTransaction b_ref; + b_ref.datalen = (*_env)->GetArrayLength (_env, b); + b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); + (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data); + b_ref.data_is_owned = true; + LDKC2Tuple_usizeTransactionZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_ref = C2Tuple_usizeTransactionZ_new(a, b_ref); + return (long)ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_C2Tuple_usizeTransactionZZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t y = 0; y < _res_constr.datalen; y++) { + long arr_conv_24 = _res_vals[y]; + LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_24; + FREE((void*)arr_conv_24); + _res_constr.data[y] = arr_conv_24_conv; } - (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); - return ret; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_C2Tuple_usizeTransactionZZ_free(_res_constr); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_UpdateFailMalformedHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateFailMalformedHTLC), "LDKCVecTempl_UpdateFailMalformedHTLC"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen, "LDKCVecTempl_UpdateFailMalformedHTLC Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKUpdateFailMalformedHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - if (arr_elem_conv.inner != NULL) - arr_elem_conv = UpdateFailMalformedHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) { + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok(); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jclass e) { + LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_java(_env, e); + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv); + return (long)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)_res; + FREE((void*)_res); + CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_MonitorEventZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t o = 0; o < _res_constr.datalen; o++) { + long arr_conv_14 = _res_vals[o]; + LDKMonitorEvent arr_conv_14_conv; + arr_conv_14_conv.inner = (void*)(arr_conv_14 & (~1)); + arr_conv_14_conv.is_owned = (arr_conv_14 & 1) || (arr_conv_14 == 0); + _res_constr.data[o] = arr_conv_14_conv; } - return (long)ret; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_MonitorEventZ_free(_res_constr); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKChannelMonitorUpdate o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = ChannelMonitorUpdate_clone(&o_conv); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); + return (long)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)arg; - CHECK(val->result_ok); - return *val->contents.result; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)arg; - CHECK(!val->result_ok); - LDKLightningError err_var = (*val->contents.err); - CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long err_ref = (long)err_var.inner & ~1; - return err_ref; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *vec = (LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate)); + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) { + LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); + *ret_conv = CResult_NoneMonitorUpdateErrorZ_ok(); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *ret = MALLOC(sizeof(LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate), "LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate) * ret->datalen, "LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate arr_elem_conv = *(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)arr_elem; - FREE((void*)arr_elem); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (long)ret; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKMonitorUpdateError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); + *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_NodeAnnouncement *vec = (LDKCVecTempl_NodeAnnouncement*)ptr; - jlongArray ret = (*env)->NewLongArray(env, vec->datalen); - jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); - for (size_t i = 0; i < vec->datalen; i++) { - CHECK((((long)vec->data[i].inner) & 1) == 0); - ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); - return ret; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)_res; + FREE((void*)_res); + CResult_NoneMonitorUpdateErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_NodeAnnouncement *ret = MALLOC(sizeof(LDKCVecTempl_NodeAnnouncement), "LDKCVecTempl_NodeAnnouncement"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNodeAnnouncement) * ret->datalen, "LDKCVecTempl_NodeAnnouncement Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKNodeAnnouncement arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - if (arr_elem_conv.inner != NULL) - arr_elem_conv = NodeAnnouncement_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (long)ret; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)_res; + FREE((void*)_res); + C2Tuple_OutPointScriptZ_free(_res_conv); } -typedef struct LDKRoutingMessageHandler_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID handle_node_announcement_meth; - jmethodID handle_channel_announcement_meth; - jmethodID handle_channel_update_meth; - jmethodID handle_htlc_fail_channel_update_meth; - jmethodID get_next_channel_announcements_meth; - jmethodID get_next_node_announcements_meth; - jmethodID should_request_full_sync_meth; -} LDKRoutingMessageHandler_JCalls; -LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) { - LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKNodeAnnouncement msg_var = *msg; - if (msg->inner != NULL) - msg_var = NodeAnnouncement_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; - } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_node_announcement_meth, msg_ref); - LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)ret; - FREE((void*)ret); - return ret_conv; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jbyteArray b) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + if (a_conv.inner != NULL) + a_conv = OutPoint_clone(&a_conv); + LDKCVec_u8Z b_ref; + b_ref.datalen = (*_env)->GetArrayLength (_env, b); + b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); + (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data); + LDKC2Tuple_OutPointScriptZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_ref = C2Tuple_OutPointScriptZ_new(a_conv, b_ref); + return (long)ret_ref; } -LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) { - LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKChannelAnnouncement msg_var = *msg; - if (msg->inner != NULL) - msg_var = ChannelAnnouncement_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jobjectArray _res) { + LDKCVec_TransactionZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements"); + else + _res_constr.data = NULL; + for (size_t i = 0; i < _res_constr.datalen; i++) { + jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, _res, i); + LDKTransaction arr_conv_8_ref; + arr_conv_8_ref.datalen = (*_env)->GetArrayLength (_env, arr_conv_8); + arr_conv_8_ref.data = MALLOC(arr_conv_8_ref.datalen, "LDKTransaction Bytes"); + (*_env)->GetByteArrayRegion(_env, arr_conv_8, 0, arr_conv_8_ref.datalen, arr_conv_8_ref.data); + arr_conv_8_ref.data_is_owned = true; + _res_constr.data[i] = arr_conv_8_ref; } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_channel_announcement_meth, msg_ref); - LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)ret; - FREE((void*)ret); - return ret_conv; + CVec_TransactionZ_free(_res_constr); } -LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) { - LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKChannelUpdate msg_var = *msg; - if (msg->inner != NULL) - msg_var = ChannelUpdate_clone(msg); - CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long msg_ref = (long)msg_var.inner; - if (msg_var.is_owned) { - msg_ref |= 1; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)_res; + FREE((void*)_res); + C2Tuple_u32TxOutZ_free(_res_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv * _env, jclass _b, jint a, jlong b) { + LDKTxOut b_conv = *(LDKTxOut*)b; + FREE((void*)b); + LDKC2Tuple_u32TxOutZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_ref = C2Tuple_u32TxOutZ_new(a, b_conv); + return (long)ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_C2Tuple_u32TxOutZZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t a = 0; a < _res_constr.datalen; a++) { + long arr_conv_26 = _res_vals[a]; + LDKC2Tuple_u32TxOutZ arr_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)arr_conv_26; + FREE((void*)arr_conv_26); + _res_constr.data[a] = arr_conv_26_conv; } - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*_env)->CallLongMethod(_env, obj, j_calls->handle_channel_update_meth, msg_ref); - LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)ret; - FREE((void*)ret); - return ret_conv; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_C2Tuple_u32TxOutZZ_free(_res_constr); } -void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) { - LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - long ret_update = (long)update; - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->handle_htlc_fail_channel_update_meth, ret_update); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)_res; + FREE((void*)_res); + C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv); } -LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) { - LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - jlongArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount); - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv * _env, jclass _b, jbyteArray a, jlongArray b) { + LDKThirtyTwoBytes a_ref; + CHECK((*_env)->GetArrayLength (_env, a) == 32); + (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data); + LDKCVec_C2Tuple_u32TxOutZZ b_constr; + b_constr.datalen = (*_env)->GetArrayLength (_env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t l = 0; l < arg_constr.datalen; l++) { - long arr_conv_63 = arg_vals[l]; - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arr_conv_63; - FREE((void*)arr_conv_63); - arg_constr.data[l] = arr_conv_63_conv; + b_constr.data = NULL; + long* b_vals = (*_env)->GetLongArrayElements (_env, b, NULL); + for (size_t a = 0; a < b_constr.datalen; a++) { + long arr_conv_26 = b_vals[a]; + LDKC2Tuple_u32TxOutZ arr_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)arr_conv_26; + FREE((void*)arr_conv_26); + b_constr.data[a] = arr_conv_26_conv; } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - return arg_constr; + (*_env)->ReleaseLongArrayElements (_env, b, b_vals, 0); + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_ref = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr); + return (long)ret_ref; } -LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) { - LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray starting_point_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, starting_point_arr, 0, 33, starting_point.compressed_form); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - jlongArray arg = (*_env)->CallObjectMethod(_env, obj, j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount); - LDKCVec_NodeAnnouncementZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements"); else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t s = 0; s < arg_constr.datalen; s++) { - long arr_conv_18 = arg_vals[s]; - LDKNodeAnnouncement arr_conv_18_conv; - arr_conv_18_conv.inner = (void*)(arr_conv_18 & (~1)); - arr_conv_18_conv.is_owned = (arr_conv_18 & 1) || (arr_conv_18 == 0); - if (arr_conv_18_conv.inner != NULL) - arr_conv_18_conv = NodeAnnouncement_clone(&arr_conv_18_conv); - arg_constr.data[s] = arr_conv_18_conv; + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t u = 0; u < _res_constr.datalen; u++) { + long arr_conv_46 = _res_vals[u]; + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_conv_46_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)arr_conv_46; + FREE((void*)arr_conv_46); + _res_constr.data[u] = arr_conv_46_conv; } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - return arg_constr; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr); } -bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) { - LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jbyteArray node_id_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, node_id_arr, 0, 33, node_id.compressed_form); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallBooleanMethod(_env, obj, j_calls->should_request_full_sync_meth, node_id_arr); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)_res; + FREE((void*)_res); + C2Tuple_BlockHashChannelMonitorZ_free(_res_conv); } -static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) { - LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - JNIEnv *env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - FREE(j_calls); - } + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv * _env, jclass _b, jbyteArray a, jlong b) { + LDKThirtyTwoBytes a_ref; + CHECK((*_env)->GetArrayLength (_env, a) == 32); + (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data); + LDKChannelMonitor b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + // Warning: we may need a move here but can't clone! + LDKC2Tuple_BlockHashChannelMonitorZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_ref = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); + return (long)ret_ref; } -static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) { - LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - return (void*) this_arg; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)o; + FREE((void*)o); + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv); + return (long)ret_conv; } -static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J"); - CHECK(calls->handle_node_announcement_meth != NULL); - calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J"); - CHECK(calls->handle_channel_announcement_meth != NULL); - calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J"); - CHECK(calls->handle_channel_update_meth != NULL); - calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V"); - CHECK(calls->handle_htlc_fail_channel_update_meth != NULL); - calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)[J"); - CHECK(calls->get_next_channel_announcements_meth != NULL); - calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "([BB)[J"); - CHECK(calls->get_next_node_announcements_meth != NULL); - calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "([B)Z"); - CHECK(calls->should_request_full_sync_meth != NULL); - LDKRoutingMessageHandler ret = { - .this_arg = (void*) calls, - .handle_node_announcement = handle_node_announcement_jcall, - .handle_channel_announcement = handle_channel_announcement_jcall, - .handle_channel_update = handle_channel_update_jcall, - .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall, - .get_next_channel_announcements = get_next_channel_announcements_jcall, - .get_next_node_announcements = get_next_node_announcements_jcall, - .should_request_full_sync = should_request_full_sync_jcall, - .free = LDKRoutingMessageHandler_JCalls_free, - }; - return ret; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) { - LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *res_ptr = LDKRoutingMessageHandler_init(env, _a, o); - return (long)res_ptr; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKRoutingMessageHandler_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)_res; + FREE((void*)_res); + C2Tuple_u64u64Z_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; - LDKNodeAnnouncement msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) { + LDKC2Tuple_u64u64Z* ret_ref = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); + *ret_ref = C2Tuple_u64u64Z_new(a, b); + return (long)ret_ref; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)o; + FREE((void*)o); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; - LDKChannelAnnouncement msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; - LDKChannelUpdate msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = false; - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jobjectArray _res) { + LDKCVec_SignatureZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + _res_constr.data = NULL; + for (size_t i = 0; i < _res_constr.datalen; i++) { + jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, _res, i); + LDKSignature arr_conv_8_ref; + CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 64); + (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form); + _res_constr.data[i] = arr_conv_8_ref; + } + CVec_SignatureZ_free(_res_constr); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)_res; + FREE((void*)_res); + C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jbyteArray a, jobjectArray b) { + LDKSignature a_ref; + CHECK((*_env)->GetArrayLength (_env, a) == 64); + (*_env)->GetByteArrayRegion (_env, a, 0, 64, a_ref.compact_form); + LDKCVec_SignatureZ b_constr; + b_constr.datalen = (*_env)->GetArrayLength (_env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + b_constr.data = NULL; + for (size_t i = 0; i < b_constr.datalen; i++) { + jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, b, i); + LDKSignature arr_conv_8_ref; + CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 64); + (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form); + b_constr.data[i] = arr_conv_8_ref; + } + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_ref = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr); + return (long)ret_ref; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)o; + FREE((void*)o); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); + return (long)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)_res; + FREE((void*)_res); + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jbyteArray o) { + LDKSignature o_ref; + CHECK((*_env)->GetArrayLength (_env, o) == 64); + (*_env)->GetByteArrayRegion (_env, o, 0, 64, o_ref.compact_form); + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_ok(o_ref); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) { + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_err(); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1htlc_1fail_1channel_1update(JNIEnv * _env, jclass _b, jlong this_arg, jlong update) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; - LDKHTLCFailChannelUpdate* update_conv = (LDKHTLCFailChannelUpdate*)update; - (this_arg_conv->handle_htlc_fail_channel_update)(this_arg_conv->this_arg, update_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)_res; + FREE((void*)_res); + CResult_SignatureNoneZ_free(_res_conv); } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1channel_1announcements(JNIEnv * _env, jclass _b, jlong this_arg, jlong starting_point, jbyte batch_amount) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount); - jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen); - jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); - for (size_t l = 0; l < ret_var.datalen; l++) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arr_conv_63_ref = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); - *arr_conv_63_ref = ret_var.data[l]; - ret_arr_ptr[l] = (long)arr_conv_63_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jobjectArray o) { + LDKCVec_SignatureZ o_constr; + o_constr.datalen = (*_env)->GetArrayLength (_env, o); + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + o_constr.data = NULL; + for (size_t i = 0; i < o_constr.datalen; i++) { + jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, o, i); + LDKSignature arr_conv_8_ref; + CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 64); + (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form); + o_constr.data[i] = arr_conv_8_ref; } - (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(ret_var); - return ret_arr; + LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr); + return (long)ret_conv; } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1node_1announcements(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray starting_point, jbyte batch_amount) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; - LDKPublicKey starting_point_ref; - CHECK((*_env)->GetArrayLength (_env, starting_point) == 33); - (*_env)->GetByteArrayRegion (_env, starting_point, 0, 33, starting_point_ref.compressed_form); - LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount); - jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen); - jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); - for (size_t s = 0; s < ret_var.datalen; s++) { - LDKNodeAnnouncement arr_conv_18_var = ret_var.data[s]; - CHECK((((long)arr_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&arr_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long arr_conv_18_ref = (long)arr_conv_18_var.inner; - if (arr_conv_18_var.is_owned) { - arr_conv_18_ref |= 1; - } - ret_arr_ptr[s] = arr_conv_18_ref; - } - (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) { + LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = CResult_CVec_SignatureZNoneZ_err(); + return (long)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1should_1request_1full_1sync(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray node_id) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; - LDKPublicKey node_id_ref; - CHECK((*_env)->GetArrayLength (_env, node_id) == 33); - (*_env)->GetByteArrayRegion (_env, node_id, 0, 33, node_id_ref.compressed_form); - jboolean ret_val = (this_arg_conv->should_request_full_sync)(this_arg_conv->this_arg, node_id_ref); - return ret_val; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)_res; + FREE((void*)_res); + CResult_CVec_SignatureZNoneZ_free(_res_conv); } -typedef struct LDKSocketDescriptor_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID send_data_meth; - jmethodID disconnect_socket_meth; - jmethodID eq_meth; - jmethodID hash_meth; -} LDKSocketDescriptor_JCalls; -uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) { - LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKu8slice data_var = data; - jbyteArray data_arr = (*_env)->NewByteArray(_env, data_var.datalen); - (*_env)->SetByteArrayRegion(_env, data_arr, 0, data_var.datalen, data_var.data); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallLongMethod(_env, obj, j_calls->send_data_meth, data_arr, resume_read); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChanKeySignerDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKChannelKeys o_conv = *(LDKChannelKeys*)o; + if (o_conv.free == LDKChannelKeys_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChannelKeys_JCalls_clone(o_conv.this_arg); + } + LDKCResult_ChanKeySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChanKeySignerDecodeErrorZ), "LDKCResult_ChanKeySignerDecodeErrorZ"); + *ret_conv = CResult_ChanKeySignerDecodeErrorZ_ok(o_conv); + return (long)ret_conv; } -void disconnect_socket_jcall(void* this_arg) { - LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallVoidMethod(_env, obj, j_calls->disconnect_socket_meth); + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChanKeySignerDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_ChanKeySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChanKeySignerDecodeErrorZ), "LDKCResult_ChanKeySignerDecodeErrorZ"); + *ret_conv = CResult_ChanKeySignerDecodeErrorZ_err(e_conv); + return (long)ret_conv; } -bool eq_jcall(const void* this_arg, const LDKSocketDescriptor *other_arg) { - LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); - *other_arg_clone = SocketDescriptor_clone(other_arg); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallBooleanMethod(_env, obj, j_calls->eq_meth, (long)other_arg_clone); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChanKeySignerDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_ChanKeySignerDecodeErrorZ _res_conv = *(LDKCResult_ChanKeySignerDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_ChanKeySignerDecodeErrorZ_free(_res_conv); } -uint64_t hash_jcall(const void* this_arg) { - LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - JNIEnv *_env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&_env, JNI_VERSION_1_8) == JNI_OK); - jobject obj = (*_env)->NewLocalRef(_env, j_calls->o); - CHECK(obj != NULL); - return (*_env)->CallLongMethod(_env, obj, j_calls->hash_meth); + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKInMemoryChannelKeys o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = InMemoryChannelKeys_clone(&o_conv); + LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ"); + *ret_conv = CResult_InMemoryChannelKeysDecodeErrorZ_ok(o_conv); + return (long)ret_conv; } -static void LDKSocketDescriptor_JCalls_free(void* this_arg) { - LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - JNIEnv *env; - DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - FREE(j_calls); - } + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ"); + *ret_conv = CResult_InMemoryChannelKeysDecodeErrorZ_err(e_conv); + return (long)ret_conv; } -static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) { - LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); - return (void*) this_arg; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_InMemoryChannelKeysDecodeErrorZ _res_conv = *(LDKCResult_InMemoryChannelKeysDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_InMemoryChannelKeysDecodeErrorZ_free(_res_conv); } -static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "([BZ)J"); - CHECK(calls->send_data_meth != NULL); - calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V"); - CHECK(calls->disconnect_socket_meth != NULL); - calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z"); - CHECK(calls->eq_meth != NULL); - calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J"); - CHECK(calls->hash_meth != NULL); - LDKSocketDescriptor ret = { - .this_arg = (void*) calls, - .send_data = send_data_jcall, - .disconnect_socket = disconnect_socket_jcall, - .eq = eq_jcall, - .hash = hash_jcall, - .clone = LDKSocketDescriptor_JCalls_clone, - .free = LDKSocketDescriptor_JCalls_free, - }; - return ret; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKTxOut o_conv = *(LDKTxOut*)o; + FREE((void*)o); + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv); + return (long)ret_conv; } -JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) { - LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); - *res_ptr = LDKSocketDescriptor_init(env, _a, o); - return (long)res_ptr; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv * _env, jclass _b, jclass e) { + LDKAccessError e_conv = LDKAccessError_from_java(_env, e); + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKSocketDescriptor_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)_res; + FREE((void*)_res); + CResult_TxOutAccessErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray data, jboolean resume_read) { - LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; - LDKu8slice data_ref; - data_ref.datalen = (*_env)->GetArrayLength (_env, data); - data_ref.data = (*_env)->GetByteArrayElements (_env, data, NULL); - jlong ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read); - (*_env)->ReleaseByteArrayElements(_env, data, (int8_t*)data_ref.data, 0); - return ret_val; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) { + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_ok(); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; - (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKAPIError e_conv = *(LDKAPIError*)e; + FREE((void*)e); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; - jlong ret_val = (this_arg_conv->hash)(this_arg_conv->this_arg); - return ret_val; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)_res; + FREE((void*)_res); + CResult_NoneAPIErrorZ_free(_res_conv); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_PublicKey *vec = (LDKCVecTempl_PublicKey*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKPublicKey)); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_ChannelDetailsZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t q = 0; q < _res_constr.datalen; q++) { + long arr_conv_16 = _res_vals[q]; + LDKChannelDetails arr_conv_16_conv; + arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1)); + arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0); + _res_constr.data[q] = arr_conv_16_conv; + } + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_ChannelDetailsZ_free(_res_constr); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) { + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_ok(); + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg; - CHECK(val->result_ok); - LDKCVecTempl_u8 res_var = (*val->contents.result); - jbyteArray res_arr = (*_env)->NewByteArray(_env, res_var.datalen); - (*_env)->SetByteArrayRegion(_env, res_arr, 0, res_var.datalen, res_var.data); - return res_arr; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKPaymentSendFailure e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg; - CHECK(!val->result_ok); - LDKPeerHandleError err_var = (*val->contents.err); - CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long err_ref = (long)err_var.inner & ~1; - return err_ref; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)_res; + FREE((void*)_res); + CResult_NonePaymentSendFailureZ_free(_res_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_NetAddressZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t m = 0; m < _res_constr.datalen; m++) { + long arr_conv_12 = _res_vals[m]; + LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)arr_conv_12; + FREE((void*)arr_conv_12); + _res_constr.data[m] = arr_conv_12_conv; + } + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_NetAddressZ_free(_res_constr); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)arg; - CHECK(val->result_ok); - return *val->contents.result; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_ChannelMonitorZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t q = 0; q < _res_constr.datalen; q++) { + long arr_conv_16 = _res_vals[q]; + LDKChannelMonitor arr_conv_16_conv; + arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1)); + arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0); + _res_constr.data[q] = arr_conv_16_conv; + } + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_ChannelMonitorZ_free(_res_constr); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)arg; - CHECK(!val->result_ok); - LDKPeerHandleError err_var = (*val->contents.err); - CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long err_ref = (long)err_var.inner & ~1; - return err_ref; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)_res; + FREE((void*)_res); + C2Tuple_BlockHashChannelManagerZ_free(_res_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv * _env, jclass _b, jbyteArray a, jlong b) { + LDKThirtyTwoBytes a_ref; + CHECK((*_env)->GetArrayLength (_env, a) == 32); + (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data); + LDKChannelManager b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + // Warning: we may need a move here but can't clone! + LDKC2Tuple_BlockHashChannelManagerZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); + *ret_ref = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); + return (long)ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_SecretKeySecpErrorZ *val = (LDKCResult_SecretKeySecpErrorZ*)arg; - CHECK(val->result_ok); - jbyteArray res_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, res_arr, 0, 32, (*val->contents.result).bytes); - return res_arr; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)o; + FREE((void*)o); + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv); + return (long)ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_SecretKeySecpErrorZ *val = (LDKCResult_SecretKeySecpErrorZ*)arg; - CHECK(!val->result_ok); - jclass err_conv = LDKSecp256k1Error_to_java(_env, (*val->contents.err)); - return err_conv; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_PublicKeySecpErrorZ *val = (LDKCResult_PublicKeySecpErrorZ*)arg; - CHECK(val->result_ok); - jbyteArray res_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, res_arr, 0, 33, (*val->contents.result).compressed_form); - return res_arr; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKNetAddress o_conv = *(LDKNetAddress*)o; + FREE((void*)o); + LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z"); + *ret_conv = CResult_NetAddressu8Z_ok(o_conv); + return (long)ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_PublicKeySecpErrorZ *val = (LDKCResult_PublicKeySecpErrorZ*)arg; - CHECK(!val->result_ok); - jclass err_conv = LDKSecp256k1Error_to_java(_env, (*val->contents.err)); - return err_conv; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1err(JNIEnv * _env, jclass _b, jbyte e) { + LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z"); + *ret_conv = CResult_NetAddressu8Z_err(e); + return (long)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)_res; + FREE((void*)_res); + CResult_NetAddressu8Z_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_TxCreationKeysSecpErrorZ *val = (LDKCResult_TxCreationKeysSecpErrorZ*)arg; - CHECK(val->result_ok); - LDKTxCreationKeys res_var = (*val->contents.result); - CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long res_ref = (long)res_var.inner & ~1; - return res_ref; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)o; + FREE((void*)o); + LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ"); + *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o_conv); + return (long)ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_TxCreationKeysSecpErrorZ *val = (LDKCResult_TxCreationKeysSecpErrorZ*)arg; - CHECK(!val->result_ok); - jclass err_conv = LDKSecp256k1Error_to_java(_env, (*val->contents.err)); - return err_conv; + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ"); + *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature *vec = (LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature)); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature *ret = MALLOC(sizeof(LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature), "LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature) * ret->datalen, "LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKC2TupleTempl_HTLCOutputInCommitment__Signature arr_elem_conv = *(LDKC2TupleTempl_HTLCOutputInCommitment__Signature*)arr_elem; - FREE((void*)arr_elem); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_u64Z _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(jlong), "LDKCVec_u64Z Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t g = 0; g < _res_constr.datalen; g++) { + long arr_conv_6 = _res_vals[g]; + _res_constr.data[g] = arr_conv_6; } - return (long)ret; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_u64Z_free(_res_constr); } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_RouteHop *vec = (LDKCVecTempl_RouteHop*)ptr; - jlongArray ret = (*env)->NewLongArray(env, vec->datalen); - jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); - for (size_t i = 0; i < vec->datalen; i++) { - CHECK((((long)vec->data[i].inner) & 1) == 0); - ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_UpdateAddHTLCZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t p = 0; p < _res_constr.datalen; p++) { + long arr_conv_15 = _res_vals[p]; + LDKUpdateAddHTLC arr_conv_15_conv; + arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1)); + arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0); + _res_constr.data[p] = arr_conv_15_conv; } - (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); - return ret; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_UpdateAddHTLCZ_free(_res_constr); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_RouteHop *ret = MALLOC(sizeof(LDKCVecTempl_RouteHop), "LDKCVecTempl_RouteHop"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHop) * ret->datalen, "LDKCVecTempl_RouteHop Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKRouteHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - if (arr_elem_conv.inner != NULL) - arr_elem_conv = RouteHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_UpdateFulfillHTLCZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t t = 0; t < _res_constr.datalen; t++) { + long arr_conv_19 = _res_vals[t]; + LDKUpdateFulfillHTLC arr_conv_19_conv; + arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1)); + arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0); + _res_constr.data[t] = arr_conv_19_conv; } - return (long)ret; -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_CVecTempl_RouteHop *vec = (LDKCVecTempl_CVecTempl_RouteHop*)ptr; - return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKCVecTempl_RouteHop)); -} -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { - return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1ok (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)arg; - CHECK(val->result_ok); - LDKRoute res_var = (*val->contents.result); - CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long res_ref = (long)res_var.inner & ~1; - return res_ref; -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1err (JNIEnv * _env, jclass _a, jlong arg) { - LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)arg; - CHECK(!val->result_ok); - LDKLightningError err_var = (*val->contents.err); - CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - long err_ref = (long)err_var.inner & ~1; - return err_ref; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_UpdateFulfillHTLCZ_free(_res_constr); } -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { - LDKCVecTempl_RouteHint *vec = (LDKCVecTempl_RouteHint*)ptr; - jlongArray ret = (*env)->NewLongArray(env, vec->datalen); - jlong *ret_elems = (*env)->GetPrimitiveArrayCritical(env, ret, NULL); - for (size_t i = 0; i < vec->datalen; i++) { - CHECK((((long)vec->data[i].inner) & 1) == 0); - ret_elems[i] = (long)vec->data[i].inner | (vec->data[i].is_owned ? 1 : 0); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_UpdateFailHTLCZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t q = 0; q < _res_constr.datalen; q++) { + long arr_conv_16 = _res_vals[q]; + LDKUpdateFailHTLC arr_conv_16_conv; + arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1)); + arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0); + _res_constr.data[q] = arr_conv_16_conv; } - (*env)->ReleasePrimitiveArrayCritical(env, ret, ret_elems, 0); - return ret; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_UpdateFailHTLCZ_free(_res_constr); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1new(JNIEnv *env, jclass _b, jlongArray elems){ - LDKCVecTempl_RouteHint *ret = MALLOC(sizeof(LDKCVecTempl_RouteHint), "LDKCVecTempl_RouteHint"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVecTempl_RouteHint Data"); - jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - jlong arr_elem = java_elems[i]; - LDKRouteHint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - if (arr_elem_conv.inner != NULL) - arr_elem_conv = RouteHint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_UpdateFailMalformedHTLCZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t z = 0; z < _res_constr.datalen; z++) { + long arr_conv_25 = _res_vals[z]; + LDKUpdateFailMalformedHTLC arr_conv_25_conv; + arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1)); + arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0); + _res_constr.data[z] = arr_conv_25_conv; } - return (long)ret; + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_UpdateFailMalformedHTLCZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg; - FREE((void*)arg); - C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv); + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean o) { + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_ok(o); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg; - FREE((void*)arg); - C2Tuple_OutPointScriptZ_free(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKLightningError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg; - FREE((void*)arg); - C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)_res; + FREE((void*)_res); + CResult_boolLightningErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKC2Tuple_TxidCVec_TxOutZZ arg_conv = *(LDKC2Tuple_TxidCVec_TxOutZZ*)arg; - FREE((void*)arg); - C2Tuple_TxidCVec_TxOutZZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)_res; + FREE((void*)_res); + C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg; - FREE((void*)arg); - C2Tuple_u64u64Z_free(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) { + LDKChannelAnnouncement a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + if (a_conv.inner != NULL) + a_conv = ChannelAnnouncement_clone(&a_conv); + LDKChannelUpdate b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + if (b_conv.inner != NULL) + b_conv = ChannelUpdate_clone(&b_conv); + LDKChannelUpdate c_conv; + c_conv.inner = (void*)(c & (~1)); + c_conv.is_owned = (c & 1) || (c == 0); + if (c_conv.inner != NULL) + c_conv = ChannelUpdate_clone(&c_conv); + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_ref = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_ref = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); + return (long)ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKC2Tuple_usizeTransactionZ arg_conv = *(LDKC2Tuple_usizeTransactionZ*)arg; - FREE((void*)arg); - C2Tuple_usizeTransactionZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t l = 0; l < _res_constr.datalen; l++) { + long arr_conv_63 = _res_vals[l]; + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arr_conv_63; + FREE((void*)arr_conv_63); + _res_constr.data[l] = arr_conv_63_conv; + } + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg; - FREE((void*)arg); - C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_NodeAnnouncementZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t s = 0; s < _res_constr.datalen; s++) { + long arr_conv_18 = _res_vals[s]; + LDKNodeAnnouncement arr_conv_18_conv; + arr_conv_18_conv.inner = (void*)(arr_conv_18 & (~1)); + arr_conv_18_conv.is_owned = (arr_conv_18 & 1) || (arr_conv_18 == 0); + _res_constr.data[s] = arr_conv_18_conv; + } + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_NodeAnnouncementZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg; - FREE((void*)arg); - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok(JNIEnv * _env, jclass _b) { + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_ok(); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) { - LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg; - FREE((void*)arg); - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKLightningError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg; - FREE((void*)arg); - CResult_CVec_SignatureZNoneZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)_res; + FREE((void*)_res); + CResult_NoneLightningErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jobjectArray arg) { - LDKCVec_SignatureZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - arg_constr.data = NULL; - for (size_t i = 0; i < arg_constr.datalen; i++) { - jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, arg, i); - LDKSignature arr_conv_8_ref; - CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 64); - (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form); - arg_constr.data[i] = arr_conv_8_ref; - } - LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); - *ret_conv = CResult_CVec_SignatureZNoneZ_ok(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKChannelReestablish o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = ChannelReestablish_clone(&o_conv); + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) { - LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg; - FREE((void*)arg); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg; - FREE((void*)arg); - CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_ChannelReestablishDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jbyteArray arg) { - LDKCVec_u8Z arg_ref; - arg_ref.datalen = (*_env)->GetArrayLength (_env, arg); - arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*_env)->GetByteArrayRegion(_env, arg, 0, arg_ref.datalen, arg_ref.data); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKInit o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = Init_clone(&o_conv); + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) { - LDKAPIError arg_conv = *(LDKAPIError*)arg; - FREE((void*)arg); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg; - FREE((void*)arg); - CResult_NoneAPIErrorZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_InitDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jclass arg) { - LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg; - FREE((void*)arg); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKPing o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = Ping_clone(&o_conv); + LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg; - FREE((void*)arg); - CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv); -} - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) { - LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg; - FREE((void*)arg); - LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); - *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = CResult_PingDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg; - FREE((void*)arg); - CResult_NoneMonitorUpdateErrorZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_PingDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) { - LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg; - FREE((void*)arg); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKPong o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = Pong_clone(&o_conv); + LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg; - FREE((void*)arg); - CResult_NonePaymentSendFailureZ_free(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = CResult_PongDecodeErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) { - LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg; - FREE((void*)arg); - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = CResult_NonePeerHandleErrorZ_err(arg_conv); - return (long)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_PongDecodeErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg; - FREE((void*)arg); - CResult_NonePeerHandleErrorZ_free(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKUnsignedChannelAnnouncement o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = UnsignedChannelAnnouncement_clone(&o_conv); + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) { - LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg; - FREE((void*)arg); - LDKCResult_PublicKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ"); - *ret_conv = CResult_PublicKeySecpErrorZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_PublicKeySecpErrorZ arg_conv = *(LDKCResult_PublicKeySecpErrorZ*)arg; - FREE((void*)arg); - CResult_PublicKeySecpErrorZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jbyteArray arg) { - LDKPublicKey arg_ref; - CHECK((*_env)->GetArrayLength (_env, arg) == 33); - (*_env)->GetByteArrayRegion (_env, arg, 0, 33, arg_ref.compressed_form); - LDKCResult_PublicKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ"); - *ret_conv = CResult_PublicKeySecpErrorZ_ok(arg_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKUnsignedChannelUpdate o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = UnsignedChannelUpdate_clone(&o_conv); + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) { - LDKLightningError arg_conv = *(LDKLightningError*)arg; - FREE((void*)arg); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = CResult_RouteLightningErrorZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg; - FREE((void*)arg); - CResult_RouteLightningErrorZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) { - LDKRoute arg_conv = *(LDKRoute*)arg; - FREE((void*)arg); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = CResult_RouteLightningErrorZ_ok(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKErrorMessage o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = ErrorMessage_clone(&o_conv); + LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) { - LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg; - FREE((void*)arg); - LDKCResult_SecretKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ"); - *ret_conv = CResult_SecretKeySecpErrorZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_SecretKeySecpErrorZ arg_conv = *(LDKCResult_SecretKeySecpErrorZ*)arg; - FREE((void*)arg); - CResult_SecretKeySecpErrorZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_ErrorMessageDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jbyteArray arg) { - LDKSecretKey arg_ref; - CHECK((*_env)->GetArrayLength (_env, arg) == 32); - (*_env)->GetByteArrayRegion (_env, arg, 0, 32, arg_ref.bytes); - LDKCResult_SecretKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ"); - *ret_conv = CResult_SecretKeySecpErrorZ_ok(arg_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKUnsignedNodeAnnouncement o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = UnsignedNodeAnnouncement_clone(&o_conv); + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg; - FREE((void*)arg); - CResult_SignatureNoneZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jbyteArray arg) { - LDKSignature arg_ref; - CHECK((*_env)->GetArrayLength (_env, arg) == 64); - (*_env)->GetByteArrayRegion (_env, arg, 0, 64, arg_ref.compact_form); - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = CResult_SignatureNoneZ_ok(arg_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKQueryShortChannelIds o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = QueryShortChannelIds_clone(&o_conv); + LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) { - LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg; - FREE((void*)arg); - LDKCResult_TxCreationKeysSecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ"); - *ret_conv = CResult_TxCreationKeysSecpErrorZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg; - FREE((void*)arg); - CResult_TxCreationKeysSecpErrorZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) { - LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg; - FREE((void*)arg); - LDKCResult_TxCreationKeysSecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ"); - *ret_conv = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKReplyShortChannelIdsEnd o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = ReplyShortChannelIdsEnd_clone(&o_conv); + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) { - LDKAccessError arg_conv = *(LDKAccessError*)arg; - FREE((void*)arg); - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = CResult_TxOutAccessErrorZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_TxOutAccessErrorZ arg_conv = *(LDKCResult_TxOutAccessErrorZ*)arg; - FREE((void*)arg); - CResult_TxOutAccessErrorZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) { - LDKTxOut arg_conv = *(LDKTxOut*)arg; - FREE((void*)arg); - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = CResult_TxOutAccessErrorZ_ok(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKQueryChannelRange o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = QueryChannelRange_clone(&o_conv); + LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) { - LDKLightningError arg_conv = *(LDKLightningError*)arg; - FREE((void*)arg); - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = CResult_boolLightningErrorZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg; - FREE((void*)arg); - CResult_boolLightningErrorZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) { - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = CResult_boolLightningErrorZ_ok(arg); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKReplyChannelRange o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = ReplyChannelRange_clone(&o_conv); + LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) { - LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg; - FREE((void*)arg); - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_err(arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) { - LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg; - FREE((void*)arg); - CResult_boolPeerHandleErrorZ_free(arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) { - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_ok(arg); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKGossipTimestampFilter o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = GossipTimestampFilter_clone(&o_conv); + LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t q = 0; q < arg_constr.datalen; q++) { - long arr_conv_42 = arg_vals[q]; - LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arr_conv_42_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arr_conv_42; - FREE((void*)arr_conv_42); - arg_constr.data[q] = arr_conv_42_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1TxOutZZZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_C2Tuple_TxidCVec_TxOutZZZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKCVec_C2Tuple_TxidCVec_TxOutZZZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t b = 0; b < arg_constr.datalen; b++) { - long arr_conv_27 = arg_vals[b]; - LDKC2Tuple_TxidCVec_TxOutZZ arr_conv_27_conv = *(LDKC2Tuple_TxidCVec_TxOutZZ*)arr_conv_27; - FREE((void*)arr_conv_27); - arg_constr.data[b] = arr_conv_27_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_C2Tuple_TxidCVec_TxOutZZZ_free(arg_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_C2Tuple_usizeTransactionZZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jobjectArray _res) { + LDKCVec_PublicKeyZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t y = 0; y < arg_constr.datalen; y++) { - long arr_conv_24 = arg_vals[y]; - LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_24; - FREE((void*)arr_conv_24); - arg_constr.data[y] = arr_conv_24_conv; + _res_constr.data = NULL; + for (size_t i = 0; i < _res_constr.datalen; i++) { + jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, _res, i); + LDKPublicKey arr_conv_8_ref; + CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 33); + (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 33, arr_conv_8_ref.compressed_form); + _res_constr.data[i] = arr_conv_8_ref; } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_C2Tuple_usizeTransactionZZ_free(arg_constr); + CVec_PublicKeyZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t l = 0; l < arg_constr.datalen; l++) { - long arr_conv_63 = arg_vals[l]; - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arr_conv_63; - FREE((void*)arr_conv_63); - arg_constr.data[l] = arr_conv_63_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jbyteArray _res) { + LDKCVec_u8Z _res_ref; + _res_ref.datalen = (*_env)->GetArrayLength (_env, _res); + _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); + (*_env)->GetByteArrayRegion(_env, _res, 0, _res_ref.datalen, _res_ref.data); + CVec_u8Z_free(_res_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jobjectArray arg) { - LDKCVec_CVec_RouteHopZZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); - else - arg_constr.data = NULL; - for (size_t m = 0; m < arg_constr.datalen; m++) { - jobject arr_conv_12 = (*_env)->GetObjectArrayElement(_env, arg, m); - LDKCVec_RouteHopZ arr_conv_12_constr; - arr_conv_12_constr.datalen = (*_env)->GetArrayLength (_env, arr_conv_12); - if (arr_conv_12_constr.datalen > 0) - arr_conv_12_constr.data = MALLOC(arr_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - arr_conv_12_constr.data = NULL; - long* arr_conv_12_vals = (*_env)->GetLongArrayElements (_env, arr_conv_12, NULL); - for (size_t k = 0; k < arr_conv_12_constr.datalen; k++) { - long arr_conv_10 = arr_conv_12_vals[k]; - LDKRouteHop arr_conv_10_conv; - arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1)); - arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0); - arr_conv_12_constr.data[k] = arr_conv_10_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arr_conv_12, arr_conv_12_vals, 0); - arg_constr.data[m] = arr_conv_12_constr; - } - CVec_CVec_RouteHopZZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jbyteArray o) { + LDKCVec_u8Z o_ref; + o_ref.datalen = (*_env)->GetArrayLength (_env, o); + o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes"); + (*_env)->GetByteArrayRegion(_env, o, 0, o_ref.datalen, o_ref.data); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_ChannelDetailsZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t q = 0; q < arg_constr.datalen; q++) { - long arr_conv_16 = arg_vals[q]; - LDKChannelDetails arr_conv_16_conv; - arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1)); - arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0); - arg_constr.data[q] = arr_conv_16_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_ChannelDetailsZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKPeerHandleError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_ChannelMonitorZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t q = 0; q < arg_constr.datalen; q++) { - long arr_conv_16 = arg_vals[q]; - LDKChannelMonitor arr_conv_16_conv; - arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1)); - arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0); - arg_constr.data[q] = arr_conv_16_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_ChannelMonitorZ_free(arg_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)_res; + FREE((void*)_res); + CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_EventZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t h = 0; h < arg_constr.datalen; h++) { - long arr_conv_7 = arg_vals[h]; - LDKEvent arr_conv_7_conv = *(LDKEvent*)arr_conv_7; - FREE((void*)arr_conv_7); - arg_constr.data[h] = arr_conv_7_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_EventZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) { + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_ok(); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_HTLCOutputInCommitmentZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKHTLCOutputInCommitment), "LDKCVec_HTLCOutputInCommitmentZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t y = 0; y < arg_constr.datalen; y++) { - long arr_conv_24 = arg_vals[y]; - LDKHTLCOutputInCommitment arr_conv_24_conv; - arr_conv_24_conv.inner = (void*)(arr_conv_24 & (~1)); - arr_conv_24_conv.is_owned = (arr_conv_24 & 1) || (arr_conv_24 == 0); - arg_constr.data[y] = arr_conv_24_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_HTLCOutputInCommitmentZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKPeerHandleError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_MessageSendEventZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t s = 0; s < arg_constr.datalen; s++) { - long arr_conv_18 = arg_vals[s]; - LDKMessageSendEvent arr_conv_18_conv = *(LDKMessageSendEvent*)arr_conv_18; - FREE((void*)arr_conv_18); - arg_constr.data[s] = arr_conv_18_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_MessageSendEventZ_free(arg_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)_res; + FREE((void*)_res); + CResult_NonePeerHandleErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_MonitorEventZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t o = 0; o < arg_constr.datalen; o++) { - long arr_conv_14 = arg_vals[o]; - LDKMonitorEvent arr_conv_14_conv; - arr_conv_14_conv.inner = (void*)(arr_conv_14 & (~1)); - arr_conv_14_conv.is_owned = (arr_conv_14 & 1) || (arr_conv_14 == 0); - arg_constr.data[o] = arr_conv_14_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_MonitorEventZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean o) { + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_ok(o); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_NetAddressZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t m = 0; m < arg_constr.datalen; m++) { - long arr_conv_12 = arg_vals[m]; - LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)arr_conv_12; - FREE((void*)arr_conv_12); - arg_constr.data[m] = arr_conv_12_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_NetAddressZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKPeerHandleError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_NodeAnnouncementZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t s = 0; s < arg_constr.datalen; s++) { - long arr_conv_18 = arg_vals[s]; - LDKNodeAnnouncement arr_conv_18_conv; - arr_conv_18_conv.inner = (void*)(arr_conv_18 & (~1)); - arr_conv_18_conv.is_owned = (arr_conv_18 & 1) || (arr_conv_18 == 0); - arg_constr.data[s] = arr_conv_18_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_NodeAnnouncementZ_free(arg_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)_res; + FREE((void*)_res); + CResult_boolPeerHandleErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jobjectArray arg) { - LDKCVec_PublicKeyZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - arg_constr.data = NULL; - for (size_t i = 0; i < arg_constr.datalen; i++) { - jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, arg, i); - LDKPublicKey arr_conv_8_ref; - CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 33); - (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 33, arr_conv_8_ref.compressed_form); - arg_constr.data[i] = arr_conv_8_ref; - } - CVec_PublicKeyZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jbyteArray o) { + LDKSecretKey o_ref; + CHECK((*_env)->GetArrayLength (_env, o) == 32); + (*_env)->GetByteArrayRegion (_env, o, 0, 32, o_ref.bytes); + LDKCResult_SecretKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ"); + *ret_conv = CResult_SecretKeySecpErrorZ_ok(o_ref); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_RouteHintZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t l = 0; l < arg_constr.datalen; l++) { - long arr_conv_11 = arg_vals[l]; - LDKRouteHint arr_conv_11_conv; - arr_conv_11_conv.inner = (void*)(arr_conv_11 & (~1)); - arr_conv_11_conv.is_owned = (arr_conv_11 & 1) || (arr_conv_11 == 0); - arg_constr.data[l] = arr_conv_11_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_RouteHintZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(_env, e); + LDKCResult_SecretKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ"); + *ret_conv = CResult_SecretKeySecpErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_RouteHopZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t k = 0; k < arg_constr.datalen; k++) { - long arr_conv_10 = arg_vals[k]; - LDKRouteHop arr_conv_10_conv; - arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1)); - arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0); - arg_constr.data[k] = arr_conv_10_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_RouteHopZ_free(arg_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_SecretKeySecpErrorZ _res_conv = *(LDKCResult_SecretKeySecpErrorZ*)_res; + FREE((void*)_res); + CResult_SecretKeySecpErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jobjectArray arg) { - LDKCVec_SignatureZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - arg_constr.data = NULL; - for (size_t i = 0; i < arg_constr.datalen; i++) { - jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, arg, i); - LDKSignature arr_conv_8_ref; - CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 64); - (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form); - arg_constr.data[i] = arr_conv_8_ref; - } - CVec_SignatureZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jbyteArray o) { + LDKPublicKey o_ref; + CHECK((*_env)->GetArrayLength (_env, o) == 33); + (*_env)->GetByteArrayRegion (_env, o, 0, 33, o_ref.compressed_form); + LDKCResult_PublicKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ"); + *ret_conv = CResult_PublicKeySecpErrorZ_ok(o_ref); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_SpendableOutputDescriptorZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t b = 0; b < arg_constr.datalen; b++) { - long arr_conv_27 = arg_vals[b]; - LDKSpendableOutputDescriptor arr_conv_27_conv = *(LDKSpendableOutputDescriptor*)arr_conv_27; - FREE((void*)arr_conv_27); - arg_constr.data[b] = arr_conv_27_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_SpendableOutputDescriptorZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(_env, e); + LDKCResult_PublicKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ"); + *ret_conv = CResult_PublicKeySecpErrorZ_err(e_conv); + return (long)ret_conv; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jobjectArray arg) { - LDKCVec_TransactionZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements"); - else - arg_constr.data = NULL; - for (size_t i = 0; i < arg_constr.datalen; i++) { - jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, arg, i); - LDKTransaction arr_conv_8_ref; - arr_conv_8_ref.datalen = (*_env)->GetArrayLength (_env, arr_conv_8); - arr_conv_8_ref.data = MALLOC(arr_conv_8_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, arr_conv_8, 0, arr_conv_8_ref.datalen, arr_conv_8_ref.data); - arr_conv_8_ref.data_is_owned = true; - arg_constr.data[i] = arr_conv_8_ref; - } - CVec_TransactionZ_free(arg_constr); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_PublicKeySecpErrorZ _res_conv = *(LDKCResult_PublicKeySecpErrorZ*)_res; + FREE((void*)_res); + CResult_PublicKeySecpErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_TxOutZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t h = 0; h < arg_constr.datalen; h++) { - long arr_conv_7 = arg_vals[h]; - LDKTxOut arr_conv_7_conv = *(LDKTxOut*)arr_conv_7; - FREE((void*)arr_conv_7); - arg_constr.data[h] = arr_conv_7_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_TxOutZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKTxCreationKeys o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = TxCreationKeys_clone(&o_conv); + LDKCResult_TxCreationKeysSecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ"); + *ret_conv = CResult_TxCreationKeysSecpErrorZ_ok(o_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_UpdateAddHTLCZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t p = 0; p < arg_constr.datalen; p++) { - long arr_conv_15 = arg_vals[p]; - LDKUpdateAddHTLC arr_conv_15_conv; - arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1)); - arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0); - arg_constr.data[p] = arr_conv_15_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_UpdateAddHTLCZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(_env, e); + LDKCResult_TxCreationKeysSecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ"); + *ret_conv = CResult_TxCreationKeysSecpErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_UpdateFailHTLCZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t q = 0; q < arg_constr.datalen; q++) { - long arr_conv_16 = arg_vals[q]; - LDKUpdateFailHTLC arr_conv_16_conv; - arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1)); - arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0); - arg_constr.data[q] = arr_conv_16_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_UpdateFailHTLCZ_free(arg_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_TxCreationKeysSecpErrorZ _res_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)_res; + FREE((void*)_res); + CResult_TxCreationKeysSecpErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_UpdateFailMalformedHTLCZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); - else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t z = 0; z < arg_constr.datalen; z++) { - long arr_conv_25 = arg_vals[z]; - LDKUpdateFailMalformedHTLC arr_conv_25_conv; - arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1)); - arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0); - arg_constr.data[z] = arr_conv_25_conv; - } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_UpdateFailMalformedHTLCZ_free(arg_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKTrustedCommitmentTransaction o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_UpdateFulfillHTLCZ arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1err(JNIEnv * _env, jclass _b) { + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err(); + return (long)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)_res; + FREE((void*)_res); + CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_RouteHopZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t t = 0; t < arg_constr.datalen; t++) { - long arr_conv_19 = arg_vals[t]; - LDKUpdateFulfillHTLC arr_conv_19_conv; - arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1)); - arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0); - arg_constr.data[t] = arr_conv_19_conv; + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t k = 0; k < _res_constr.datalen; k++) { + long arr_conv_10 = _res_vals[k]; + LDKRouteHop arr_conv_10_conv; + arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1)); + arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0); + _res_constr.data[k] = arr_conv_10_conv; } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_UpdateFulfillHTLCZ_free(arg_constr); + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_RouteHopZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlongArray arg) { - LDKCVec_u64Z arg_constr; - arg_constr.datalen = (*_env)->GetArrayLength (_env, arg); - if (arg_constr.datalen > 0) - arg_constr.data = MALLOC(arg_constr.datalen * sizeof(jlong), "LDKCVec_u64Z Elements"); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jobjectArray _res) { + LDKCVec_CVec_RouteHopZZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); else - arg_constr.data = NULL; - long* arg_vals = (*_env)->GetLongArrayElements (_env, arg, NULL); - for (size_t g = 0; g < arg_constr.datalen; g++) { - long arr_conv_6 = arg_vals[g]; - arg_constr.data[g] = arr_conv_6; + _res_constr.data = NULL; + for (size_t m = 0; m < _res_constr.datalen; m++) { + jobject arr_conv_12 = (*_env)->GetObjectArrayElement(_env, _res, m); + LDKCVec_RouteHopZ arr_conv_12_constr; + arr_conv_12_constr.datalen = (*_env)->GetArrayLength (_env, arr_conv_12); + if (arr_conv_12_constr.datalen > 0) + arr_conv_12_constr.data = MALLOC(arr_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + arr_conv_12_constr.data = NULL; + long* arr_conv_12_vals = (*_env)->GetLongArrayElements (_env, arr_conv_12, NULL); + for (size_t k = 0; k < arr_conv_12_constr.datalen; k++) { + long arr_conv_10 = arr_conv_12_vals[k]; + LDKRouteHop arr_conv_10_conv; + arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1)); + arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0); + arr_conv_12_constr.data[k] = arr_conv_10_conv; + } + (*_env)->ReleaseLongArrayElements (_env, arr_conv_12, arr_conv_12_vals, 0); + _res_constr.data[m] = arr_conv_12_constr; } - (*_env)->ReleaseLongArrayElements (_env, arg, arg_vals, 0); - CVec_u64Z_free(arg_constr); + CVec_CVec_RouteHopZZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jbyteArray arg) { - LDKCVec_u8Z arg_ref; - arg_ref.datalen = (*_env)->GetArrayLength (_env, arg); - arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*_env)->GetByteArrayRegion(_env, arg, 0, arg_ref.datalen, arg_ref.data); - CVec_u8Z_free(arg_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKRoute o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = Route_clone(&o_conv); + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jbyteArray _res) { - LDKTransaction _res_ref; - _res_ref.datalen = (*_env)->GetArrayLength (_env, _res); - _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, _res, 0, _res_ref.datalen, _res_ref.data); - _res_ref.data_is_owned = true; - Transaction_free(_res_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) { - LDKTxOut _res_conv = *(LDKTxOut*)_res; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)_res; FREE((void*)_res); - TxOut_free(_res_conv); + CResult_RouteDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jbyteArray b) { - LDKTransaction b_ref; - b_ref.datalen = (*_env)->GetArrayLength (_env, b); - b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data); - b_ref.data_is_owned = true; - LDKC2Tuple_usizeTransactionZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *ret_ref = C2Tuple_usizeTransactionZ_new(a, b_ref); - return (long)ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlongArray _res) { + LDKCVec_RouteHintZ _res_constr; + _res_constr.datalen = (*_env)->GetArrayLength (_env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); + else + _res_constr.data = NULL; + long* _res_vals = (*_env)->GetLongArrayElements (_env, _res, NULL); + for (size_t l = 0; l < _res_constr.datalen; l++) { + long arr_conv_11 = _res_vals[l]; + LDKRouteHint arr_conv_11_conv; + arr_conv_11_conv.inner = (void*)(arr_conv_11 & (~1)); + arr_conv_11_conv.is_owned = (arr_conv_11 & 1) || (arr_conv_11 == 0); + _res_constr.data[l] = arr_conv_11_conv; + } + (*_env)->ReleaseLongArrayElements (_env, _res, _res_vals, 0); + CVec_RouteHintZ_free(_res_constr); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) { - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok(); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKRoute o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = Route_clone(&o_conv); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) { - LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); - *ret_conv = CResult_NoneMonitorUpdateErrorZ_ok(); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKLightningError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jbyteArray b) { - LDKOutPoint a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - if (a_conv.inner != NULL) - a_conv = OutPoint_clone(&a_conv); - LDKCVec_u8Z b_ref; - b_ref.datalen = (*_env)->GetArrayLength (_env, b); - b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); - (*_env)->GetByteArrayRegion(_env, b, 0, b_ref.datalen, b_ref.data); - LDKC2Tuple_OutPointScriptZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); - *ret_ref = C2Tuple_OutPointScriptZ_new(a_conv, b_ref); - return (long)ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)_res; + FREE((void*)_res); + CResult_RouteLightningErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1new(JNIEnv * _env, jclass _b, jbyteArray a, jlongArray b) { - LDKThirtyTwoBytes a_ref; - CHECK((*_env)->GetArrayLength (_env, a) == 32); - (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data); - LDKCVec_TxOutZ b_constr; - b_constr.datalen = (*_env)->GetArrayLength (_env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - b_constr.data = NULL; - long* b_vals = (*_env)->GetLongArrayElements (_env, b, NULL); - for (size_t h = 0; h < b_constr.datalen; h++) { - long arr_conv_7 = b_vals[h]; - LDKTxOut arr_conv_7_conv = *(LDKTxOut*)arr_conv_7; - FREE((void*)arr_conv_7); - b_constr.data[h] = arr_conv_7_conv; - } - (*_env)->ReleaseLongArrayElements (_env, b, b_vals, 0); - LDKC2Tuple_TxidCVec_TxOutZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKC2Tuple_TxidCVec_TxOutZZ"); - *ret_ref = C2Tuple_TxidCVec_TxOutZZ_new(a_ref, b_constr); - return (long)ret_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKRoutingFees o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + if (o_conv.inner != NULL) + o_conv = RoutingFees_clone(&o_conv); + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) { - LDKC2Tuple_u64u64Z* ret_ref = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); - *ret_ref = C2Tuple_u64u64Z_new(a, b); - return (long)ret_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jbyteArray a, jobjectArray b) { - LDKSignature a_ref; - CHECK((*_env)->GetArrayLength (_env, a) == 64); - (*_env)->GetByteArrayRegion (_env, a, 0, 64, a_ref.compact_form); - LDKCVec_SignatureZ b_constr; - b_constr.datalen = (*_env)->GetArrayLength (_env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - b_constr.data = NULL; - for (size_t i = 0; i < b_constr.datalen; i++) { - jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, b, i); - LDKSignature arr_conv_8_ref; - CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 64); - (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form); - b_constr.data[i] = arr_conv_8_ref; - } - LDKC2Tuple_SignatureCVec_SignatureZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); - *ret_ref = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr); - return (long)ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_RoutingFeesDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKNodeAnnouncementInfo o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) { - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = CResult_SignatureNoneZ_err(); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) { - LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); - *ret_conv = CResult_CVec_SignatureZNoneZ_err(); - return (long)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) { - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_ok(); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKNodeInfo o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) { - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_ok(); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) { - LDKChannelAnnouncement a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - if (a_conv.inner != NULL) - a_conv = ChannelAnnouncement_clone(&a_conv); - LDKChannelUpdate b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = (b & 1) || (b == 0); - if (b_conv.inner != NULL) - b_conv = ChannelUpdate_clone(&b_conv); - LDKChannelUpdate c_conv; - c_conv.inner = (void*)(c & (~1)); - c_conv.is_owned = (c & 1) || (c == 0); - if (c_conv.inner != NULL) - c_conv = ChannelUpdate_clone(&c_conv); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_ref = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); - *ret_ref = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); - return (long)ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_NodeInfoDecodeErrorZ_free(_res_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) { - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = CResult_NonePeerHandleErrorZ_ok(); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok(JNIEnv * _env, jclass _b, jlong o) { + LDKNetworkGraph o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jbyteArray b) { - LDKHTLCOutputInCommitment a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - if (a_conv.inner != NULL) - a_conv = HTLCOutputInCommitment_clone(&a_conv); - LDKSignature b_ref; - CHECK((*_env)->GetArrayLength (_env, b) == 64); - (*_env)->GetByteArrayRegion (_env, b, 0, 64, b_ref.compact_form); - LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKC2Tuple_HTLCOutputInCommitmentSignatureZ"); - *ret_ref = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_ref); - return (long)ret_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv * _env, jclass _b, jlong e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); + return (long)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv * _env, jclass _b, jlong _res) { + LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)_res; + FREE((void*)_res); + CResult_NetworkGraphDecodeErrorZ_free(_res_conv); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -5670,6 +7298,15 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv * _env, j return ret_ref; } +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKEvent* obj_conv = (LDKEvent*)obj; + LDKCVec_u8Z arg_var = Event_write(obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr; FREE((void*)this_ptr); @@ -6343,7 +7980,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnec ChainMonitor_block_disconnected(&this_arg_conv, header_ref, disconnected_height); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _env, jclass _b, jlong chain_source, jlong broadcaster, jlong logger, jlong feeest) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _env, jclass _b, jlong chain_source, jlong broadcaster, jlong logger, jlong feeest, jlong persister) { LDKFilter* chain_source_conv = (LDKFilter*)chain_source; LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster; if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { @@ -6360,7 +7997,12 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _e // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg); } - LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv); + LDKPersist persister_conv = *(LDKPersist*)persister; + if (persister_conv.free == LDKPersist_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKPersist_JCalls_clone(persister_conv.this_arg); + } + LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_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; @@ -6424,11 +8066,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1upd ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelMonitorUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = ChannelMonitorUpdate_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKChannelMonitorUpdate obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = ChannelMonitorUpdate_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); @@ -6439,15 +8081,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JN LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_read(ser_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; - } + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = ChannelMonitorUpdate_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone(JNIEnv * _env, jclass _b, jlong orig) { @@ -6538,30 +8175,29 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * ChannelMonitor_free(this_ptr_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelMonitor this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = ChannelMonitor_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKChannelMonitor obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = ChannelMonitor_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong fee_estimator, jlong logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; LDKChannelMonitorUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); - updates_conv.is_owned = (updates & 1) || (updates == 0); - if (updates_conv.inner != NULL) - updates_conv = ChannelMonitorUpdate_clone(&updates_conv); + updates_conv.is_owned = false; LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster; + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator; LDKLogger* logger_conv = (LDKLogger*)logger; LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); - *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, updates_conv, broadcaster_conv, logger_conv); + *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); return (long)ret_conv; } @@ -6613,12 +8249,12 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); for (size_t h = 0; h < ret_var.datalen; h++) { LDKEvent *arr_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *arr_conv_7_copy = Event_clone(&ret_var.data[h]); + *arr_conv_7_copy = ret_var.data[h]; long arr_conv_7_ref = (long)arr_conv_7_copy; ret_arr_ptr[h] = arr_conv_7_ref; } (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); - CVec_EventZ_free(ret_var); + FREE(ret_var.data); return ret_arr; } @@ -6636,7 +8272,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1l Transaction_free(arr_conv_8_var); (*_env)->SetObjectArrayElement(_env, ret_arr, i, arr_conv_8_arr); } - CVec_TransactionZ_free(ret_var); + FREE(ret_var.data); return ret_arr; } @@ -6677,16 +8313,16 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1c // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_clone(logger_conv.this_arg); } - LDKCVec_C2Tuple_TxidCVec_TxOutZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); jlongArray ret_arr = (*_env)->NewLongArray(_env, ret_var.datalen); jlong *ret_arr_ptr = (*_env)->GetPrimitiveArrayCritical(_env, ret_arr, NULL); - for (size_t b = 0; b < ret_var.datalen; b++) { - LDKC2Tuple_TxidCVec_TxOutZZ* arr_conv_27_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKC2Tuple_TxidCVec_TxOutZZ"); - *arr_conv_27_ref = ret_var.data[b]; - ret_arr_ptr[b] = (long)arr_conv_27_ref; + for (size_t u = 0; u < ret_var.datalen; u++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arr_conv_46_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *arr_conv_46_ref = ret_var.data[u]; + ret_arr_ptr[u] = (long)arr_conv_46_ref; } (*_env)->ReleasePrimitiveArrayCritical(_env, ret_arr, ret_arr_ptr, 0); - CVec_C2Tuple_TxidCVec_TxOutZZZ_free(ret_var); + FREE(ret_var.data); return ret_arr; } @@ -6716,6 +8352,23 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconn ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKPersist this_ptr_conv = *(LDKPersist*)this_ptr; + FREE((void*)this_ptr); + Persist_free(this_ptr_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1read(JNIEnv * _env, jclass _b, jbyteArray ser, jlong arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg; + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv); + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return (long)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -6834,6 +8487,25 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1cl return ret_ref; } +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj; + LDKCVec_u8Z arg_var = SpendableOutputDescriptor_write(obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = SpendableOutputDescriptor_read(ser_ref); + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return (long)ret_conv; +} + JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) { LDKChannelKeys* orig_conv = (LDKChannelKeys*)orig; LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys"); @@ -7049,6 +8721,42 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_ return ret_val; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1is_1outbound(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKInMemoryChannelKeys this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + jboolean ret_val = InMemoryChannelKeys_is_outbound(&this_arg_conv); + return ret_val; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1funding_1outpoint(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKInMemoryChannelKeys this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKOutPoint ret_var = InMemoryChannelKeys_funding_outpoint(&this_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 jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1channel_1parameters(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKInMemoryChannelKeys this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKChannelTransactionParameters ret_var = InMemoryChannelKeys_get_channel_parameters(&this_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 jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) { LDKInMemoryChannelKeys this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); @@ -7058,11 +8766,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1Chan return (long)ret; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKInMemoryChannelKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = InMemoryChannelKeys_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKInMemoryChannelKeys obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = InMemoryChannelKeys_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); @@ -7073,15 +8781,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNI LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKInMemoryChannelKeys ret_var = InMemoryChannelKeys_read(ser_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; - } + LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ"); + *ret_conv = InMemoryChannelKeys_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -7623,11 +9326,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMe return (long)ret; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelManager this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = ChannelManager_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKChannelManager obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = ChannelManager_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); @@ -7823,6 +9526,20 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(J return ret_ref; } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1read(JNIEnv * _env, jclass _b, jbyteArray ser, jlong arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKChannelManagerReadArgs arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = (arg & 1) || (arg == 0); + // Warning: we may need a move here but can't clone! + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); + *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return (long)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKDecodeError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -9928,6 +11645,25 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv * _e return ret_ref; } +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKNetAddress* obj_conv = (LDKNetAddress*)obj; + LDKCVec_u8Z arg_var = NetAddress_write(obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Result_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ"); + *ret_conv = Result_read(ser_ref); + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return (long)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -11057,18 +12793,183 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new( return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKGossipTimestampFilter this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + GossipTimestampFilter_free(this_ptr_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKGossipTimestampFilter orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_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 jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKGossipTimestampFilter this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKGossipTimestampFilter 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); + GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref); +} + +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKGossipTimestampFilter this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jint ret_val = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) { + LDKGossipTimestampFilter this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); +} + +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKGossipTimestampFilter this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jint ret_val = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) { + LDKGossipTimestampFilter this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jint first_timestamp_arg, jint timestamp_range_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*_env)->GetArrayLength (_env, chain_hash_arg) == 32); + (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg); + 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_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr; + FREE((void*)this_ptr); + ErrorAction_free(this_ptr_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKErrorAction* orig_conv = (LDKErrorAction*)orig; + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(orig_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKLightningError this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + LightningError_free(this_ptr_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKLightningError this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKStr _str = LightningError_get_err(&this_ptr_conv); + char* _buf = MALLOC(_str.len + 1, "str conv buf"); + memcpy(_buf, _str.chars, _str.len); + _buf[_str.len] = 0; + jstring _conv = (*_env)->NewStringUTF(_env, _str.chars); + FREE(_buf); + return _conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKLightningError 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); + LightningError_set_err(&this_ptr_conv, val_ref); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKLightningError this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = LightningError_get_action(&this_ptr_conv); + long ret_ref = (long)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKLightningError this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKErrorAction val_conv = *(LDKErrorAction*)val; + FREE((void*)val); + LightningError_set_action(&this_ptr_conv, val_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jbyteArray err_arg, jlong action_arg) { + LDKCVec_u8Z err_arg_ref; + err_arg_ref.datalen = (*_env)->GetArrayLength (_env, err_arg); + err_arg_ref.data = MALLOC(err_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*_env)->GetByteArrayRegion(_env, err_arg, 0, err_arg_ref.datalen, err_arg_ref.data); + LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg; + FREE((void*)action_arg); + LDKLightningError ret_var = LightningError_new(err_arg_ref, action_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 void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - GossipTimestampFilter_free(this_ptr_conv); + CommitmentUpdate_free(this_ptr_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv * _env, jclass _b, jlong orig) { - LDKGossipTimestampFilter orig_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKCommitmentUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); + LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_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; @@ -11078,60 +12979,125 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone( return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv)); - return ret_arr; + LDKCVec_UpdateAddHTLCZ val_constr; + val_constr.datalen = (*_env)->GetArrayLength (_env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); + else + val_constr.data = NULL; + long* val_vals = (*_env)->GetLongArrayElements (_env, val, NULL); + for (size_t p = 0; p < val_constr.datalen; p++) { + long arr_conv_15 = val_vals[p]; + LDKUpdateAddHTLC arr_conv_15_conv; + arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1)); + arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0); + val_constr.data[p] = arr_conv_15_conv; + } + (*_env)->ReleaseLongArrayElements (_env, val, val_vals, 0); + CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKGossipTimestampFilter this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) { + LDKCommitmentUpdate 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); - GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref); + LDKCVec_UpdateFulfillHTLCZ val_constr; + val_constr.datalen = (*_env)->GetArrayLength (_env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); + else + val_constr.data = NULL; + long* val_vals = (*_env)->GetLongArrayElements (_env, val, NULL); + for (size_t t = 0; t < val_constr.datalen; t++) { + long arr_conv_19 = val_vals[t]; + LDKUpdateFulfillHTLC arr_conv_19_conv; + arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1)); + arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0); + val_constr.data[t] = arr_conv_19_conv; + } + (*_env)->ReleaseLongArrayElements (_env, val, val_vals, 0); + CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jint ret_val = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); - return ret_val; + LDKCVec_UpdateFailHTLCZ val_constr; + val_constr.datalen = (*_env)->GetArrayLength (_env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); + else + val_constr.data = NULL; + long* val_vals = (*_env)->GetLongArrayElements (_env, val, NULL); + for (size_t q = 0; q < val_constr.datalen; q++) { + long arr_conv_16 = val_vals[q]; + LDKUpdateFailHTLC arr_conv_16_conv; + arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1)); + arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0); + val_constr.data[q] = arr_conv_16_conv; + } + (*_env)->ReleaseLongArrayElements (_env, val, val_vals, 0); + CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) { - LDKGossipTimestampFilter this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); + LDKCVec_UpdateFailMalformedHTLCZ val_constr; + val_constr.datalen = (*_env)->GetArrayLength (_env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); + else + val_constr.data = NULL; + long* val_vals = (*_env)->GetLongArrayElements (_env, val, NULL); + for (size_t z = 0; z < val_constr.datalen; z++) { + long arr_conv_25 = val_vals[z]; + LDKUpdateFailMalformedHTLC arr_conv_25_conv; + arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1)); + arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0); + val_constr.data[z] = arr_conv_25_conv; + } + (*_env)->ReleaseLongArrayElements (_env, val, val_vals, 0); + CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jint ret_val = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); - return ret_val; + LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&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_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) { - LDKGossipTimestampFilter this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); + LDKUpdateFee val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + if (val_conv.inner != NULL) + val_conv = UpdateFee_clone(&val_conv); + CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jint first_timestamp_arg, jint timestamp_range_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*_env)->GetArrayLength (_env, chain_hash_arg) == 32); - (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKCommitmentUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&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; @@ -11141,387 +13107,365 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JN return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr; - FREE((void*)this_ptr); - ErrorAction_free(this_ptr_conv); -} - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv * _env, jclass _b, jlong orig) { - LDKErrorAction* orig_conv = (LDKErrorAction*)orig; - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_clone(orig_conv); - long ret_ref = (long)ret_copy; - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKLightningError this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - LightningError_free(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommitmentSigned val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + if (val_conv.inner != NULL) + val_conv = CommitmentSigned_clone(&val_conv); + CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKStr _str = LightningError_get_err(&this_ptr_conv); - char* _buf = MALLOC(_str.len + 1, "str conv buf"); - memcpy(_buf, _str.chars, _str.len); - _buf[_str.len] = 0; - jstring _conv = (*_env)->NewStringUTF(_env, _str.chars); - FREE(_buf); - return _conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEnv * _env, jclass _b, jlongArray update_add_htlcs_arg, jlongArray update_fulfill_htlcs_arg, jlongArray update_fail_htlcs_arg, jlongArray update_fail_malformed_htlcs_arg, jlong update_fee_arg, jlong commitment_signed_arg) { + LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr; + update_add_htlcs_arg_constr.datalen = (*_env)->GetArrayLength (_env, update_add_htlcs_arg); + if (update_add_htlcs_arg_constr.datalen > 0) + update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); + else + update_add_htlcs_arg_constr.data = NULL; + long* update_add_htlcs_arg_vals = (*_env)->GetLongArrayElements (_env, update_add_htlcs_arg, NULL); + for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) { + long arr_conv_15 = update_add_htlcs_arg_vals[p]; + LDKUpdateAddHTLC arr_conv_15_conv; + arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1)); + arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0); + update_add_htlcs_arg_constr.data[p] = arr_conv_15_conv; + } + (*_env)->ReleaseLongArrayElements (_env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0); + LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr; + update_fulfill_htlcs_arg_constr.datalen = (*_env)->GetArrayLength (_env, update_fulfill_htlcs_arg); + if (update_fulfill_htlcs_arg_constr.datalen > 0) + update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); + else + update_fulfill_htlcs_arg_constr.data = NULL; + long* update_fulfill_htlcs_arg_vals = (*_env)->GetLongArrayElements (_env, update_fulfill_htlcs_arg, NULL); + for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) { + long arr_conv_19 = update_fulfill_htlcs_arg_vals[t]; + LDKUpdateFulfillHTLC arr_conv_19_conv; + arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1)); + arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0); + update_fulfill_htlcs_arg_constr.data[t] = arr_conv_19_conv; + } + (*_env)->ReleaseLongArrayElements (_env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0); + LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr; + update_fail_htlcs_arg_constr.datalen = (*_env)->GetArrayLength (_env, update_fail_htlcs_arg); + if (update_fail_htlcs_arg_constr.datalen > 0) + update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); + else + update_fail_htlcs_arg_constr.data = NULL; + long* update_fail_htlcs_arg_vals = (*_env)->GetLongArrayElements (_env, update_fail_htlcs_arg, NULL); + for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) { + long arr_conv_16 = update_fail_htlcs_arg_vals[q]; + LDKUpdateFailHTLC arr_conv_16_conv; + arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1)); + arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0); + update_fail_htlcs_arg_constr.data[q] = arr_conv_16_conv; + } + (*_env)->ReleaseLongArrayElements (_env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0); + LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr; + update_fail_malformed_htlcs_arg_constr.datalen = (*_env)->GetArrayLength (_env, update_fail_malformed_htlcs_arg); + if (update_fail_malformed_htlcs_arg_constr.datalen > 0) + update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); + else + update_fail_malformed_htlcs_arg_constr.data = NULL; + long* update_fail_malformed_htlcs_arg_vals = (*_env)->GetLongArrayElements (_env, update_fail_malformed_htlcs_arg, NULL); + for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) { + long arr_conv_25 = update_fail_malformed_htlcs_arg_vals[z]; + LDKUpdateFailMalformedHTLC arr_conv_25_conv; + arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1)); + arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0); + update_fail_malformed_htlcs_arg_constr.data[z] = arr_conv_25_conv; + } + (*_env)->ReleaseLongArrayElements (_env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0); + LDKUpdateFee update_fee_arg_conv; + update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); + update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); + if (update_fee_arg_conv.inner != NULL) + update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); + LDKCommitmentSigned commitment_signed_arg_conv; + commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); + commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); + if (commitment_signed_arg_conv.inner != NULL) + commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); + LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_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 void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKLightningError 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); - LightningError_set_err(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr; + FREE((void*)this_ptr); + HTLCFailChannelUpdate_free(this_ptr_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = LightningError_get_action(&this_ptr_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKHTLCFailChannelUpdate* orig_conv = (LDKHTLCFailChannelUpdate*)orig; + LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate"); + *ret_copy = HTLCFailChannelUpdate_clone(orig_conv); long ret_ref = (long)ret_copy; return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKErrorAction val_conv = *(LDKErrorAction*)val; - FREE((void*)val); - LightningError_set_action(&this_ptr_conv, val_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr; + FREE((void*)this_ptr); + ChannelMessageHandler_free(this_ptr_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jbyteArray err_arg, jlong action_arg) { - LDKCVec_u8Z err_arg_ref; - err_arg_ref.datalen = (*_env)->GetArrayLength (_env, err_arg); - err_arg_ref.data = MALLOC(err_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*_env)->GetByteArrayRegion(_env, err_arg, 0, err_arg_ref.datalen, err_arg_ref.data); - LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg; - FREE((void*)action_arg); - LDKLightningError ret_var = LightningError_new(err_arg_ref, action_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr; + FREE((void*)this_ptr); + RoutingMessageHandler_free(this_ptr_conv); +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKAcceptChannel obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = AcceptChannel_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKAcceptChannel ret_var = AcceptChannel_read(ser_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; } + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - CommitmentUpdate_free(this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKAnnouncementSignatures obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = AnnouncementSignatures_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv * _env, jclass _b, jlong orig) { - LDKCommitmentUpdate orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_read(ser_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; } + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_UpdateAddHTLCZ val_constr; - val_constr.datalen = (*_env)->GetArrayLength (_env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); - else - val_constr.data = NULL; - long* val_vals = (*_env)->GetLongArrayElements (_env, val, NULL); - for (size_t p = 0; p < val_constr.datalen; p++) { - long arr_conv_15 = val_vals[p]; - LDKUpdateAddHTLC arr_conv_15_conv; - arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1)); - arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0); - if (arr_conv_15_conv.inner != NULL) - arr_conv_15_conv = UpdateAddHTLC_clone(&arr_conv_15_conv); - val_constr.data[p] = arr_conv_15_conv; - } - (*_env)->ReleaseLongArrayElements (_env, val, val_vals, 0); - CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKChannelReestablish obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = ChannelReestablish_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_UpdateFulfillHTLCZ val_constr; - val_constr.datalen = (*_env)->GetArrayLength (_env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); - else - val_constr.data = NULL; - long* val_vals = (*_env)->GetLongArrayElements (_env, val, NULL); - for (size_t t = 0; t < val_constr.datalen; t++) { - long arr_conv_19 = val_vals[t]; - LDKUpdateFulfillHTLC arr_conv_19_conv; - arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1)); - arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0); - if (arr_conv_19_conv.inner != NULL) - arr_conv_19_conv = UpdateFulfillHTLC_clone(&arr_conv_19_conv); - val_constr.data[t] = arr_conv_19_conv; - } - (*_env)->ReleaseLongArrayElements (_env, val, val_vals, 0); - CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = ChannelReestablish_read(ser_ref); + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_UpdateFailHTLCZ val_constr; - val_constr.datalen = (*_env)->GetArrayLength (_env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); - else - val_constr.data = NULL; - long* val_vals = (*_env)->GetLongArrayElements (_env, val, NULL); - for (size_t q = 0; q < val_constr.datalen; q++) { - long arr_conv_16 = val_vals[q]; - LDKUpdateFailHTLC arr_conv_16_conv; - arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1)); - arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0); - if (arr_conv_16_conv.inner != NULL) - arr_conv_16_conv = UpdateFailHTLC_clone(&arr_conv_16_conv); - val_constr.data[q] = arr_conv_16_conv; - } - (*_env)->ReleaseLongArrayElements (_env, val, val_vals, 0); - CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKClosingSigned obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = ClosingSigned_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_UpdateFailMalformedHTLCZ val_constr; - val_constr.datalen = (*_env)->GetArrayLength (_env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); - else - val_constr.data = NULL; - long* val_vals = (*_env)->GetLongArrayElements (_env, val, NULL); - for (size_t z = 0; z < val_constr.datalen; z++) { - long arr_conv_25 = val_vals[z]; - LDKUpdateFailMalformedHTLC arr_conv_25_conv; - arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1)); - arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0); - if (arr_conv_25_conv.inner != NULL) - arr_conv_25_conv = UpdateFailMalformedHTLC_clone(&arr_conv_25_conv); - val_constr.data[z] = arr_conv_25_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKClosingSigned ret_var = ClosingSigned_read(ser_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; } - (*_env)->ReleaseLongArrayElements (_env, val, val_vals, 0); - CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr); + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return ret_ref; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKCommitmentSigned obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = CommitmentSigned_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKCommitmentSigned ret_var = CommitmentSigned_read(ser_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; } + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKUpdateFee val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - if (val_conv.inner != NULL) - val_conv = UpdateFee_clone(&val_conv); - CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKFundingCreated obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = FundingCreated_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKFundingCreated ret_var = FundingCreated_read(ser_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; } + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCommitmentSigned val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - if (val_conv.inner != NULL) - val_conv = CommitmentSigned_clone(&val_conv); - CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKFundingSigned obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = FundingSigned_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEnv * _env, jclass _b, jlongArray update_add_htlcs_arg, jlongArray update_fulfill_htlcs_arg, jlongArray update_fail_htlcs_arg, jlongArray update_fail_malformed_htlcs_arg, jlong update_fee_arg, jlong commitment_signed_arg) { - LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr; - update_add_htlcs_arg_constr.datalen = (*_env)->GetArrayLength (_env, update_add_htlcs_arg); - if (update_add_htlcs_arg_constr.datalen > 0) - update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); - else - update_add_htlcs_arg_constr.data = NULL; - long* update_add_htlcs_arg_vals = (*_env)->GetLongArrayElements (_env, update_add_htlcs_arg, NULL); - for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) { - long arr_conv_15 = update_add_htlcs_arg_vals[p]; - LDKUpdateAddHTLC arr_conv_15_conv; - arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1)); - arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0); - if (arr_conv_15_conv.inner != NULL) - arr_conv_15_conv = UpdateAddHTLC_clone(&arr_conv_15_conv); - update_add_htlcs_arg_constr.data[p] = arr_conv_15_conv; - } - (*_env)->ReleaseLongArrayElements (_env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0); - LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr; - update_fulfill_htlcs_arg_constr.datalen = (*_env)->GetArrayLength (_env, update_fulfill_htlcs_arg); - if (update_fulfill_htlcs_arg_constr.datalen > 0) - update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); - else - update_fulfill_htlcs_arg_constr.data = NULL; - long* update_fulfill_htlcs_arg_vals = (*_env)->GetLongArrayElements (_env, update_fulfill_htlcs_arg, NULL); - for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) { - long arr_conv_19 = update_fulfill_htlcs_arg_vals[t]; - LDKUpdateFulfillHTLC arr_conv_19_conv; - arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1)); - arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0); - if (arr_conv_19_conv.inner != NULL) - arr_conv_19_conv = UpdateFulfillHTLC_clone(&arr_conv_19_conv); - update_fulfill_htlcs_arg_constr.data[t] = arr_conv_19_conv; - } - (*_env)->ReleaseLongArrayElements (_env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0); - LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr; - update_fail_htlcs_arg_constr.datalen = (*_env)->GetArrayLength (_env, update_fail_htlcs_arg); - if (update_fail_htlcs_arg_constr.datalen > 0) - update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); - else - update_fail_htlcs_arg_constr.data = NULL; - long* update_fail_htlcs_arg_vals = (*_env)->GetLongArrayElements (_env, update_fail_htlcs_arg, NULL); - for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) { - long arr_conv_16 = update_fail_htlcs_arg_vals[q]; - LDKUpdateFailHTLC arr_conv_16_conv; - arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1)); - arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0); - if (arr_conv_16_conv.inner != NULL) - arr_conv_16_conv = UpdateFailHTLC_clone(&arr_conv_16_conv); - update_fail_htlcs_arg_constr.data[q] = arr_conv_16_conv; - } - (*_env)->ReleaseLongArrayElements (_env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0); - LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr; - update_fail_malformed_htlcs_arg_constr.datalen = (*_env)->GetArrayLength (_env, update_fail_malformed_htlcs_arg); - if (update_fail_malformed_htlcs_arg_constr.datalen > 0) - update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); - else - update_fail_malformed_htlcs_arg_constr.data = NULL; - long* update_fail_malformed_htlcs_arg_vals = (*_env)->GetLongArrayElements (_env, update_fail_malformed_htlcs_arg, NULL); - for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) { - long arr_conv_25 = update_fail_malformed_htlcs_arg_vals[z]; - LDKUpdateFailMalformedHTLC arr_conv_25_conv; - arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1)); - arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0); - if (arr_conv_25_conv.inner != NULL) - arr_conv_25_conv = UpdateFailMalformedHTLC_clone(&arr_conv_25_conv); - update_fail_malformed_htlcs_arg_constr.data[z] = arr_conv_25_conv; - } - (*_env)->ReleaseLongArrayElements (_env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0); - LDKUpdateFee update_fee_arg_conv; - update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); - update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); - if (update_fee_arg_conv.inner != NULL) - update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); - LDKCommitmentSigned commitment_signed_arg_conv; - commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); - commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); - if (commitment_signed_arg_conv.inner != NULL) - commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); - LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKFundingSigned ret_var = FundingSigned_read(ser_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; } + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr; - FREE((void*)this_ptr); - HTLCFailChannelUpdate_free(this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKFundingLocked obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = FundingLocked_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1clone(JNIEnv * _env, jclass _b, jlong orig) { - LDKHTLCFailChannelUpdate* orig_conv = (LDKHTLCFailChannelUpdate*)orig; - LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate"); - *ret_copy = HTLCFailChannelUpdate_clone(orig_conv); - long ret_ref = (long)ret_copy; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKFundingLocked ret_var = FundingLocked_read(ser_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; + } + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr; - FREE((void*)this_ptr); - ChannelMessageHandler_free(this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKInit obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = Init_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr; - FREE((void*)this_ptr); - RoutingMessageHandler_free(this_ptr_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = Init_read(ser_ref); + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKAcceptChannel obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKOpenChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = AcceptChannel_write(&obj_conv); + LDKCVec_u8Z arg_var = OpenChannel_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKAcceptChannel ret_var = AcceptChannel_read(ser_ref); + LDKOpenChannel ret_var = OpenChannel_read(ser_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; @@ -11532,22 +13476,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKAnnouncementSignatures obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKRevokeAndACK obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = AnnouncementSignatures_write(&obj_conv); + LDKCVec_u8Z arg_var = RevokeAndACK_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKAnnouncementSignatures ret_var = AnnouncementSignatures_read(ser_ref); + LDKRevokeAndACK ret_var = RevokeAndACK_read(ser_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; @@ -11558,22 +13502,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read( return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelReestablish this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = ChannelReestablish_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKShutdown obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = Shutdown_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKChannelReestablish ret_var = ChannelReestablish_read(ser_ref); + LDKShutdown ret_var = Shutdown_read(ser_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; @@ -11584,22 +13528,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIE return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKClosingSigned obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKUpdateFailHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = ClosingSigned_write(&obj_conv); + LDKCVec_u8Z arg_var = UpdateFailHTLC_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKClosingSigned ret_var = ClosingSigned_read(ser_ref); + LDKUpdateFailHTLC ret_var = UpdateFailHTLC_read(ser_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; @@ -11610,22 +13554,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKCommitmentSigned obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKUpdateFailMalformedHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = CommitmentSigned_write(&obj_conv); + LDKCVec_u8Z arg_var = UpdateFailMalformedHTLC_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKCommitmentSigned ret_var = CommitmentSigned_read(ser_ref); + LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_read(ser_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; @@ -11636,22 +13580,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKFundingCreated obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKUpdateFee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = FundingCreated_write(&obj_conv); + LDKCVec_u8Z arg_var = UpdateFee_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKFundingCreated ret_var = FundingCreated_read(ser_ref); + LDKUpdateFee ret_var = UpdateFee_read(ser_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; @@ -11662,22 +13606,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKFundingSigned obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKUpdateFulfillHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = FundingSigned_write(&obj_conv); + LDKCVec_u8Z arg_var = UpdateFulfillHTLC_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKFundingSigned ret_var = FundingSigned_read(ser_ref); + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_read(ser_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; @@ -11688,22 +13632,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKFundingLocked obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKUpdateAddHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = FundingLocked_write(&obj_conv); + LDKCVec_u8Z arg_var = UpdateAddHTLC_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKFundingLocked ret_var = FundingLocked_read(ser_ref); + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_read(ser_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; @@ -11714,74 +13658,85 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKInit this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = Init_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKPing obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = Ping_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = Ping_read(ser_ref); + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return (long)ret_conv; +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKPong obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = Pong_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKInit ret_var = Init_read(ser_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; - } + LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = Pong_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKOpenChannel obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKUnsignedChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = OpenChannel_write(&obj_conv); + LDKCVec_u8Z arg_var = UnsignedChannelAnnouncement_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKOpenChannel ret_var = OpenChannel_read(ser_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; - } + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = UnsignedChannelAnnouncement_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKRevokeAndACK obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = RevokeAndACK_write(&obj_conv); + LDKCVec_u8Z arg_var = ChannelAnnouncement_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKRevokeAndACK ret_var = RevokeAndACK_read(ser_ref); + LDKChannelAnnouncement ret_var = ChannelAnnouncement_read(ser_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; @@ -11792,48 +13747,43 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _ return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKShutdown obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKUnsignedChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = Shutdown_write(&obj_conv); + LDKCVec_u8Z arg_var = UnsignedChannelUpdate_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKShutdown ret_var = Shutdown_read(ser_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; - } + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = UnsignedChannelUpdate_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKUpdateFailHTLC obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = UpdateFailHTLC_write(&obj_conv); + LDKCVec_u8Z arg_var = ChannelUpdate_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKUpdateFailHTLC ret_var = UpdateFailHTLC_read(ser_ref); + LDKChannelUpdate ret_var = ChannelUpdate_read(ser_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; @@ -11844,74 +13794,64 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKUpdateFailMalformedHTLC obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKErrorMessage obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = UpdateFailMalformedHTLC_write(&obj_conv); + LDKCVec_u8Z arg_var = ErrorMessage_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_read(ser_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; - } + LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = ErrorMessage_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKUpdateFee obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKUnsignedNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = UpdateFee_write(&obj_conv); + LDKCVec_u8Z arg_var = UnsignedNodeAnnouncement_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKUpdateFee ret_var = UpdateFee_read(ser_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; - } + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = UnsignedNodeAnnouncement_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKUpdateFulfillHTLC obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = UpdateFulfillHTLC_write(&obj_conv); + LDKCVec_u8Z arg_var = NodeAnnouncement_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_read(ser_ref); + LDKNodeAnnouncement ret_var = NodeAnnouncement_read(ser_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; @@ -11922,349 +13862,570 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEn return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKUpdateAddHTLC obj_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = QueryShortChannelIds_read(ser_ref); + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return (long)ret_conv; +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKQueryShortChannelIds obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = UpdateAddHTLC_write(&obj_conv); + LDKCVec_u8Z arg_var = QueryShortChannelIds_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKUpdateAddHTLC ret_var = UpdateAddHTLC_read(ser_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; - } + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = Ping_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKReplyShortChannelIdsEnd obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = ReplyShortChannelIdsEnd_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKPing ret_var = Ping_read(ser_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; - } + LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = QueryChannelRange_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKPong this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = Pong_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKQueryChannelRange obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = QueryChannelRange_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKPong ret_var = Pong_read(ser_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; - } + LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = ReplyChannelRange_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = UnsignedChannelAnnouncement_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKReplyChannelRange obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = ReplyChannelRange_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_read(ser_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; - } + LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = GossipTimestampFilter_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKChannelAnnouncement obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKGossipTimestampFilter obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = ChannelAnnouncement_write(&obj_conv); + LDKCVec_u8Z arg_var = GossipTimestampFilter_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKChannelAnnouncement ret_var = ChannelAnnouncement_read(ser_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKMessageHandler this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + MessageHandler_free(this_ptr_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKMessageHandler this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + long ret_ret = (long)MessageHandler_get_chan_handler(&this_ptr_conv); + return ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKMessageHandler this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val; + if (val_conv.free == LDKChannelMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg); + } + MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKMessageHandler this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + long ret_ret = (long)MessageHandler_get_route_handler(&this_ptr_conv); + return ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKMessageHandler this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val; + if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg); + } + MessageHandler_set_route_handler(&this_ptr_conv, val_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) { + LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg; + if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg); + } + LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg; + if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg); + } + LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_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; } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig; + LDKSocketDescriptor* ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret = SocketDescriptor_clone(orig_conv); + return (long)ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr; + FREE((void*)this_ptr); + SocketDescriptor_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKPeerHandleError this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + PeerHandleError_free(this_ptr_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKPeerHandleError this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jboolean ret_val = PeerHandleError_get_no_connection_possible(&this_ptr_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { + LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = UnsignedChannelUpdate_write(&this_ptr_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); - return arg_arr; + PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_read(ser_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) { + LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg); 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; } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKChannelUpdate obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = ChannelUpdate_write(&obj_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); - return arg_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKPeerManager this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + PeerManager_free(this_ptr_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKChannelUpdate ret_var = ChannelUpdate_read(ser_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv * _env, jclass _b, jlong message_handler, jbyteArray our_node_secret, jbyteArray ephemeral_random_data, jlong logger) { + LDKMessageHandler message_handler_conv; + message_handler_conv.inner = (void*)(message_handler & (~1)); + message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); + // Warning: we may need a move here but can't clone! + LDKSecretKey our_node_secret_ref; + CHECK((*_env)->GetArrayLength (_env, our_node_secret) == 32); + (*_env)->GetByteArrayRegion (_env, our_node_secret, 0, 32, our_node_secret_ref.bytes); + unsigned char ephemeral_random_data_arr[32]; + CHECK((*_env)->GetArrayLength (_env, ephemeral_random_data) == 32); + (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr); + unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr; + LDKLogger logger_conv = *(LDKLogger*)logger; + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_clone(logger_conv.this_arg); + } + LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_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; } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKErrorMessage this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = ErrorMessage_write(&this_ptr_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); - return arg_arr; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); + jobjectArray ret_arr = (*_env)->NewObjectArray(_env, ret_var.datalen, arr_of_B_clz, NULL); + for (size_t i = 0; i < ret_var.datalen; i++) { + jbyteArray arr_conv_8_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arr_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); + (*_env)->SetObjectArrayElement(_env, ret_arr, i, arr_conv_8_arr); + } + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKErrorMessage ret_var = ErrorMessage_read(ser_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; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong descriptor) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKPublicKey their_node_id_ref; + CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); + (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); + LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor; + if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg); } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv); + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = UnsignedNodeAnnouncement_write(&this_ptr_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); - return arg_arr; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor; + if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg); + } + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_read(ser_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; - } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor; + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv); + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKNodeAnnouncement obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = NodeAnnouncement_write(&obj_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jbyteArray data) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor; + LDKu8slice data_ref; + data_ref.datalen = (*_env)->GetArrayLength (_env, data); + data_ref.data = (*_env)->GetByteArrayElements (_env, data, NULL); + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref); + (*_env)->ReleaseByteArrayElements(_env, data, (int8_t*)data_ref.data, 0); + return (long)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + PeerManager_process_events(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor; + PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + PeerManager_timer_tick_occured(&this_arg_conv); +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) { + unsigned char commitment_seed_arr[32]; + CHECK((*_env)->GetArrayLength (_env, commitment_seed) == 32); + (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr); + unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKNodeAnnouncement ret_var = NodeAnnouncement_read(ser_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; - } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point, jbyteArray base_secret) { + LDKPublicKey per_commitment_point_ref; + CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); + (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + unsigned char base_secret_arr[32]; + CHECK((*_env)->GetArrayLength (_env, base_secret) == 32); + (*_env)->GetByteArrayRegion (_env, base_secret, 0, 32, base_secret_arr); + unsigned char (*base_secret_ref)[32] = &base_secret_arr; + LDKCResult_SecretKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ"); + *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point, jbyteArray base_point) { + LDKPublicKey per_commitment_point_ref; + CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); + (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKPublicKey base_point_ref; + CHECK((*_env)->GetArrayLength (_env, base_point) == 33); + (*_env)->GetByteArrayRegion (_env, base_point, 0, 33, base_point_ref.compressed_form); + LDKCResult_PublicKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ"); + *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_secret, jbyteArray countersignatory_revocation_base_secret) { + unsigned char per_commitment_secret_arr[32]; + CHECK((*_env)->GetArrayLength (_env, per_commitment_secret) == 32); + (*_env)->GetByteArrayRegion (_env, per_commitment_secret, 0, 32, per_commitment_secret_arr); + unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr; + unsigned char countersignatory_revocation_base_secret_arr[32]; + CHECK((*_env)->GetArrayLength (_env, countersignatory_revocation_base_secret) == 32); + (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr); + unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr; + LDKCResult_SecretKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ"); + *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point, jbyteArray countersignatory_revocation_base_point) { + LDKPublicKey per_commitment_point_ref; + CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); + (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKPublicKey countersignatory_revocation_base_point_ref; + CHECK((*_env)->GetArrayLength (_env, countersignatory_revocation_base_point) == 33); + (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_point, 0, 33, countersignatory_revocation_base_point_ref.compressed_form); + LDKCResult_PublicKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ"); + *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref); + return (long)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + TxCreationKeys_free(this_ptr_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKQueryShortChannelIds ret_var = QueryShortChannelIds_read(ser_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKTxCreationKeys orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_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; } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKQueryShortChannelIds this_ptr_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = QueryShortChannelIds_write(&this_ptr_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_read(ser_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; - } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 33); + (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKReplyShortChannelIdsEnd this_ptr_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = ReplyShortChannelIdsEnd_write(&this_ptr_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKQueryChannelRange ret_var = QueryChannelRange_read(ser_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 33); + (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form); + return arg_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 33); + (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form); + return arg_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 33); + (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form); + return arg_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 33); + (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point_arg, jbyteArray revocation_key_arg, jbyteArray broadcaster_htlc_key_arg, jbyteArray countersignatory_htlc_key_arg, jbyteArray broadcaster_delayed_payment_key_arg) { + LDKPublicKey per_commitment_point_arg_ref; + CHECK((*_env)->GetArrayLength (_env, per_commitment_point_arg) == 33); + (*_env)->GetByteArrayRegion (_env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); + LDKPublicKey revocation_key_arg_ref; + CHECK((*_env)->GetArrayLength (_env, revocation_key_arg) == 33); + (*_env)->GetByteArrayRegion (_env, revocation_key_arg, 0, 33, revocation_key_arg_ref.compressed_form); + LDKPublicKey broadcaster_htlc_key_arg_ref; + CHECK((*_env)->GetArrayLength (_env, broadcaster_htlc_key_arg) == 33); + (*_env)->GetByteArrayRegion (_env, broadcaster_htlc_key_arg, 0, 33, broadcaster_htlc_key_arg_ref.compressed_form); + LDKPublicKey countersignatory_htlc_key_arg_ref; + CHECK((*_env)->GetArrayLength (_env, countersignatory_htlc_key_arg) == 33); + (*_env)->GetByteArrayRegion (_env, countersignatory_htlc_key_arg, 0, 33, countersignatory_htlc_key_arg_ref.compressed_form); + LDKPublicKey broadcaster_delayed_payment_key_arg_ref; + CHECK((*_env)->GetArrayLength (_env, broadcaster_delayed_payment_key_arg) == 33); + (*_env)->GetByteArrayRegion (_env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form); + LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref); 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; } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = QueryChannelRange_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKTxCreationKeys obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = TxCreationKeys_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKReplyChannelRange ret_var = ReplyChannelRange_read(ser_ref); + LDKTxCreationKeys ret_var = TxCreationKeys_read(ser_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; @@ -12275,148 +14436,139 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEn return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKReplyChannelRange this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = ReplyChannelRange_write(&this_ptr_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); - return arg_arr; + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + ChannelPublicKeys_free(this_ptr_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_read(ser_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKChannelPublicKeys orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_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; } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = GossipTimestampFilter_write(&this_ptr_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form); return arg_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKMessageHandler this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - MessageHandler_free(this_ptr_conv); -} - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - long ret_ret = (long)MessageHandler_get_chan_handler(&this_ptr_conv); - return ret_ret; + LDKPublicKey val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 33); + (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val; - if (val_conv.free == LDKChannelMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg); - } - MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form); + return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - long ret_ret = (long)MessageHandler_get_route_handler(&this_ptr_conv); - return ret_ret; + LDKPublicKey val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 33); + (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val; - if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg); - } - MessageHandler_set_route_handler(&this_ptr_conv, val_conv); -} - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) { - LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg; - if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg); - } - LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg; - if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg); - } - LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_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 jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv * _env, jclass _b, jlong orig) { - LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig; - LDKSocketDescriptor* ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); - *ret = SocketDescriptor_clone(orig_conv); - return (long)ret; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form); + return arg_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr; - FREE((void*)this_ptr); - SocketDescriptor_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 33); + (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKPeerHandleError this_ptr_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - PeerHandleError_free(this_ptr_conv); + this_ptr_conv.is_owned = false; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); + return arg_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKPeerHandleError this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jboolean ret_val = PeerHandleError_get_no_connection_possible(&this_ptr_conv); - return ret_val; + LDKPublicKey val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 33); + (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { - LDKPeerHandleError this_ptr_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form); + return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) { - LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKPublicKey val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 33); + (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIEnv * _env, jclass _b, jbyteArray funding_pubkey_arg, jbyteArray revocation_basepoint_arg, jbyteArray payment_point_arg, jbyteArray delayed_payment_basepoint_arg, jbyteArray htlc_basepoint_arg) { + LDKPublicKey funding_pubkey_arg_ref; + CHECK((*_env)->GetArrayLength (_env, funding_pubkey_arg) == 33); + (*_env)->GetByteArrayRegion (_env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form); + LDKPublicKey revocation_basepoint_arg_ref; + CHECK((*_env)->GetArrayLength (_env, revocation_basepoint_arg) == 33); + (*_env)->GetByteArrayRegion (_env, revocation_basepoint_arg, 0, 33, revocation_basepoint_arg_ref.compressed_form); + LDKPublicKey payment_point_arg_ref; + CHECK((*_env)->GetArrayLength (_env, payment_point_arg) == 33); + (*_env)->GetByteArrayRegion (_env, payment_point_arg, 0, 33, payment_point_arg_ref.compressed_form); + LDKPublicKey delayed_payment_basepoint_arg_ref; + CHECK((*_env)->GetArrayLength (_env, delayed_payment_basepoint_arg) == 33); + (*_env)->GetByteArrayRegion (_env, delayed_payment_basepoint_arg, 0, 33, delayed_payment_basepoint_arg_ref.compressed_form); + LDKPublicKey htlc_basepoint_arg_ref; + CHECK((*_env)->GetArrayLength (_env, htlc_basepoint_arg) == 33); + (*_env)->GetByteArrayRegion (_env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form); + LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref); 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; @@ -12426,205 +14578,254 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKPeerManager this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - PeerManager_free(this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKChannelPublicKeys obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = ChannelPublicKeys_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv * _env, jclass _b, jlong message_handler, jbyteArray our_node_secret, jbyteArray ephemeral_random_data, jlong logger) { - LDKMessageHandler message_handler_conv; - message_handler_conv.inner = (void*)(message_handler & (~1)); - message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); - // Warning: we may need a move here but can't clone! - LDKSecretKey our_node_secret_ref; - CHECK((*_env)->GetArrayLength (_env, our_node_secret) == 32); - (*_env)->GetByteArrayRegion (_env, our_node_secret, 0, 32, our_node_secret_ref.bytes); - unsigned char ephemeral_random_data_arr[32]; - CHECK((*_env)->GetArrayLength (_env, ephemeral_random_data) == 32); - (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr); - unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr; - LDKLogger logger_conv = *(LDKLogger*)logger; - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_clone(logger_conv.this_arg); - } - LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKChannelPublicKeys ret_var = ChannelPublicKeys_read(ser_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; } + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); - jobjectArray ret_arr = (*_env)->NewObjectArray(_env, ret_var.datalen, arr_of_B_clz, NULL); - for (size_t i = 0; i < ret_var.datalen; i++) { - jbyteArray arr_conv_8_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arr_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); - (*_env)->SetObjectArrayElement(_env, ret_arr, i, arr_conv_8_arr); - } - CVec_PublicKeyZ_free(ret_var); - return ret_arr; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point, jbyteArray broadcaster_delayed_payment_base, jbyteArray broadcaster_htlc_base, jbyteArray countersignatory_revocation_base, jbyteArray countersignatory_htlc_base) { + LDKPublicKey per_commitment_point_ref; + CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); + (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKPublicKey broadcaster_delayed_payment_base_ref; + CHECK((*_env)->GetArrayLength (_env, broadcaster_delayed_payment_base) == 33); + (*_env)->GetByteArrayRegion (_env, broadcaster_delayed_payment_base, 0, 33, broadcaster_delayed_payment_base_ref.compressed_form); + LDKPublicKey broadcaster_htlc_base_ref; + CHECK((*_env)->GetArrayLength (_env, broadcaster_htlc_base) == 33); + (*_env)->GetByteArrayRegion (_env, broadcaster_htlc_base, 0, 33, broadcaster_htlc_base_ref.compressed_form); + LDKPublicKey countersignatory_revocation_base_ref; + CHECK((*_env)->GetArrayLength (_env, countersignatory_revocation_base) == 33); + (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base, 0, 33, countersignatory_revocation_base_ref.compressed_form); + LDKPublicKey countersignatory_htlc_base_ref; + CHECK((*_env)->GetArrayLength (_env, countersignatory_htlc_base) == 33); + (*_env)->GetByteArrayRegion (_env, countersignatory_htlc_base, 0, 33, countersignatory_htlc_base_ref.compressed_form); + LDKCResult_TxCreationKeysSecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ"); + *ret_conv = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref); + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray their_node_id, jlong descriptor) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - LDKPublicKey their_node_id_ref; - CHECK((*_env)->GetArrayLength (_env, their_node_id) == 33); - (*_env)->GetByteArrayRegion (_env, their_node_id, 0, 33, their_node_id_ref.compressed_form); - LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor; - if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg); - } - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1channel_1static_1keys(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point, jlong broadcaster_keys, jlong countersignatory_keys) { + LDKPublicKey per_commitment_point_ref; + CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); + (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKChannelPublicKeys broadcaster_keys_conv; + broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); + broadcaster_keys_conv.is_owned = false; + LDKChannelPublicKeys countersignatory_keys_conv; + countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); + countersignatory_keys_conv.is_owned = false; + LDKCResult_TxCreationKeysSecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ"); + *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor; - if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv * _env, jclass _b, jbyteArray revocation_key, jshort contest_delay, jbyteArray broadcaster_delayed_payment_key) { + LDKPublicKey revocation_key_ref; + CHECK((*_env)->GetArrayLength (_env, revocation_key) == 33); + (*_env)->GetByteArrayRegion (_env, revocation_key, 0, 33, revocation_key_ref.compressed_form); + LDKPublicKey broadcaster_delayed_payment_key_ref; + CHECK((*_env)->GetArrayLength (_env, broadcaster_delayed_payment_key) == 33); + (*_env)->GetByteArrayRegion (_env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); + LDKCVec_u8Z arg_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + HTLCOutputInCommitment_free(this_ptr_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKHTLCOutputInCommitment orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_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; } - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv); - return (long)ret_conv; + return ret_ref; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor; - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv); - return (long)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jboolean ret_val = HTLCOutputInCommitment_get_offered(&this_ptr_conv); + return ret_val; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jbyteArray data) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor; - LDKu8slice data_ref; - data_ref.datalen = (*_env)->GetArrayLength (_env, data); - data_ref.data = (*_env)->GetByteArrayElements (_env, data, NULL); - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref); - (*_env)->ReleaseByteArrayElements(_env, data, (int8_t*)data_ref.data, 0); - return (long)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - PeerManager_process_events(&this_arg_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jlong ret_val = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); +} + +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jint ret_val = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); + return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor; - PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - PeerManager_timer_tick_occured(&this_arg_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) { - unsigned char commitment_seed_arr[32]; - CHECK((*_env)->GetArrayLength (_env, commitment_seed) == 32); - (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr); - unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKHTLCOutputInCommitment 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); + HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKHTLCOutputInCommitment obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = HTLCOutputInCommitment_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point, jbyteArray base_secret) { - LDKPublicKey per_commitment_point_ref; - CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); - (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - unsigned char base_secret_arr[32]; - CHECK((*_env)->GetArrayLength (_env, base_secret) == 32); - (*_env)->GetByteArrayRegion (_env, base_secret, 0, 32, base_secret_arr); - unsigned char (*base_secret_ref)[32] = &base_secret_arr; - LDKCResult_SecretKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ"); - *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref); - return (long)ret_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_read(ser_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; + } + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return ret_ref; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point, jbyteArray base_point) { - LDKPublicKey per_commitment_point_ref; - CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); - (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - LDKPublicKey base_point_ref; - CHECK((*_env)->GetArrayLength (_env, base_point) == 33); - (*_env)->GetByteArrayRegion (_env, base_point, 0, 33, base_point_ref.compressed_form); - LDKCResult_PublicKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ"); - *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref); - return (long)ret_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) { + LDKHTLCOutputInCommitment htlc_conv; + htlc_conv.inner = (void*)(htlc & (~1)); + htlc_conv.is_owned = false; + LDKTxCreationKeys keys_conv; + keys_conv.inner = (void*)(keys & (~1)); + keys_conv.is_owned = false; + LDKCVec_u8Z arg_var = get_htlc_redeemscript(&htlc_conv, &keys_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_secret, jbyteArray countersignatory_revocation_base_secret) { - unsigned char per_commitment_secret_arr[32]; - CHECK((*_env)->GetArrayLength (_env, per_commitment_secret) == 32); - (*_env)->GetByteArrayRegion (_env, per_commitment_secret, 0, 32, per_commitment_secret_arr); - unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr; - unsigned char countersignatory_revocation_base_secret_arr[32]; - CHECK((*_env)->GetArrayLength (_env, countersignatory_revocation_base_secret) == 32); - (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr); - unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr; - LDKCResult_SecretKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ"); - *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref); - return (long)ret_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jbyteArray broadcaster, jbyteArray countersignatory) { + LDKPublicKey broadcaster_ref; + CHECK((*_env)->GetArrayLength (_env, broadcaster) == 33); + (*_env)->GetByteArrayRegion (_env, broadcaster, 0, 33, broadcaster_ref.compressed_form); + LDKPublicKey countersignatory_ref; + CHECK((*_env)->GetArrayLength (_env, countersignatory) == 33); + (*_env)->GetByteArrayRegion (_env, countersignatory, 0, 33, countersignatory_ref.compressed_form); + LDKCVec_u8Z arg_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point, jbyteArray countersignatory_revocation_base_point) { - LDKPublicKey per_commitment_point_ref; - CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); - (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - LDKPublicKey countersignatory_revocation_base_point_ref; - CHECK((*_env)->GetArrayLength (_env, countersignatory_revocation_base_point) == 33); - (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_point, 0, 33, countersignatory_revocation_base_point_ref.compressed_form); - LDKCResult_PublicKeySecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ"); - *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref); - return (long)ret_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv * _env, jclass _b, jbyteArray prev_hash, jint feerate_per_kw, jshort contest_delay, jlong htlc, jbyteArray broadcaster_delayed_payment_key, jbyteArray revocation_key) { + unsigned char prev_hash_arr[32]; + CHECK((*_env)->GetArrayLength (_env, prev_hash) == 32); + (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr); + unsigned char (*prev_hash_ref)[32] = &prev_hash_arr; + LDKHTLCOutputInCommitment htlc_conv; + htlc_conv.inner = (void*)(htlc & (~1)); + htlc_conv.is_owned = false; + LDKPublicKey broadcaster_delayed_payment_key_ref; + CHECK((*_env)->GetArrayLength (_env, broadcaster_delayed_payment_key) == 33); + (*_env)->GetByteArrayRegion (_env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); + LDKPublicKey revocation_key_ref; + CHECK((*_env)->GetArrayLength (_env, revocation_key) == 33); + (*_env)->GetByteArrayRegion (_env, revocation_key, 0, 33, revocation_key_ref.compressed_form); + LDKTransaction arg_var = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + Transaction_free(arg_var); + return arg_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - TxCreationKeys_free(this_ptr_conv); + ChannelTransactionParameters_free(this_ptr_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) { - LDKTxCreationKeys orig_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; - LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_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; @@ -12634,118 +14835,209 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form); - return arg_arr; + LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&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_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1pubkeys(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 33); - (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); + LDKChannelPublicKeys val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + if (val_conv.inner != NULL) + val_conv = ChannelPublicKeys_clone(&val_conv); + ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form); - return arg_arr; + jshort ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); + return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 33); - (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); + ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1is_1outbound_1from_1holder(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form); - return arg_arr; + jboolean ret_val = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); + return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1is_1outbound_1from_1holder(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 33); - (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); + ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1counterparty_1parameters(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&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_ChannelTransactionParameters_1set_1counterparty_1parameters(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKCounterpartyChannelTransactionParameters val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + if (val_conv.inner != NULL) + val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv); + ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1funding_1outpoint(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_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_ChannelTransactionParameters_1set_1funding_1outpoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKChannelTransactionParameters 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); + if (val_conv.inner != NULL) + val_conv = OutPoint_clone(&val_conv); + ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv * _env, jclass _b, jlong holder_pubkeys_arg, jshort holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, jlong counterparty_parameters_arg, jlong funding_outpoint_arg) { + LDKChannelPublicKeys holder_pubkeys_arg_conv; + holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); + holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); + if (holder_pubkeys_arg_conv.inner != NULL) + holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); + LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; + counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1)); + counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0); + if (counterparty_parameters_arg_conv.inner != NULL) + counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); + LDKOutPoint funding_outpoint_arg_conv; + funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1)); + funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0); + if (funding_outpoint_arg_conv.inner != NULL) + funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_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 void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + CounterpartyChannelTransactionParameters_free(this_ptr_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKCounterpartyChannelTransactionParameters orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_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 jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form); - return arg_arr; + LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&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_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1pubkeys(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 33); - (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); + LDKChannelPublicKeys val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + if (val_conv.inner != NULL) + val_conv = ChannelPublicKeys_clone(&val_conv); + CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form); - return arg_arr; + jshort ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); + return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 33); - (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); + CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point_arg, jbyteArray revocation_key_arg, jbyteArray broadcaster_htlc_key_arg, jbyteArray countersignatory_htlc_key_arg, jbyteArray broadcaster_delayed_payment_key_arg) { - LDKPublicKey per_commitment_point_arg_ref; - CHECK((*_env)->GetArrayLength (_env, per_commitment_point_arg) == 33); - (*_env)->GetByteArrayRegion (_env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); - LDKPublicKey revocation_key_arg_ref; - CHECK((*_env)->GetArrayLength (_env, revocation_key_arg) == 33); - (*_env)->GetByteArrayRegion (_env, revocation_key_arg, 0, 33, revocation_key_arg_ref.compressed_form); - LDKPublicKey broadcaster_htlc_key_arg_ref; - CHECK((*_env)->GetArrayLength (_env, broadcaster_htlc_key_arg) == 33); - (*_env)->GetByteArrayRegion (_env, broadcaster_htlc_key_arg, 0, 33, broadcaster_htlc_key_arg_ref.compressed_form); - LDKPublicKey countersignatory_htlc_key_arg_ref; - CHECK((*_env)->GetArrayLength (_env, countersignatory_htlc_key_arg) == 33); - (*_env)->GetByteArrayRegion (_env, countersignatory_htlc_key_arg, 0, 33, countersignatory_htlc_key_arg_ref.compressed_form); - LDKPublicKey broadcaster_delayed_payment_key_arg_ref; - CHECK((*_env)->GetArrayLength (_env, broadcaster_delayed_payment_key_arg) == 33); - (*_env)->GetByteArrayRegion (_env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form); - LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new(JNIEnv * _env, jclass _b, jlong pubkeys_arg, jshort selected_contest_delay_arg) { + LDKChannelPublicKeys pubkeys_arg_conv; + pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); + pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); + if (pubkeys_arg_conv.inner != NULL) + pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); 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; @@ -12755,22 +15047,58 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv * return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKTxCreationKeys obj_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1is_1populated(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKChannelTransactionParameters this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + jboolean ret_val = ChannelTransactionParameters_is_populated(&this_arg_conv); + return ret_val; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1holder_1broadcastable(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKChannelTransactionParameters this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_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 jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1counterparty_1broadcastable(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKChannelTransactionParameters this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_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 jbyteArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKCounterpartyChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = TxCreationKeys_write(&obj_conv); + LDKCVec_u8Z arg_var = CounterpartyChannelTransactionParameters_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKTxCreationKeys ret_var = TxCreationKeys_read(ser_ref); + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_read(ser_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; @@ -12781,34 +15109,44 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKPreCalculatedTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - PreCalculatedTxCreationKeys_free(this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKChannelTransactionParameters obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = ChannelTransactionParameters_write(&obj_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + CVec_u8Z_free(arg_var); + return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) { - LDKPreCalculatedTxCreationKeys orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - LDKPreCalculatedTxCreationKeys ret_var = PreCalculatedTxCreationKeys_clone(&orig_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_read(ser_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; } + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); return ret_ref; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) { - LDKTxCreationKeys keys_conv; - keys_conv.inner = (void*)(keys & (~1)); - keys_conv.is_owned = (keys & 1) || (keys == 0); - if (keys_conv.inner != NULL) - keys_conv = TxCreationKeys_clone(&keys_conv); - LDKPreCalculatedTxCreationKeys ret_var = PreCalculatedTxCreationKeys_new(keys_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKDirectedChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + DirectedChannelTransactionParameters_free(this_ptr_conv); +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_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; @@ -12818,11 +15156,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1 return ret_ref; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKPreCalculatedTxCreationKeys this_arg_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - LDKTxCreationKeys ret_var = PreCalculatedTxCreationKeys_trust_key_derivation(&this_arg_conv); + LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_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; @@ -12832,27 +15170,27 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1 return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKPreCalculatedTxCreationKeys this_arg_conv; +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, PreCalculatedTxCreationKeys_per_commitment_point(&this_arg_conv).compressed_form); - return arg_arr; + jshort ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); + return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelPublicKeys_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + jboolean ret_val = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); + return ret_val; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv * _env, jclass _b, jlong orig) { - LDKChannelPublicKeys orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_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; @@ -12862,143 +15200,82 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIE return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form); - return arg_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 33); - (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); -} - -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form); - return arg_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 33); - (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); -} - -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelPublicKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form); - return arg_arr; + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + HolderCommitmentTransaction_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 33); - (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKHolderCommitmentTransaction orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_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 jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelPublicKeys this_ptr_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form); return arg_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 33); - (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); -} - -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKChannelPublicKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 33); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form); - return arg_arr; + LDKSignature val_ref; + CHECK((*_env)->GetArrayLength (_env, val) == 64); + (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form); + HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKChannelPublicKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(JNIEnv * _env, jclass _b, jlong this_ptr, jobjectArray val) { + LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 33); - (*_env)->GetByteArrayRegion (_env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); -} - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIEnv * _env, jclass _b, jbyteArray funding_pubkey_arg, jbyteArray revocation_basepoint_arg, jbyteArray payment_point_arg, jbyteArray delayed_payment_basepoint_arg, jbyteArray htlc_basepoint_arg) { - LDKPublicKey funding_pubkey_arg_ref; - CHECK((*_env)->GetArrayLength (_env, funding_pubkey_arg) == 33); - (*_env)->GetByteArrayRegion (_env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form); - LDKPublicKey revocation_basepoint_arg_ref; - CHECK((*_env)->GetArrayLength (_env, revocation_basepoint_arg) == 33); - (*_env)->GetByteArrayRegion (_env, revocation_basepoint_arg, 0, 33, revocation_basepoint_arg_ref.compressed_form); - LDKPublicKey payment_point_arg_ref; - CHECK((*_env)->GetArrayLength (_env, payment_point_arg) == 33); - (*_env)->GetByteArrayRegion (_env, payment_point_arg, 0, 33, payment_point_arg_ref.compressed_form); - LDKPublicKey delayed_payment_basepoint_arg_ref; - CHECK((*_env)->GetArrayLength (_env, delayed_payment_basepoint_arg) == 33); - (*_env)->GetByteArrayRegion (_env, delayed_payment_basepoint_arg, 0, 33, delayed_payment_basepoint_arg_ref.compressed_form); - LDKPublicKey htlc_basepoint_arg_ref; - CHECK((*_env)->GetArrayLength (_env, htlc_basepoint_arg) == 33); - (*_env)->GetByteArrayRegion (_env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form); - LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref); - 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; + LDKCVec_SignatureZ val_constr; + val_constr.datalen = (*_env)->GetArrayLength (_env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + val_constr.data = NULL; + for (size_t i = 0; i < val_constr.datalen; i++) { + jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, val, i); + LDKSignature arr_conv_8_ref; + CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 64); + (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form); + val_constr.data[i] = arr_conv_8_ref; } - return ret_ref; + HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKChannelPublicKeys obj_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKHolderCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = ChannelPublicKeys_write(&obj_conv); + LDKCVec_u8Z arg_var = HolderCommitmentTransaction_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKChannelPublicKeys ret_var = ChannelPublicKeys_read(ser_ref); + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_read(ser_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; @@ -13009,53 +15286,56 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEn return ret_ref; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new(JNIEnv * _env, jclass _b, jbyteArray per_commitment_point, jbyteArray broadcaster_delayed_payment_base, jbyteArray broadcaster_htlc_base, jbyteArray countersignatory_revocation_base, jbyteArray countersignatory_htlc_base) { - LDKPublicKey per_commitment_point_ref; - CHECK((*_env)->GetArrayLength (_env, per_commitment_point) == 33); - (*_env)->GetByteArrayRegion (_env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - LDKPublicKey broadcaster_delayed_payment_base_ref; - CHECK((*_env)->GetArrayLength (_env, broadcaster_delayed_payment_base) == 33); - (*_env)->GetByteArrayRegion (_env, broadcaster_delayed_payment_base, 0, 33, broadcaster_delayed_payment_base_ref.compressed_form); - LDKPublicKey broadcaster_htlc_base_ref; - CHECK((*_env)->GetArrayLength (_env, broadcaster_htlc_base) == 33); - (*_env)->GetByteArrayRegion (_env, broadcaster_htlc_base, 0, 33, broadcaster_htlc_base_ref.compressed_form); - LDKPublicKey countersignatory_revocation_base_ref; - CHECK((*_env)->GetArrayLength (_env, countersignatory_revocation_base) == 33); - (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base, 0, 33, countersignatory_revocation_base_ref.compressed_form); - LDKPublicKey countersignatory_htlc_base_ref; - CHECK((*_env)->GetArrayLength (_env, countersignatory_htlc_base) == 33); - (*_env)->GetByteArrayRegion (_env, countersignatory_htlc_base, 0, 33, countersignatory_htlc_base_ref.compressed_form); - LDKCResult_TxCreationKeysSecpErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ"); - *ret_conv = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref); - return (long)ret_conv; -} - -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv * _env, jclass _b, jbyteArray revocation_key, jshort contest_delay, jbyteArray broadcaster_delayed_payment_key) { - LDKPublicKey revocation_key_ref; - CHECK((*_env)->GetArrayLength (_env, revocation_key) == 33); - (*_env)->GetByteArrayRegion (_env, revocation_key, 0, 33, revocation_key_ref.compressed_form); - LDKPublicKey broadcaster_delayed_payment_key_ref; - CHECK((*_env)->GetArrayLength (_env, broadcaster_delayed_payment_key) == 33); - (*_env)->GetByteArrayRegion (_env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); - LDKCVec_u8Z arg_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); - return arg_arr; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new(JNIEnv * _env, jclass _b, jlong commitment_tx, jbyteArray counterparty_sig, jobjectArray counterparty_htlc_sigs, jbyteArray holder_funding_key, jbyteArray counterparty_funding_key) { + LDKCommitmentTransaction commitment_tx_conv; + commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); + commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); + if (commitment_tx_conv.inner != NULL) + commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); + LDKSignature counterparty_sig_ref; + CHECK((*_env)->GetArrayLength (_env, counterparty_sig) == 64); + (*_env)->GetByteArrayRegion (_env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form); + LDKCVec_SignatureZ counterparty_htlc_sigs_constr; + counterparty_htlc_sigs_constr.datalen = (*_env)->GetArrayLength (_env, counterparty_htlc_sigs); + if (counterparty_htlc_sigs_constr.datalen > 0) + counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + counterparty_htlc_sigs_constr.data = NULL; + for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) { + jobject arr_conv_8 = (*_env)->GetObjectArrayElement(_env, counterparty_htlc_sigs, i); + LDKSignature arr_conv_8_ref; + CHECK((*_env)->GetArrayLength (_env, arr_conv_8) == 64); + (*_env)->GetByteArrayRegion (_env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form); + counterparty_htlc_sigs_constr.data[i] = arr_conv_8_ref; + } + LDKPublicKey holder_funding_key_ref; + CHECK((*_env)->GetArrayLength (_env, holder_funding_key) == 33); + (*_env)->GetByteArrayRegion (_env, holder_funding_key, 0, 33, holder_funding_key_ref.compressed_form); + LDKPublicKey counterparty_funding_key_ref; + CHECK((*_env)->GetArrayLength (_env, counterparty_funding_key) == 33); + (*_env)->GetByteArrayRegion (_env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form); + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_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_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - HTLCOutputInCommitment_free(this_ptr_conv); + BuiltCommitmentTransaction_free(this_ptr_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv * _env, jclass _b, jlong orig) { - LDKHTLCOutputInCommitment orig_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKBuiltCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_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; @@ -13065,86 +15345,83 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - jboolean ret_val = HTLCOutputInCommitment_get_offered(&this_ptr_conv); - return ret_val; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); -} - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - jlong ret_val = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); - return ret_val; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); -} - -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jint ret_val = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); - return ret_val; + LDKTransaction arg_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); + Transaction_free(arg_var); + return arg_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) { - LDKHTLCOutputInCommitment this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); + LDKTransaction val_ref; + val_ref.datalen = (*_env)->GetArrayLength (_env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); + (*_env)->GetByteArrayRegion(_env, val, 0, val_ref.datalen, val_ref.data); + val_ref.data_is_owned = true; + BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv)); + (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKHTLCOutputInCommitment this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { + LDKBuiltCommitmentTransaction 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); - HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); + BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref); } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) { - LDKHTLCOutputInCommitment obj_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new(JNIEnv * _env, jclass _b, jbyteArray transaction_arg, jbyteArray txid_arg) { + LDKTransaction transaction_arg_ref; + transaction_arg_ref.datalen = (*_env)->GetArrayLength (_env, transaction_arg); + transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes"); + (*_env)->GetByteArrayRegion(_env, transaction_arg, 0, transaction_arg_ref.datalen, transaction_arg_ref.data); + transaction_arg_ref.data_is_owned = true; + LDKThirtyTwoBytes txid_arg_ref; + CHECK((*_env)->GetArrayLength (_env, txid_arg) == 32); + (*_env)->GetByteArrayRegion (_env, txid_arg, 0, 32, txid_arg_ref.data); + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_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 jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKBuiltCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; - LDKCVec_u8Z arg_var = HTLCOutputInCommitment_write(&obj_conv); + LDKCVec_u8Z arg_var = BuiltCommitmentTransaction_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_read(ser_ref); + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_read(ser_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; @@ -13155,67 +15432,48 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read( return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) { - LDKHTLCOutputInCommitment htlc_conv; - htlc_conv.inner = (void*)(htlc & (~1)); - htlc_conv.is_owned = false; - LDKTxCreationKeys keys_conv; - keys_conv.inner = (void*)(keys & (~1)); - keys_conv.is_owned = false; - LDKCVec_u8Z arg_var = get_htlc_redeemscript(&htlc_conv, &keys_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); - return arg_arr; -} - -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jbyteArray broadcaster, jbyteArray countersignatory) { - LDKPublicKey broadcaster_ref; - CHECK((*_env)->GetArrayLength (_env, broadcaster) == 33); - (*_env)->GetByteArrayRegion (_env, broadcaster, 0, 33, broadcaster_ref.compressed_form); - LDKPublicKey countersignatory_ref; - CHECK((*_env)->GetArrayLength (_env, countersignatory) == 33); - (*_env)->GetByteArrayRegion (_env, countersignatory, 0, 33, countersignatory_ref.compressed_form); - LDKCVec_u8Z arg_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1sighash_1all(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray funding_redeemscript, jlong channel_value_satoshis) { + LDKBuiltCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = (*_env)->GetArrayLength (_env, funding_redeemscript); + funding_redeemscript_ref.data = (*_env)->GetByteArrayElements (_env, funding_redeemscript, NULL); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data); + (*_env)->ReleaseByteArrayElements(_env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); return arg_arr; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv * _env, jclass _b, jbyteArray prev_hash, jint feerate_per_kw, jshort contest_delay, jlong htlc, jbyteArray broadcaster_delayed_payment_key, jbyteArray revocation_key) { - unsigned char prev_hash_arr[32]; - CHECK((*_env)->GetArrayLength (_env, prev_hash) == 32); - (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr); - unsigned char (*prev_hash_ref)[32] = &prev_hash_arr; - LDKHTLCOutputInCommitment htlc_conv; - htlc_conv.inner = (void*)(htlc & (~1)); - htlc_conv.is_owned = false; - LDKPublicKey broadcaster_delayed_payment_key_ref; - CHECK((*_env)->GetArrayLength (_env, broadcaster_delayed_payment_key) == 33); - (*_env)->GetByteArrayRegion (_env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); - LDKPublicKey revocation_key_ref; - CHECK((*_env)->GetArrayLength (_env, revocation_key) == 33); - (*_env)->GetByteArrayRegion (_env, revocation_key, 0, 33, revocation_key_ref.compressed_form); - LDKTransaction arg_var = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - Transaction_free(arg_var); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray funding_key, jbyteArray funding_redeemscript, jlong channel_value_satoshis) { + LDKBuiltCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + unsigned char funding_key_arr[32]; + CHECK((*_env)->GetArrayLength (_env, funding_key) == 32); + (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr); + unsigned char (*funding_key_ref)[32] = &funding_key_arr; + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = (*_env)->GetArrayLength (_env, funding_redeemscript); + funding_redeemscript_ref.data = (*_env)->GetByteArrayElements (_env, funding_redeemscript, NULL); + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form); + (*_env)->ReleaseByteArrayElements(_env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); return arg_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHolderCommitmentTransaction this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - HolderCommitmentTransaction_free(this_ptr_conv); + CommitmentTransaction_free(this_ptr_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv * _env, jclass _b, jlong orig) { - LDKHolderCommitmentTransaction orig_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv * _env, jclass _b, jlong orig) { + LDKCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); + LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_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; @@ -13225,119 +15483,69 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1 return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKTransaction arg_var = HolderCommitmentTransaction_get_unsigned_tx(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKCommitmentTransaction obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = CommitmentTransaction_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - Transaction_free(arg_var); - return arg_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKTransaction val_ref; - val_ref.datalen = (*_env)->GetArrayLength (_env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, val, 0, val_ref.datalen, val_ref.data); - val_ref.data_is_owned = true; - HolderCommitmentTransaction_set_unsigned_tx(&this_ptr_conv, val_ref); -} - -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form); + CVec_u8Z_free(arg_var); return arg_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKSignature val_ref; - CHECK((*_env)->GetArrayLength (_env, val) == 64); - (*_env)->GetByteArrayRegion (_env, val, 0, 64, val_ref.compact_form); - HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); + ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); + LDKCommitmentTransaction ret_var = CommitmentTransaction_read(ser_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; + } + (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); + return ret_ref; } -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - jint ret_val = HolderCommitmentTransaction_get_feerate_per_kw(&this_ptr_conv); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + jlong ret_val = CommitmentTransaction_commitment_number(&this_arg_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - HolderCommitmentTransaction_set_feerate_per_kw(&this_ptr_conv, val); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + jlong ret_val = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); + return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlongArray val) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_constr; - val_constr.datalen = (*_env)->GetArrayLength (_env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ Elements"); - else - val_constr.data = NULL; - long* val_vals = (*_env)->GetLongArrayElements (_env, val, NULL); - for (size_t q = 0; q < val_constr.datalen; q++) { - long arr_conv_42 = val_vals[q]; - LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arr_conv_42_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arr_conv_42; - FREE((void*)arr_conv_42); - val_constr.data[q] = arr_conv_42_conv; - } - (*_env)->ReleaseLongArrayElements (_env, val, val_vals, 0); - HolderCommitmentTransaction_set_per_htlc(&this_ptr_conv, val_constr); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + jlong ret_val = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); + return ret_val; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new_1missing_1holder_1sig(JNIEnv * _env, jclass _b, jbyteArray unsigned_tx, jbyteArray counterparty_sig, jbyteArray holder_funding_key, jbyteArray counterparty_funding_key, jlong keys, jint feerate_per_kw, jlongArray htlc_data) { - LDKTransaction unsigned_tx_ref; - unsigned_tx_ref.datalen = (*_env)->GetArrayLength (_env, unsigned_tx); - unsigned_tx_ref.data = MALLOC(unsigned_tx_ref.datalen, "LDKTransaction Bytes"); - (*_env)->GetByteArrayRegion(_env, unsigned_tx, 0, unsigned_tx_ref.datalen, unsigned_tx_ref.data); - unsigned_tx_ref.data_is_owned = true; - LDKSignature counterparty_sig_ref; - CHECK((*_env)->GetArrayLength (_env, counterparty_sig) == 64); - (*_env)->GetByteArrayRegion (_env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form); - LDKPublicKey holder_funding_key_ref; - CHECK((*_env)->GetArrayLength (_env, holder_funding_key) == 33); - (*_env)->GetByteArrayRegion (_env, holder_funding_key, 0, 33, holder_funding_key_ref.compressed_form); - LDKPublicKey counterparty_funding_key_ref; - CHECK((*_env)->GetArrayLength (_env, counterparty_funding_key) == 33); - (*_env)->GetByteArrayRegion (_env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form); - LDKTxCreationKeys keys_conv; - keys_conv.inner = (void*)(keys & (~1)); - keys_conv.is_owned = (keys & 1) || (keys == 0); - if (keys_conv.inner != NULL) - keys_conv = TxCreationKeys_clone(&keys_conv); - LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_constr; - htlc_data_constr.datalen = (*_env)->GetArrayLength (_env, htlc_data); - if (htlc_data_constr.datalen > 0) - htlc_data_constr.data = MALLOC(htlc_data_constr.datalen * sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ Elements"); - else - htlc_data_constr.data = NULL; - long* htlc_data_vals = (*_env)->GetLongArrayElements (_env, htlc_data, NULL); - for (size_t q = 0; q < htlc_data_constr.datalen; q++) { - long arr_conv_42 = htlc_data_vals[q]; - LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arr_conv_42_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arr_conv_42; - FREE((void*)arr_conv_42); - htlc_data_constr.data[q] = arr_conv_42_conv; - } - (*_env)->ReleaseLongArrayElements (_env, htlc_data, htlc_data_vals, 0); - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new_missing_holder_sig(unsigned_tx_ref, counterparty_sig_ref, holder_funding_key_ref, counterparty_funding_key_ref, keys_conv, feerate_per_kw, htlc_data_constr); +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + jint ret_val = CommitmentTransaction_feerate_per_kw(&this_arg_conv); + return ret_val; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_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; @@ -13347,11 +15555,45 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1 return ret_ref; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKHolderCommitmentTransaction this_arg_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1verify(JNIEnv * _env, jclass _b, jlong this_arg, jlong channel_parameters, jlong broadcaster_keys, jlong countersignatory_keys) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKDirectedChannelTransactionParameters channel_parameters_conv; + channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); + channel_parameters_conv.is_owned = false; + LDKChannelPublicKeys broadcaster_keys_conv; + broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); + broadcaster_keys_conv.is_owned = false; + LDKChannelPublicKeys countersignatory_keys_conv; + countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); + countersignatory_keys_conv.is_owned = false; + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); + return (long)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKTrustedCommitmentTransaction this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); + TrustedCommitmentTransaction_free(this_ptr_conv); +} + +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); + (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data); + return arg_arr; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - LDKTxCreationKeys ret_var = HolderCommitmentTransaction_trust_key_derivation(&this_arg_conv); + LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_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; @@ -13361,69 +15603,45 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1 return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) { - LDKHolderCommitmentTransaction this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 32); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 32, HolderCommitmentTransaction_txid(&this_arg_conv).data); - return arg_arr; -} - -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1holder_1sig(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray funding_key, jbyteArray funding_redeemscript, jlong channel_value_satoshis) { - LDKHolderCommitmentTransaction this_arg_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - unsigned char funding_key_arr[32]; - CHECK((*_env)->GetArrayLength (_env, funding_key) == 32); - (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr); - unsigned char (*funding_key_ref)[32] = &funding_key_arr; - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = (*_env)->GetArrayLength (_env, funding_redeemscript); - funding_redeemscript_ref.data = (*_env)->GetByteArrayElements (_env, funding_redeemscript, NULL); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, 64); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, 64, HolderCommitmentTransaction_get_holder_sig(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form); - (*_env)->ReleaseByteArrayElements(_env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); - return arg_arr; + LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_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 jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1htlc_1sigs(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_base_key, jshort counterparty_selected_contest_delay) { - LDKHolderCommitmentTransaction this_arg_conv; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_base_key, jlong channel_parameters) { + LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; unsigned char htlc_base_key_arr[32]; CHECK((*_env)->GetArrayLength (_env, htlc_base_key) == 32); (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr); unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr; + LDKDirectedChannelTransactionParameters channel_parameters_conv; + channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); + channel_parameters_conv.is_owned = false; LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); - *ret_conv = HolderCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, counterparty_selected_contest_delay); + *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = HolderCommitmentTransaction_write(&this_ptr_conv); - jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); - (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); - CVec_u8Z_free(arg_var); - return arg_arr; -} - -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jbyteArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); - ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_read(ser_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; - } - (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transaction_1number_1obscure_1factor(JNIEnv * _env, jclass _b, jbyteArray broadcaster_payment_basepoint, jbyteArray countersignatory_payment_basepoint, jboolean outbound_from_broadcaster) { + LDKPublicKey broadcaster_payment_basepoint_ref; + CHECK((*_env)->GetArrayLength (_env, broadcaster_payment_basepoint) == 33); + (*_env)->GetByteArrayRegion (_env, broadcaster_payment_basepoint, 0, 33, broadcaster_payment_basepoint_ref.compressed_form); + LDKPublicKey countersignatory_payment_basepoint_ref; + CHECK((*_env)->GetArrayLength (_env, countersignatory_payment_basepoint) == 33); + (*_env)->GetByteArrayRegion (_env, countersignatory_payment_basepoint, 0, 33, countersignatory_payment_basepoint_ref.compressed_form); + jlong ret_val = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster); + return ret_val; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -13649,8 +15867,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _en LDKRouteHop arr_conv_10_conv; arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1)); arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0); - if (arr_conv_10_conv.inner != NULL) - arr_conv_10_conv = RouteHop_clone(&arr_conv_10_conv); arr_conv_12_constr.data[k] = arr_conv_10_conv; } (*_env)->ReleaseLongArrayElements (_env, arr_conv_12, arr_conv_12_vals, 0); @@ -13680,8 +15896,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jcl LDKRouteHop arr_conv_10_conv; arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1)); arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0); - if (arr_conv_10_conv.inner != NULL) - arr_conv_10_conv = RouteHop_clone(&arr_conv_10_conv); arr_conv_12_constr.data[k] = arr_conv_10_conv; } (*_env)->ReleaseLongArrayElements (_env, arr_conv_12, arr_conv_12_vals, 0); @@ -13697,11 +15911,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jcl return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKRoute this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = Route_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKRoute obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = Route_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); @@ -13712,15 +15926,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jc LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKRoute ret_var = Route_read(ser_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; - } + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = Route_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -13890,8 +16099,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv * _env, jcl LDKRouteHint arr_conv_11_conv; arr_conv_11_conv.inner = (void*)(arr_conv_11 & (~1)); arr_conv_11_conv.is_owned = (arr_conv_11 & 1) || (arr_conv_11 == 0); - if (arr_conv_11_conv.inner != NULL) - arr_conv_11_conv = RouteHint_clone(&arr_conv_11_conv); last_hops_constr.data[l] = arr_conv_11_conv; } (*_env)->ReleaseLongArrayElements (_env, last_hops, last_hops_vals, 0); @@ -13927,14 +16134,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEn NetGraphMsgHandler_free(this_ptr_conv); } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger) { +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jbyteArray genesis_hash, jlong chain_access, jlong logger) { + LDKThirtyTwoBytes genesis_hash_ref; + CHECK((*_env)->GetArrayLength (_env, genesis_hash) == 32); + (*_env)->GetByteArrayRegion (_env, genesis_hash, 0, 32, genesis_hash_ref.data); LDKAccess* chain_access_conv = (LDKAccess*)chain_access; LDKLogger logger_conv = *(LDKLogger*)logger; if (logger_conv.free == LDKLogger_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_clone(logger_conv.this_arg); } - LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(chain_access_conv, logger_conv); + LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(genesis_hash_ref, chain_access_conv, logger_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; @@ -14002,6 +16212,15 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1Routi return (long)ret; } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) { + LDKNetGraphMsgHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv); + return (long)ret; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -14069,6 +16288,32 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1h DirectionalChannelInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) { + LDKDirectionalChannelInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&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_DirectionalChannelInfo_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) { + LDKDirectionalChannelInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + LDKRoutingFees val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + if (val_conv.inner != NULL) + val_conv = RoutingFees_clone(&val_conv); + DirectionalChannelInfo_set_fees(&this_ptr_conv, val_conv); +} + JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr) { LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); @@ -14359,22 +16604,17 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _e LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKRoutingFees ret_var = RoutingFees_read(ser_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; - } + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = RoutingFees_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKRoutingFees this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = RoutingFees_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKRoutingFees obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = RoutingFees_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); @@ -14553,11 +16793,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(JNI return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = NodeAnnouncementInfo_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKNodeAnnouncementInfo obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = NodeAnnouncementInfo_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); @@ -14568,15 +16808,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JN LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_read(ser_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; - } + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = NodeAnnouncementInfo_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) { @@ -14688,11 +16923,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv * _env, return ret_ref; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKNodeInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = NodeInfo_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKNodeInfo obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = NodeInfo_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); @@ -14703,22 +16938,17 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKNodeInfo ret_var = NodeInfo_read(ser_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; - } + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = NodeInfo_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong this_ptr) { - LDKNetworkGraph this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - LDKCVec_u8Z arg_var = NetworkGraph_write(&this_ptr_conv); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) { + LDKNetworkGraph obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + LDKCVec_u8Z arg_var = NetworkGraph_write(&obj_conv); jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen); (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data); CVec_u8Z_free(arg_var); @@ -14729,19 +16959,17 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _ LDKu8slice ser_ref; ser_ref.datalen = (*_env)->GetArrayLength (_env, ser); ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL); - LDKNetworkGraph ret_var = NetworkGraph_read(ser_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; - } + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = NetworkGraph_read(ser_ref); (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0); - return ret_ref; + return (long)ret_conv; } -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) { - LDKNetworkGraph ret_var = NetworkGraph_new(); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b, jbyteArray genesis_hash) { + LDKThirtyTwoBytes genesis_hash_ref; + CHECK((*_env)->GetArrayLength (_env, genesis_hash) == 32); + (*_env)->GetByteArrayRegion (_env, genesis_hash, 0, 32, genesis_hash_ref.data); + LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_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; @@ -14751,6 +16979,56 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _e return ret_ref; } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKNodeAnnouncement msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1unsigned_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKUnsignedNodeAnnouncement msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg, jlong chain_access) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKChannelAnnouncement msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + LDKAccess* chain_access_conv = (LDKAccess*)chain_access; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1unsigned_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg, jlong chain_access) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKUnsignedChannelAnnouncement msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + LDKAccess* chain_access_conv = (LDKAccess*)chain_access; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv); + return (long)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1from_1update(JNIEnv * _env, jclass _b, jlong this_arg, jlong short_channel_id, jboolean is_permanent) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); @@ -14758,3 +17036,27 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1 NetworkGraph_close_channel_from_update(&this_arg_conv, short_channel_id, is_permanent); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKChannelUpdate msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); + return (long)ret_conv; +} + +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned(JNIEnv * _env, jclass _b, jlong this_arg, jlong msg) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKUnsignedChannelUpdate msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); + return (long)ret_conv; +} + diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index 19debd24..cb242a21 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -113,636 +113,476 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_new_1empty_1slice_1vec /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_u8_arr_info + * Method: LDKCVec_u8Z_arr_info * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1arr_1info +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u8Z_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_u8_new + * Method: LDKCVec_u8Z_new * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u8Z_1new (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: LDKC2TupleTempl_usize__Transaction_new - * Signature: (J[B)J + * Method: LDKC2Tuple_u64u64Z_new + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1usize_1_1Transaction_1new - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_usizeTransactionZ_get_a + * Method: LDKC2Tuple_u64u64Z_get_a * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_usizeTransactionZ_get_b - * Signature: (J)[B + * Method: LDKC2Tuple_u64u64Z_get_b + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1b +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok - * Signature: (J)Z + * Method: LDKSpendableOutputDescriptor_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKSpendableOutputDescriptor; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok - * Signature: (J)B + * Method: LDKCVec_SpendableOutputDescriptorZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SpendableOutputDescriptorZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneChannelMonitorUpdateErrZ_get_err - * Signature: (J)Lorg/ldk/enums/LDKChannelMonitorUpdateErr; + * Method: LDKCVec_SpendableOutputDescriptorZ_new + * Signature: ([J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SpendableOutputDescriptorZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneMonitorUpdateErrorZ_result_ok - * Signature: (J)Z + * Method: LDKErrorAction_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKErrorAction; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneMonitorUpdateErrorZ_get_ok - * Signature: (J)B + * Method: LDKHTLCFailChannelUpdate_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKHTLCFailChannelUpdate; */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneMonitorUpdateErrorZ_get_err - * Signature: (J)J + * Method: LDKMessageSendEvent_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageSendEvent; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2TupleTempl_OutPoint__CVec_u8Z_new - * Signature: (J[B)J + * Method: LDKCVec_MessageSendEventZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1OutPoint_1_1CVec_1u8Z_1new - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MessageSendEventZ_1arr_1info + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_OutPointScriptZ_get_a - * Signature: (J)J + * Method: LDKCVec_MessageSendEventZ_new + * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1get_1a - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MessageSendEventZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_OutPointScriptZ_get_b - * Signature: (J)[B + * Method: LDKEvent_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKEvent; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1get_1b +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_TxOut_arr_info + * Method: LDKCVec_EventZ_arr_info * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1arr_1info +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1EventZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_TxOut_new + * Method: LDKCVec_EventZ_new * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1EventZ_1new (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_new - * Signature: ([B[J)J + * Method: LDKC2Tuple_usizeTransactionZ_new + * Signature: (J[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1new - (JNIEnv *, jclass, jbyteArray, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1new + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_TxidCVec_TxOutZZ_get_a - * Signature: (J)[B + * Method: LDKC2Tuple_usizeTransactionZ_get_a + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1TxOutZZ_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_TxidCVec_TxOutZZ_get_b - * Signature: (J)[J + * Method: LDKC2Tuple_usizeTransactionZ_get_b + * Signature: (J)[B */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1TxOutZZ_1get_1b +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2TupleTempl_u64__u64_new - * Signature: (JJ)J + * Method: LDKCVec_C2Tuple_usizeTransactionZZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1u64_1_1u64_1new - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1usizeTransactionZZ_1arr_1info + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_u64u64Z_get_a - * Signature: (J)J + * Method: LDKCVec_C2Tuple_usizeTransactionZZ_new + * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1a - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1usizeTransactionZZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_u64u64Z_get_b - * Signature: (J)J + * Method: LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1b +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_Signature_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; + * Method: LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok + * Signature: (J)V */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Signature_1arr_1info +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2TupleTempl_Signature__CVecTempl_Signature_new - * Signature: ([B[[B)J + * Method: LDKCResult_NoneChannelMonitorUpdateErrZ_get_err + * Signature: (J)Lorg/ldk/enums/LDKChannelMonitorUpdateErr; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1Signature_1_1CVecTempl_1Signature_1new - (JNIEnv *, jclass, jbyteArray, jobjectArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_SignatureCVec_SignatureZZ_get_a - * Signature: (J)[B + * Method: LDKCVec_MonitorEventZ_arr_info + * Signature: (J)[J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1a +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_SignatureCVec_SignatureZZ_get_b - * Signature: (J)[[B + * Method: LDKCVec_MonitorEventZ_new + * Signature: ([J)J */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1b - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok + * Method: LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok + * Method: LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err - * Signature: (J)B + * Method: LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_SignatureNoneZ_result_ok + * Method: LDKCResult_NoneMonitorUpdateErrorZ_result_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_SignatureNoneZ_get_ok - * Signature: (J)[B + * Method: LDKCResult_NoneMonitorUpdateErrorZ_get_ok + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_SignatureNoneZ_get_err - * Signature: (J)B + * Method: LDKCResult_NoneMonitorUpdateErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_CVec_SignatureZNoneZ_result_ok - * Signature: (J)Z + * Method: LDKC2Tuple_OutPointScriptZ_new + * Signature: (J[B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1new + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_CVec_SignatureZNoneZ_get_ok - * Signature: (J)[[B + * Method: LDKC2Tuple_OutPointScriptZ_get_a + * Signature: (J)J */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_CVec_SignatureZNoneZ_get_err - * Signature: (J)B + * Method: LDKC2Tuple_OutPointScriptZ_get_b + * Signature: (J)[B */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1err +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKAPIError_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKAPIError; + * Method: LDKCVec_TransactionZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TransactionZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneAPIErrorZ_result_ok - * Signature: (J)Z + * Method: LDKC2Tuple_u32TxOutZ_new + * Signature: (IJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32TxOutZ_1new + (JNIEnv *, jclass, jint, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneAPIErrorZ_get_ok - * Signature: (J)B + * Method: LDKC2Tuple_u32TxOutZ_get_a + * Signature: (J)I */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1ok +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32TxOutZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneAPIErrorZ_get_err + * Method: LDKC2Tuple_u32TxOutZ_get_b * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32TxOutZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NonePaymentSendFailureZ_result_ok - * Signature: (J)Z + * Method: LDKCVec_C2Tuple_u32TxOutZZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32TxOutZZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NonePaymentSendFailureZ_get_ok - * Signature: (J)B + * Method: LDKCVec_C2Tuple_u32TxOutZZ_new + * Signature: ([J)J */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32TxOutZZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NonePaymentSendFailureZ_get_err - * Signature: (J)J + * Method: LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new + * Signature: ([B[J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new + (JNIEnv *, jclass, jbyteArray, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_new - * Signature: (JJJ)J + * Method: LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1new - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1a + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a - * Signature: (J)J + * Method: LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b - * Signature: (J)J + * Method: LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c - * Signature: (J)J + * Method: LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new + * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NonePeerHandleErrorZ_result_ok - * Signature: (J)Z + * Method: LDKCVec_SignatureZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SignatureZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NonePeerHandleErrorZ_get_ok - * Signature: (J)B + * Method: LDKC2Tuple_SignatureCVec_SignatureZZ_new + * Signature: ([B[[B)J */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1new + (JNIEnv *, jclass, jbyteArray, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NonePeerHandleErrorZ_get_err - * Signature: (J)J + * Method: LDKC2Tuple_SignatureCVec_SignatureZZ_get_a + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1err +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2TupleTempl_HTLCOutputInCommitment__Signature_new - * Signature: (J[B)J + * Method: LDKC2Tuple_SignatureCVec_SignatureZZ_get_b + * Signature: (J)[[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1new - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1b + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_HTLCOutputInCommitmentSignatureZ_get_a - * Signature: (J)J + * Method: LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1HTLCOutputInCommitmentSignatureZ_1get_1a +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKC2Tuple_HTLCOutputInCommitmentSignatureZ_get_b - * Signature: (J)[B + * Method: LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1HTLCOutputInCommitmentSignatureZ_1get_1b +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKSpendableOutputDescriptor_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKSpendableOutputDescriptor; + * Method: LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err + * Signature: (J)V */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_SpendableOutputDescriptor_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; + * Method: LDKCResult_SignatureNoneZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1arr_1info +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_SpendableOutputDescriptor_new - * Signature: ([J)J + * Method: LDKCResult_SignatureNoneZ_get_ok + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKEvent_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKEvent; + * Method: LDKCResult_SignatureNoneZ_get_err + * Signature: (J)V */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKErrorAction_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKErrorAction; + * Method: LDKCResult_CVec_SignatureZNoneZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKHTLCFailChannelUpdate_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKHTLCFailChannelUpdate; + * Method: LDKCResult_CVec_SignatureZNoneZ_get_ok + * Signature: (J)[[B */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_1ref_1from_1ptr +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKMessageSendEvent_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageSendEvent; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_MessageSendEvent_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1arr_1info - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_MessageSendEvent_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKMessageSendEventsProvider_new - * Signature: (Lorg/ldk/impl/bindings/LDKMessageSendEventsProvider;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKMessageSendEventsProvider_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageSendEventsProvider; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: MessageSendEventsProvider_get_and_clear_pending_msg_events - * Signature: (J)[J - */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_Event_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1arr_1info - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_Event_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKEventsProvider_new - * Signature: (Lorg/ldk/impl/bindings/LDKEventsProvider;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKEventsProvider_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKEventsProvider; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: EventsProvider_get_and_clear_pending_events - * Signature: (J)[J - */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_EventsProvider_1get_1and_1clear_1pending_1events - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKLogger_new - * Signature: (Lorg/ldk/impl/bindings/LDKLogger;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKLogger_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKLogger; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_TxOutAccessErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_TxOutAccessErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_TxOutAccessErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/LDKAccessError; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKAccess_new - * Signature: (Lorg/ldk/impl/bindings/LDKAccess;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKAccess_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKAccess; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Access_get_utxo - * Signature: (J[BJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo - (JNIEnv *, jclass, jlong, jbyteArray, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_HTLCOutputInCommitment_arr_info - * Signature: (J)[J + * Method: LDKCResult_CVec_SignatureZNoneZ_get_err + * Signature: (J)V */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1arr_1info +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_HTLCOutputInCommitment_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1new - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: LDKChannelKeys_new @@ -786,10 +626,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1key_1derivation_ /* * Class: org_ldk_impl_bindings * Method: ChannelKeys_sign_counterparty_commitment - * Signature: (JI[BJ[J)J + * Signature: (JJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1commitment - (JNIEnv *, jclass, jlong, jint, jbyteArray, jlong, jlongArray); + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -841,11 +681,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1channel_1a /* * Class: org_ldk_impl_bindings - * Method: ChannelKeys_on_accept - * Signature: (JJSS)V + * Method: ChannelKeys_ready_channel + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1on_1accept - (JNIEnv *, jclass, jlong, jlong, jshort, jshort); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1ready_1channel + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -865,1635 +705,3251 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1get_1pubkeys /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_MonitorEvent_arr_info - * Signature: (J)[J + * Method: LDKC2Tuple_BlockHashChannelMonitorZ_new + * Signature: ([BJ)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1arr_1info - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelMonitorZ_1new + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_MonitorEvent_new - * Signature: ([J)J + * Method: LDKC2Tuple_BlockHashChannelMonitorZ_get_a + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelMonitorZ_1get_1a + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKWatch_new - * Signature: (Lorg/ldk/impl/bindings/LDKWatch;)J + * Method: LDKC2Tuple_BlockHashChannelMonitorZ_get_b + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelMonitorZ_1get_1b + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKWatch_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKWatch; + * Method: LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Watch_watch_channel - * Signature: (JJJ)J + * Method: LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Watch_update_channel - * Signature: (JJJ)J + * Method: LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Watch_release_pending_monitor_events - * Signature: (J)[J + * Method: LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKFilter_new - * Signature: (Lorg/ldk/impl/bindings/LDKFilter;)J + * Method: LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKFilter_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKFilter; + * Method: LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Filter_register_tx - * Signature: (J[B[B)V + * Method: LDKCResult_ChanKeySignerDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChanKeySignerDecodeErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Filter_register_output - * Signature: (JJ[B)V + * Method: LDKCResult_ChanKeySignerDecodeErrorZ_get_ok + * Signature: (J)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_LDKCResult_1ChanKeySignerDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKBroadcasterInterface_new - * Signature: (Lorg/ldk/impl/bindings/LDKBroadcasterInterface;)J + * Method: LDKCResult_ChanKeySignerDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChanKeySignerDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKBroadcasterInterface_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKBroadcasterInterface; + * Method: LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BroadcasterInterface_broadcast_transaction - * Signature: (J[B)V + * Method: LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKFeeEstimator_new - * Signature: (Lorg/ldk/impl/bindings/LDKFeeEstimator;)J + * Method: LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKFeeEstimator_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKFeeEstimator; + * Method: LDKCResult_TxOutAccessErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FeeEstimator_get_est_sat_per_1000_weight - * Signature: (JLorg/ldk/enums/LDKConfirmationTarget;)I + * Method: LDKCResult_TxOutAccessErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1per_11000_1weight - (JNIEnv *, jclass, jlong, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_C2TupleTempl_usize__Transaction_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; + * Method: LDKCResult_TxOutAccessErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/LDKAccessError; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1arr_1info +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_C2TupleTempl_usize__Transaction_new - * Signature: ([J)J + * Method: LDKAPIError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKAPIError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_Transaction_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1arr_1info +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; + * Method: LDKCResult_NoneAPIErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1arr_1info +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_new - * Signature: ([J)J + * Method: LDKCResult_NoneAPIErrorZ_get_ok + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKKeysInterface_new - * Signature: (Lorg/ldk/impl/bindings/LDKKeysInterface;)J + * Method: LDKCResult_NoneAPIErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKKeysInterface_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKKeysInterface; + * Method: LDKCVec_ChannelDetailsZ_arr_info + * Signature: (J)[J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysInterface_get_node_secret - * Signature: (J)[B + * Method: LDKCVec_ChannelDetailsZ_new + * Signature: ([J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: KeysInterface_get_destination_script - * Signature: (J)[B + * Method: LDKCResult_NonePaymentSendFailureZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1destination_1script +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysInterface_get_shutdown_pubkey - * Signature: (J)[B + * Method: LDKCResult_NonePaymentSendFailureZ_get_ok + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_1pubkey +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysInterface_get_channel_keys - * Signature: (JZJ)J + * Method: LDKCResult_NonePaymentSendFailureZ_get_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1keys - (JNIEnv *, jclass, jlong, jboolean, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: KeysInterface_get_secure_random_bytes - * Signature: (J)[B + * Method: LDKNetAddress_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKNetAddress; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1secure_1random_1bytes +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_ChannelDetails_arr_info - * Signature: (J)[J + * Method: LDKCVec_NetAddressZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1arr_1info +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NetAddressZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_ChannelDetails_new + * Method: LDKCVec_NetAddressZ_new * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NetAddressZ_1new (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKNetAddress_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKNetAddress; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_NetAddress_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; + * Method: LDKCVec_ChannelMonitorZ_arr_info + * Signature: (J)[J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1arr_1info +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_NetAddress_new + * Method: LDKCVec_ChannelMonitorZ_new * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1new (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKChannelMessageHandler_new - * Signature: (Lorg/ldk/impl/bindings/LDKChannelMessageHandler;Lorg/ldk/impl/bindings/LDKMessageSendEventsProvider;)J + * Method: LDKWatch_new + * Signature: (Lorg/ldk/impl/bindings/LDKWatch;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new - (JNIEnv *, jclass, jobject, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: LDKChannelMessageHandler_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKChannelMessageHandler; + * Method: LDKWatch_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKWatch; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_open_channel - * Signature: (J[BJJ)V + * Method: Watch_watch_channel + * Signature: (JJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1open_1channel - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_accept_channel - * Signature: (J[BJJ)V + * Method: Watch_update_channel + * Signature: (JJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1accept_1channel - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_funding_created - * Signature: (J[BJ)V + * Method: Watch_release_pending_monitor_events + * Signature: (J)[J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1created - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_funding_signed - * Signature: (J[BJ)V + * Method: LDKBroadcasterInterface_new + * Signature: (Lorg/ldk/impl/bindings/LDKBroadcasterInterface;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1signed - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_funding_locked - * Signature: (J[BJ)V + * Method: LDKBroadcasterInterface_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKBroadcasterInterface; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1locked - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_shutdown - * Signature: (J[BJ)V + * Method: BroadcasterInterface_broadcast_transaction + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_closing_signed - * Signature: (J[BJ)V + * Method: LDKKeysInterface_new + * Signature: (Lorg/ldk/impl/bindings/LDKKeysInterface;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1closing_1signed - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_update_add_htlc - * Signature: (J[BJ)V + * Method: LDKKeysInterface_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKKeysInterface; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1add_1htlc - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_update_fulfill_htlc - * Signature: (J[BJ)V + * Method: KeysInterface_get_node_secret + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fulfill_1htlc - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_update_fail_htlc - * Signature: (J[BJ)V + * Method: KeysInterface_get_destination_script + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1htlc - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1destination_1script + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_update_fail_malformed_htlc - * Signature: (J[BJ)V + * Method: KeysInterface_get_shutdown_pubkey + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1malformed_1htlc - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_1pubkey + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_commitment_signed - * Signature: (J[BJ)V + * Method: KeysInterface_get_channel_keys + * Signature: (JZJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1commitment_1signed - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1keys + (JNIEnv *, jclass, jlong, jboolean, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_revoke_and_ack - * Signature: (J[BJ)V + * Method: KeysInterface_get_secure_random_bytes + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1revoke_1and_1ack - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1secure_1random_1bytes + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_update_fee - * Signature: (J[BJ)V + * Method: KeysInterface_read_chan_signer + * Signature: (J[B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fee - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1read_1chan_1signer + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_announcement_signatures - * Signature: (J[BJ)V + * Method: LDKFeeEstimator_new + * Signature: (Lorg/ldk/impl/bindings/LDKFeeEstimator;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1announcement_1signatures - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_peer_disconnected - * Signature: (J[BZ)V + * Method: LDKFeeEstimator_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKFeeEstimator; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1disconnected - (JNIEnv *, jclass, jlong, jbyteArray, jboolean); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_peer_connected - * Signature: (J[BJ)V + * Method: FeeEstimator_get_est_sat_per_1000_weight + * Signature: (JLorg/ldk/enums/LDKConfirmationTarget;)I */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1per_11000_1weight + (JNIEnv *, jclass, jlong, jobject); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_channel_reestablish - * Signature: (J[BJ)V + * Method: LDKLogger_new + * Signature: (Lorg/ldk/impl/bindings/LDKLogger;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_error - * Signature: (J[BJ)V + * Method: LDKLogger_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKLogger; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1error - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_ChannelMonitor_arr_info - * Signature: (J)[J + * Method: LDKC2Tuple_BlockHashChannelManagerZ_new + * Signature: ([BJ)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1arr_1info - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelManagerZ_1new + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_ChannelMonitor_new - * Signature: ([J)J + * Method: LDKC2Tuple_BlockHashChannelManagerZ_get_a + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelManagerZ_1get_1a + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_u64_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; + * Method: LDKC2Tuple_BlockHashChannelManagerZ_get_b + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1arr_1info +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelManagerZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_u64_new - * Signature: ([J)J + * Method: LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_UpdateAddHTLC_arr_info - * Signature: (J)[J + * Method: LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1arr_1info +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_UpdateAddHTLC_new - * Signature: ([J)J + * Method: LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_UpdateFulfillHTLC_arr_info - * Signature: (J)[J + * Method: LDKCResult_NetAddressu8Z_result_ok + * Signature: (J)Z */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1arr_1info +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_UpdateFulfillHTLC_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_UpdateFailHTLC_arr_info - * Signature: (J)[J + * Method: LDKCResult_NetAddressu8Z_get_ok + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1arr_1info +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_UpdateFailHTLC_new - * Signature: ([J)J + * Method: LDKCResult_NetAddressu8Z_get_err + * Signature: (J)B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_UpdateFailMalformedHTLC_arr_info - * Signature: (J)[J + * Method: LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1arr_1info +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_UpdateFailMalformedHTLC_new - * Signature: ([J)J + * Method: LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_boolLightningErrorZ_result_ok - * Signature: (J)Z + * Method: LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_boolLightningErrorZ_get_ok - * Signature: (J)Z + * Method: LDKCVec_u64Z_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_boolLightningErrorZ_get_err - * Signature: (J)J + * Method: LDKCVec_u64Z_new + * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; + * Method: LDKCVec_UpdateAddHTLCZ_arr_info + * Signature: (J)[J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1arr_1info +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_new + * Method: LDKCVec_UpdateAddHTLCZ_new * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1new (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_NodeAnnouncement_arr_info + * Method: LDKCVec_UpdateFulfillHTLCZ_arr_info * Signature: (J)[J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1arr_1info +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFulfillHTLCZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_NodeAnnouncement_new + * Method: LDKCVec_UpdateFulfillHTLCZ_new * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFulfillHTLCZ_1new (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKRoutingMessageHandler_new - * Signature: (Lorg/ldk/impl/bindings/LDKRoutingMessageHandler;)J + * Method: LDKCVec_UpdateFailHTLCZ_arr_info + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new - (JNIEnv *, jclass, jobject); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailHTLCZ_1arr_1info + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKRoutingMessageHandler_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKRoutingMessageHandler; + * Method: LDKCVec_UpdateFailHTLCZ_new + * Signature: ([J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailHTLCZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: RoutingMessageHandler_handle_node_announcement - * Signature: (JJ)J + * Method: LDKCVec_UpdateFailMalformedHTLCZ_arr_info + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailMalformedHTLCZ_1arr_1info + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingMessageHandler_handle_channel_announcement - * Signature: (JJ)J + * Method: LDKCVec_UpdateFailMalformedHTLCZ_new + * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailMalformedHTLCZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: RoutingMessageHandler_handle_channel_update - * Signature: (JJ)J + * Method: LDKCResult_boolLightningErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingMessageHandler_handle_htlc_fail_channel_update - * Signature: (JJ)V + * Method: LDKCResult_boolLightningErrorZ_get_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1htlc_1fail_1channel_1update - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingMessageHandler_get_next_channel_announcements - * Signature: (JJB)[J + * Method: LDKCResult_boolLightningErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1channel_1announcements - (JNIEnv *, jclass, jlong, jlong, jbyte); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingMessageHandler_get_next_node_announcements - * Signature: (J[BB)[J + * Method: LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new + * Signature: (JJJ)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1node_1announcements - (JNIEnv *, jclass, jlong, jbyteArray, jbyte); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingMessageHandler_should_request_full_sync - * Signature: (J[B)Z + * Method: LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1should_1request_1full_1sync - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKSocketDescriptor_new - * Signature: (Lorg/ldk/impl/bindings/LDKSocketDescriptor;)J + * Method: LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKSocketDescriptor_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKSocketDescriptor; + * Method: LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SocketDescriptor_send_data - * Signature: (J[BZ)J + * Method: LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data - (JNIEnv *, jclass, jlong, jbyteArray, jboolean); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1arr_1info + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: SocketDescriptor_disconnect_socket - * Signature: (J)V + * Method: LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new + * Signature: ([J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: SocketDescriptor_hash - * Signature: (J)J + * Method: LDKCVec_NodeAnnouncementZ_arr_info + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NodeAnnouncementZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_PublicKey_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; + * Method: LDKCVec_NodeAnnouncementZ_new + * Signature: ([J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1arr_1info - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NodeAnnouncementZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok + * Method: LDKCResult_NoneLightningErrorZ_result_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok - * Signature: (J)[B + * Method: LDKCResult_NoneLightningErrorZ_get_ok + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err + * Method: LDKCResult_NoneLightningErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_boolPeerHandleErrorZ_result_ok + * Method: LDKCResult_ChannelReestablishDecodeErrorZ_result_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_boolPeerHandleErrorZ_get_ok - * Signature: (J)Z + * Method: LDKCResult_ChannelReestablishDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_boolPeerHandleErrorZ_get_err + * Method: LDKCResult_ChannelReestablishDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_SecretKeySecpErrorZ_result_ok + * Method: LDKCResult_InitDecodeErrorZ_result_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_SecretKeySecpErrorZ_get_ok - * Signature: (J)[B + * Method: LDKCResult_InitDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_SecretKeySecpErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/LDKSecp256k1Error; + * Method: LDKCResult_InitDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_PublicKeySecpErrorZ_result_ok + * Method: LDKCResult_PingDecodeErrorZ_result_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_PublicKeySecpErrorZ_get_ok - * Signature: (J)[B + * Method: LDKCResult_PingDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_PublicKeySecpErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/LDKSecp256k1Error; + * Method: LDKCResult_PingDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_TxCreationKeysSecpErrorZ_result_ok + * Method: LDKCResult_PongDecodeErrorZ_result_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_TxCreationKeysSecpErrorZ_get_ok + * Method: LDKCResult_PongDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_TxCreationKeysSecpErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/LDKSecp256k1Error; + * Method: LDKCResult_PongDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; + * Method: LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1arr_1info +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature_new - * Signature: ([J)J + * Method: LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_RouteHop_arr_info - * Signature: (J)[J + * Method: LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1arr_1info +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_RouteHop_new - * Signature: ([J)J + * Method: LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_CVecTempl_RouteHop_arr_info - * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; + * Method: LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1arr_1info +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_RouteLightningErrorZ_result_ok + * Method: LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCResult_ErrorMessageDecodeErrorZ_result_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_RouteLightningErrorZ_get_ok + * Method: LDKCResult_ErrorMessageDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_RouteLightningErrorZ_get_err + * Method: LDKCResult_ErrorMessageDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_RouteHint_arr_info - * Signature: (J)[J + * Method: LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1arr_1info +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVecTempl_RouteHint_new - * Signature: ([J)J + * Method: LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_HTLCOutputInCommitmentSignatureZ_free - * Signature: (J)V + * Method: LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_free - * Signature: (J)V + * Method: LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureCVec_SignatureZZ_free - * Signature: (J)V + * Method: LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_TxOutZZ_free - * Signature: (J)V + * Method: LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u64u64Z_free - * Signature: (J)V + * Method: LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_usizeTransactionZ_free - * Signature: (J)V + * Method: LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free - * Signature: (J)V + * Method: LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free - * Signature: (J)V + * Method: LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok + * Method: LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_SignatureZNoneZ_free - * Signature: (J)V + * Method: LDKCResult_QueryChannelRangeDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_SignatureZNoneZ_ok - * Signature: ([[B)J + * Method: LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_err + * Method: LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_free - * Signature: (J)V + * Method: LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_ok - * Signature: ([B)J + * Method: LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_err + * Method: LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_free - * Signature: (J)V + * Method: LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_err - * Signature: (Lorg/ldk/enums/LDKChannelMonitorUpdateErr;)J + * Method: LDKCVec_PublicKeyZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1PublicKeyZ_1arr_1info + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_free - * Signature: (J)V + * Method: LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneMonitorUpdateErrorZ_err - * Signature: (J)J + * Method: LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneMonitorUpdateErrorZ_free - * Signature: (J)V + * Method: LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_err - * Signature: (J)J + * Method: LDKCResult_NonePeerHandleErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_free + * Method: LDKCResult_NonePeerHandleErrorZ_get_ok * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_err + * Method: LDKCResult_NonePeerHandleErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_free - * Signature: (J)V + * Method: LDKCResult_boolPeerHandleErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeySecpErrorZ_err - * Signature: (Lorg/ldk/enums/LDKSecp256k1Error;)J + * Method: LDKCResult_boolPeerHandleErrorZ_get_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeySecpErrorZ_free - * Signature: (J)V + * Method: LDKCResult_boolPeerHandleErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeySecpErrorZ_ok - * Signature: ([B)J + * Method: LDKCResult_SecretKeySecpErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_err - * Signature: (J)J + * Method: LDKCResult_SecretKeySecpErrorZ_get_ok + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_free - * Signature: (J)V + * Method: LDKCResult_SecretKeySecpErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/LDKSecp256k1Error; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_ok - * Signature: (J)J + * Method: LDKCResult_PublicKeySecpErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeySecpErrorZ_err - * Signature: (Lorg/ldk/enums/LDKSecp256k1Error;)J + * Method: LDKCResult_PublicKeySecpErrorZ_get_ok + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeySecpErrorZ_free - * Signature: (J)V + * Method: LDKCResult_PublicKeySecpErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/LDKSecp256k1Error; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeySecpErrorZ_ok - * Signature: ([B)J + * Method: LDKCResult_TxCreationKeysSecpErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_free - * Signature: (J)V + * Method: LDKCResult_TxCreationKeysSecpErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_ok - * Signature: ([B)J + * Method: LDKCResult_TxCreationKeysSecpErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/LDKSecp256k1Error; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysSecpErrorZ_err - * Signature: (Lorg/ldk/enums/LDKSecp256k1Error;)J + * Method: LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysSecpErrorZ_free + * Method: LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCResult_TrustedCommitmentTransactionNoneZ_get_err * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysSecpErrorZ_ok - * Signature: (J)J + * Method: LDKCVec_RouteHopZ_arr_info + * Signature: (J)[J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_err - * Signature: (Lorg/ldk/enums/LDKAccessError;)J + * Method: LDKCVec_RouteHopZ_new + * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_free - * Signature: (J)V + * Method: LDKCVec_CVec_RouteHopZZ_arr_info + * Signature: (J)Lorg/ldk/impl/bindings/VecOrSliceDef; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVec_1CVec_1RouteHopZZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_ok + * Method: LDKCResult_RouteDecodeErrorZ_result_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCResult_RouteDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_err + * Method: LDKCResult_RouteDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_free - * Signature: (J)V + * Method: LDKCVec_RouteHintZ_arr_info + * Signature: (J)[J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1arr_1info (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_ok - * Signature: (Z)J + * Method: LDKCVec_RouteHintZ_new + * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok - (JNIEnv *, jclass, jboolean); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_err - * Signature: (J)J + * Method: LDKCResult_RouteLightningErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_free - * Signature: (J)V + * Method: LDKCResult_RouteLightningErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_ok - * Signature: (Z)J + * Method: LDKCResult_RouteLightningErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok - (JNIEnv *, jclass, jboolean); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free - * Signature: ([J)V + * Method: LDKCResult_RoutingFeesDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_TxidCVec_TxOutZZZ_free - * Signature: ([J)V + * Method: LDKCResult_RoutingFeesDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1TxOutZZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_usizeTransactionZZ_free - * Signature: ([J)V + * Method: LDKCResult_RoutingFeesDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free - * Signature: ([J)V + * Method: LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_CVec_RouteHopZZ_free - * Signature: ([[J)V + * Method: LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_ChannelDetailsZ_free - * Signature: ([J)V + * Method: LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_ChannelMonitorZ_free - * Signature: ([J)V + * Method: LDKCResult_NodeInfoDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_EventZ_free - * Signature: ([J)V + * Method: LDKCResult_NodeInfoDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_HTLCOutputInCommitmentZ_free - * Signature: ([J)V + * Method: LDKCResult_NodeInfoDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_MessageSendEventZ_free - * Signature: ([J)V + * Method: LDKCResult_NetworkGraphDecodeErrorZ_result_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1result_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_MonitorEventZ_free - * Signature: ([J)V + * Method: LDKCResult_NetworkGraphDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_NetAddressZ_free - * Signature: ([J)V + * Method: LDKCResult_NetworkGraphDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKMessageSendEventsProvider_new + * Signature: (Lorg/ldk/impl/bindings/LDKMessageSendEventsProvider;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKMessageSendEventsProvider_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageSendEventsProvider; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: MessageSendEventsProvider_get_and_clear_pending_msg_events + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKEventsProvider_new + * Signature: (Lorg/ldk/impl/bindings/LDKEventsProvider;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKEventsProvider_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKEventsProvider; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: EventsProvider_get_and_clear_pending_events + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_EventsProvider_1get_1and_1clear_1pending_1events + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKAccess_new + * Signature: (Lorg/ldk/impl/bindings/LDKAccess;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKAccess_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKAccess; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Access_get_utxo + * Signature: (J[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKFilter_new + * Signature: (Lorg/ldk/impl/bindings/LDKFilter;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKFilter_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKFilter; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Filter_register_tx + * Signature: (J[B[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Filter_register_output + * Signature: (JJ[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output + (JNIEnv *, jclass, jlong, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKPersist_new + * Signature: (Lorg/ldk/impl/bindings/LDKPersist;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKPersist_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKPersist; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPersist_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Persist_persist_new_channel + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Persist_update_persisted_channel + * Signature: (JJJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKChannelMessageHandler_new + * Signature: (Lorg/ldk/impl/bindings/LDKChannelMessageHandler;Lorg/ldk/impl/bindings/LDKMessageSendEventsProvider;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new + (JNIEnv *, jclass, jobject, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKChannelMessageHandler_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKChannelMessageHandler; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_open_channel + * Signature: (J[BJJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1open_1channel + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_accept_channel + * Signature: (J[BJJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1accept_1channel + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_funding_created + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1created + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_funding_signed + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1signed + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_funding_locked + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1locked + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_shutdown + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_closing_signed + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1closing_1signed + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_update_add_htlc + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1add_1htlc + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_update_fulfill_htlc + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fulfill_1htlc + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_update_fail_htlc + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1htlc + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_update_fail_malformed_htlc + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1malformed_1htlc + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_commitment_signed + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1commitment_1signed + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_revoke_and_ack + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1revoke_1and_1ack + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_update_fee + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fee + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_announcement_signatures + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1announcement_1signatures + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_peer_disconnected + * Signature: (J[BZ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1disconnected + (JNIEnv *, jclass, jlong, jbyteArray, jboolean); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_peer_connected + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_channel_reestablish + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMessageHandler_handle_error + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1error + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKRoutingMessageHandler_new + * Signature: (Lorg/ldk/impl/bindings/LDKRoutingMessageHandler;Lorg/ldk/impl/bindings/LDKMessageSendEventsProvider;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new + (JNIEnv *, jclass, jobject, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKRoutingMessageHandler_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKRoutingMessageHandler; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_handle_node_announcement + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_handle_channel_announcement + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_handle_channel_update + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_handle_htlc_fail_channel_update + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1htlc_1fail_1channel_1update + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_get_next_channel_announcements + * Signature: (JJB)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1channel_1announcements + (JNIEnv *, jclass, jlong, jlong, jbyte); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_get_next_node_announcements + * Signature: (J[BB)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1node_1announcements + (JNIEnv *, jclass, jlong, jbyteArray, jbyte); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_sync_routing_table + * Signature: (J[BJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1sync_1routing_1table + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_handle_reply_channel_range + * Signature: (J[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1channel_1range + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_handle_reply_short_channel_ids_end + * Signature: (J[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1short_1channel_1ids_1end + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_handle_query_channel_range + * Signature: (J[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1channel_1range + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RoutingMessageHandler_handle_query_short_channel_ids + * Signature: (J[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1short_1channel_1ids + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKSocketDescriptor_new + * Signature: (Lorg/ldk/impl/bindings/LDKSocketDescriptor;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKSocketDescriptor_get_obj_from_jcalls + * Signature: (J)Lorg/ldk/impl/bindings/LDKSocketDescriptor; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: SocketDescriptor_send_data + * Signature: (J[BZ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data + (JNIEnv *, jclass, jlong, jbyteArray, jboolean); + +/* + * Class: org_ldk_impl_bindings + * Method: SocketDescriptor_disconnect_socket + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: SocketDescriptor_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Transaction_free + * Signature: ([B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: TxOut_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TxOut_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_SpendableOutputDescriptorZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_MessageSendEventZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_EventZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_usizeTransactionZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_usizeTransactionZ_new + * Signature: (J[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_usizeTransactionZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneChannelMonitorUpdateErrZ_ok + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneChannelMonitorUpdateErrZ_err + * Signature: (Lorg/ldk/enums/LDKChannelMonitorUpdateErr;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneChannelMonitorUpdateErrZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_MonitorEventZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneMonitorUpdateErrorZ_ok + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneMonitorUpdateErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneMonitorUpdateErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointScriptZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointScriptZ_new + * Signature: (J[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_TransactionZ_free + * Signature: ([[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free + (JNIEnv *, jclass, jobjectArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_u32TxOutZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_u32TxOutZ_new + * Signature: (IJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new + (JNIEnv *, jclass, jint, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_u32TxOutZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new + * Signature: ([B[J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new + (JNIEnv *, jclass, jbyteArray, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_BlockHashChannelMonitorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_BlockHashChannelMonitorZ_new + * Signature: ([BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new + (JNIEnv *, jclass, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_u64u64Z_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_u64u64Z_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_SignatureZ_free + * Signature: ([[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free + (JNIEnv *, jclass, jobjectArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_SignatureCVec_SignatureZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_SignatureCVec_SignatureZZ_new + * Signature: ([B[[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new + (JNIEnv *, jclass, jbyteArray, jobjectArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignatureNoneZ_ok + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignatureNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignatureNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_SignatureZNoneZ_ok + * Signature: ([[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok + (JNIEnv *, jclass, jobjectArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_SignatureZNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_SignatureZNoneZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChanKeySignerDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChanKeySignerDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChanKeySignerDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChanKeySignerDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChanKeySignerDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChanKeySignerDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InMemoryChannelKeysDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InMemoryChannelKeysDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InMemoryChannelKeysDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxOutAccessErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxOutAccessErrorZ_err + * Signature: (Lorg/ldk/enums/LDKAccessError;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxOutAccessErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneAPIErrorZ_ok + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneAPIErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneAPIErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_ChannelDetailsZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonePaymentSendFailureZ_ok + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonePaymentSendFailureZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonePaymentSendFailureZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_NetAddressZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_ChannelMonitorZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_BlockHashChannelManagerZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_BlockHashChannelManagerZ_new + * Signature: ([BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new + (JNIEnv *, jclass, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NetAddressu8Z_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NetAddressu8Z_err + * Signature: (B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1err + (JNIEnv *, jclass, jbyte); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NetAddressu8Z_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CResult_NetAddressu8ZDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CResult_NetAddressu8ZDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CResult_NetAddressu8ZDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_u64Z_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_UpdateAddHTLCZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_UpdateFulfillHTLCZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_UpdateFailHTLCZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_UpdateFailMalformedHTLCZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolLightningErrorZ_ok + * Signature: (Z)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok + (JNIEnv *, jclass, jboolean); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolLightningErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolLightningErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings * Method: CVec_NodeAnnouncementZ_free * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneLightningErrorZ_ok + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneLightningErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneLightningErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelReestablishDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelReestablishDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelReestablishDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PingDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PingDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PingDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PongDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PongDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PongDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedChannelAnnouncementDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedChannelAnnouncementDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedChannelUpdateDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedChannelUpdateDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedChannelUpdateDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ErrorMessageDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ErrorMessageDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ErrorMessageDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedNodeAnnouncementDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedNodeAnnouncementDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_QueryShortChannelIdsDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_QueryShortChannelIdsDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_QueryShortChannelIdsDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReplyShortChannelIdsEndDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReplyShortChannelIdsEndDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_QueryChannelRangeDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_QueryChannelRangeDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_QueryChannelRangeDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReplyChannelRangeDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReplyChannelRangeDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReplyChannelRangeDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_GossipTimestampFilterDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_GossipTimestampFilterDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_GossipTimestampFilterDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_PublicKeyZ_free + * Signature: ([[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free + (JNIEnv *, jclass, jobjectArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_u8Z_free + * Signature: ([B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_u8ZPeerHandleErrorZ_ok + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_u8ZPeerHandleErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_u8ZPeerHandleErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonePeerHandleErrorZ_ok + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonePeerHandleErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonePeerHandleErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolPeerHandleErrorZ_ok + * Signature: (Z)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok + (JNIEnv *, jclass, jboolean); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolPeerHandleErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolPeerHandleErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SecretKeySecpErrorZ_ok + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SecretKeySecpErrorZ_err + * Signature: (Lorg/ldk/enums/LDKSecp256k1Error;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CVec_PublicKeyZ_free - * Signature: ([[B)V + * Method: CResult_SecretKeySecpErrorZ_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_RouteHintZ_free - * Signature: ([J)V + * Method: CResult_PublicKeySecpErrorZ_ok + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CVec_RouteHopZ_free - * Signature: ([J)V + * Method: CResult_PublicKeySecpErrorZ_err + * Signature: (Lorg/ldk/enums/LDKSecp256k1Error;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CVec_SignatureZ_free - * Signature: ([[B)V + * Method: CResult_PublicKeySecpErrorZ_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_SpendableOutputDescriptorZ_free - * Signature: ([J)V + * Method: CResult_TxCreationKeysSecpErrorZ_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_TransactionZ_free - * Signature: ([[B)V + * Method: CResult_TxCreationKeysSecpErrorZ_err + * Signature: (Lorg/ldk/enums/LDKSecp256k1Error;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CVec_TxOutZ_free - * Signature: ([J)V + * Method: CResult_TxCreationKeysSecpErrorZ_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_UpdateAddHTLCZ_free - * Signature: ([J)V + * Method: CResult_TrustedCommitmentTransactionNoneZ_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_UpdateFailHTLCZ_free - * Signature: ([J)V + * Method: CResult_TrustedCommitmentTransactionNoneZ_err + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1err + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CVec_UpdateFailMalformedHTLCZ_free - * Signature: ([J)V + * Method: CResult_TrustedCommitmentTransactionNoneZ_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_UpdateFulfillHTLCZ_free + * Method: CVec_RouteHopZ_free * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CVec_u64Z_free - * Signature: ([J)V + * Method: CVec_CVec_RouteHopZZ_free + * Signature: ([[J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free + (JNIEnv *, jclass, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: CVec_u8Z_free - * Signature: ([B)V + * Method: CResult_RouteDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Transaction_free - * Signature: ([B)V + * Method: CResult_RouteDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxOut_free + * Method: CResult_RouteDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_usizeTransactionZ_new - * Signature: (J[B)J + * Method: CVec_RouteHintZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_ok - * Signature: ()J + * Method: CResult_RouteLightningErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneMonitorUpdateErrorZ_ok - * Signature: ()J + * Method: CResult_RouteLightningErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_new - * Signature: (J[B)J + * Method: CResult_RouteLightningErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_TxOutZZ_new - * Signature: ([B[J)J + * Method: CResult_RoutingFeesDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1new - (JNIEnv *, jclass, jbyteArray, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u64u64Z_new - * Signature: (JJ)J + * Method: CResult_RoutingFeesDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureCVec_SignatureZZ_new - * Signature: ([B[[B)J + * Method: CResult_RoutingFeesDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new - (JNIEnv *, jclass, jbyteArray, jobjectArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err - * Signature: ()J + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_err - * Signature: ()J + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_SignatureZNoneZ_err - * Signature: ()J + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_ok - * Signature: ()J + * Method: CResult_NodeInfoDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_ok - * Signature: ()J + * Method: CResult_NodeInfoDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new - * Signature: (JJJ)J + * Method: CResult_NodeInfoDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_ok - * Signature: ()J + * Method: CResult_NetworkGraphDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_HTLCOutputInCommitmentSignatureZ_new - * Signature: (J[B)J + * Method: CResult_NetworkGraphDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NetworkGraphDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -2511,6 +3967,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Event_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Event_1write + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: MessageSendEvent_free @@ -3114,10 +4578,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnec /* * Class: org_ldk_impl_bindings * Method: ChainMonitor_new - * Signature: (JJJJ)J + * Signature: (JJJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -3266,10 +4730,10 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write /* * Class: org_ldk_impl_bindings * Method: ChannelMonitor_update_monitor - * Signature: (JJJJ)J + * Signature: (JJJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -3327,6 +4791,22 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1c JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconnected (JNIEnv *, jclass, jlong, jbyteArray, jint, jlong, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Persist_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_BlockHashChannelMonitorZ_read + * Signature: ([BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1read + (JNIEnv *, jclass, jbyteArray, jlong); + /* * Class: org_ldk_impl_bindings * Method: OutPoint_free @@ -3423,6 +4903,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1fre JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: SpendableOutputDescriptor_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: SpendableOutputDescriptor_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: ChannelKeys_clone @@ -3591,6 +5087,30 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counter JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InMemoryChannelKeys_is_outbound + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1is_1outbound + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InMemoryChannelKeys_funding_outpoint + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1funding_1outpoint + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InMemoryChannelKeys_get_channel_parameters + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1channel_1parameters + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InMemoryChannelKeys_as_ChannelKeys @@ -4095,6 +5615,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1d JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_BlockHashChannelManagerZ_read + * Signature: ([BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1read + (JNIEnv *, jclass, jbyteArray, jlong); + /* * Class: org_ldk_impl_bindings * Method: DecodeError_free @@ -4380,3840 +5908,4240 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1 * Method: OpenChannel_set_max_htlc_value_in_flight_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1value_1in_1flight_1msat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1value_1in_1flight_1msat + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_channel_reserve_satoshis + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_channel_reserve_satoshis + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_htlc_minimum_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_htlc_minimum_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_feerate_per_kw + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_feerate_per_kw + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_to_self_delay + * Signature: (J)S + */ +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_to_self_delay + * Signature: (JS)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay + (JNIEnv *, jclass, jlong, jshort); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_max_accepted_htlcs + * Signature: (J)S + */ +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_max_accepted_htlcs + * Signature: (JS)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs + (JNIEnv *, jclass, jlong, jshort); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_funding_pubkey + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_funding_pubkey + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_revocation_basepoint + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_revocation_basepoint + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_payment_point + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_payment_point + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_delayed_payment_basepoint + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_delayed_payment_basepoint + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_htlc_basepoint + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_htlc_basepoint + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_first_per_commitment_point + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_first_per_commitment_point + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_get_channel_flags + * Signature: (J)B + */ +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_set_channel_flags + * Signature: (JB)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags + (JNIEnv *, jclass, jlong, jbyte); + +/* + * Class: org_ldk_impl_bindings + * Method: AcceptChannel_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AcceptChannel_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AcceptChannel_get_temporary_channel_id + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AcceptChannel_set_temporary_channel_id + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: AcceptChannel_get_dust_limit_satoshis + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AcceptChannel_set_dust_limit_satoshis + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AcceptChannel_get_max_htlc_value_in_flight_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AcceptChannel_set_max_htlc_value_in_flight_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_1value_1in_1flight_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_channel_reserve_satoshis + * Method: AcceptChannel_get_channel_reserve_satoshis * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_channel_reserve_satoshis + * Method: AcceptChannel_set_channel_reserve_satoshis * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_htlc_minimum_msat + * Method: AcceptChannel_get_htlc_minimum_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_htlc_minimum_msat + * Method: AcceptChannel_set_htlc_minimum_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_feerate_per_kw + * Method: AcceptChannel_get_minimum_depth * Signature: (J)I */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_feerate_per_kw + * Method: AcceptChannel_set_minimum_depth * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_to_self_delay + * Method: AcceptChannel_get_to_self_delay * Signature: (J)S */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_to_self_delay + * Method: AcceptChannel_set_to_self_delay * Signature: (JS)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_max_accepted_htlcs + * Method: AcceptChannel_get_max_accepted_htlcs * Signature: (J)S */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_max_accepted_htlcs + * Method: AcceptChannel_set_max_accepted_htlcs * Signature: (JS)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_funding_pubkey + * Method: AcceptChannel_get_funding_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_funding_pubkey + * Method: AcceptChannel_set_funding_pubkey * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_revocation_basepoint + * Method: AcceptChannel_get_revocation_basepoint * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_revocation_basepoint + * Method: AcceptChannel_set_revocation_basepoint * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_payment_point + * Method: AcceptChannel_get_payment_point * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_payment_point + * Method: AcceptChannel_set_payment_point * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_delayed_payment_basepoint + * Method: AcceptChannel_get_delayed_payment_basepoint * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_delayed_payment_basepoint + * Method: AcceptChannel_set_delayed_payment_basepoint * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_htlc_basepoint + * Method: AcceptChannel_get_htlc_basepoint * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_htlc_basepoint + * Method: AcceptChannel_set_htlc_basepoint * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_first_per_commitment_point + * Method: AcceptChannel_get_first_per_commitment_point * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_first_per_commitment_point + * Method: AcceptChannel_set_first_per_commitment_point * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_get_channel_flags - * Signature: (J)B + * Method: FundingCreated_free + * Signature: (J)V */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_set_channel_flags - * Signature: (JB)V + * Method: FundingCreated_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags - (JNIEnv *, jclass, jlong, jbyte); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_free - * Signature: (J)V + * Method: FundingCreated_get_temporary_channel_id + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_clone - * Signature: (J)J + * Method: FundingCreated_set_temporary_channel_id + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_temporary_channel_id + * Method: FundingCreated_get_funding_txid * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_temporary_channel_id + * Method: FundingCreated_set_funding_txid * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_dust_limit_satoshis - * Signature: (J)J + * Method: FundingCreated_get_funding_output_index + * Signature: (J)S */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_dust_limit_satoshis - * Signature: (JJ)V + * Method: FundingCreated_set_funding_output_index + * Signature: (JS)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index + (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_max_htlc_value_in_flight_msat - * Signature: (J)J + * Method: FundingCreated_get_signature + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_max_htlc_value_in_flight_msat - * Signature: (JJ)V + * Method: FundingCreated_set_signature + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_1value_1in_1flight_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_channel_reserve_satoshis + * Method: FundingCreated_new + * Signature: ([B[BS[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray, jshort, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: FundingSigned_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: FundingSigned_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_channel_reserve_satoshis - * Signature: (JJ)V + * Method: FundingSigned_get_channel_id + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_htlc_minimum_msat - * Signature: (J)J + * Method: FundingSigned_set_channel_id + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: FundingSigned_get_signature + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_htlc_minimum_msat - * Signature: (JJ)V + * Method: FundingSigned_set_signature + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_minimum_depth - * Signature: (J)I + * Method: FundingSigned_new + * Signature: ([B[B)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: FundingLocked_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_minimum_depth - * Signature: (JI)V + * Method: FundingLocked_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_to_self_delay - * Signature: (J)S + * Method: FundingLocked_get_channel_id + * Signature: (J)[B */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: FundingLocked_set_channel_id + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: FundingLocked_get_next_per_commitment_point + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_to_self_delay - * Signature: (JS)V + * Method: FundingLocked_set_next_per_commitment_point + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: FundingLocked_new + * Signature: ([B[B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay - (JNIEnv *, jclass, jlong, jshort); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_max_accepted_htlcs - * Signature: (J)S + * Method: Shutdown_free + * Signature: (J)V */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_max_accepted_htlcs - * Signature: (JS)V + * Method: Shutdown_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs - (JNIEnv *, jclass, jlong, jshort); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_funding_pubkey + * Method: Shutdown_get_channel_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_funding_pubkey + * Method: Shutdown_set_channel_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_revocation_basepoint + * Method: Shutdown_get_scriptpubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_revocation_basepoint + * Method: Shutdown_set_scriptpubkey * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_payment_point - * Signature: (J)[B + * Method: Shutdown_new + * Signature: ([B[B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingSigned_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_payment_point - * Signature: (J[B)V + * Method: ClosingSigned_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_delayed_payment_basepoint + * Method: ClosingSigned_get_channel_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_delayed_payment_basepoint + * Method: ClosingSigned_set_channel_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_htlc_basepoint - * Signature: (J)[B + * Method: ClosingSigned_get_fee_satoshis + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_htlc_basepoint - * Signature: (J[B)V + * Method: ClosingSigned_set_fee_satoshis + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_get_first_per_commitment_point + * Method: ClosingSigned_get_signature * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_set_first_per_commitment_point + * Method: ClosingSigned_set_signature * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_free + * Method: ClosingSigned_new + * Signature: ([BJ[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new + (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: UpdateAddHTLC_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_clone + * Method: UpdateAddHTLC_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_get_temporary_channel_id + * Method: UpdateAddHTLC_get_channel_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_set_temporary_channel_id + * Method: UpdateAddHTLC_set_channel_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_get_funding_txid - * Signature: (J)[B + * Method: UpdateAddHTLC_get_htlc_id + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_set_funding_txid - * Signature: (J[B)V + * Method: UpdateAddHTLC_set_htlc_id + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_get_funding_output_index - * Signature: (J)S + * Method: UpdateAddHTLC_get_amount_msat + * Signature: (J)J */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_set_funding_output_index - * Signature: (JS)V + * Method: UpdateAddHTLC_set_amount_msat + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index - (JNIEnv *, jclass, jlong, jshort); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_get_signature + * Method: UpdateAddHTLC_get_payment_hash * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_set_signature + * Method: UpdateAddHTLC_set_payment_hash * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_new - * Signature: ([B[BS[B)J + * Method: UpdateAddHTLC_get_cltv_expiry + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray, jshort, jbyteArray); +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingSigned_free + * Method: UpdateAddHTLC_set_cltv_expiry + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: UpdateFulfillHTLC_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingSigned_clone + * Method: UpdateFulfillHTLC_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingSigned_get_channel_id + * Method: UpdateFulfillHTLC_get_channel_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingSigned_set_channel_id + * Method: UpdateFulfillHTLC_set_channel_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingSigned_get_signature + * Method: UpdateFulfillHTLC_get_htlc_id + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UpdateFulfillHTLC_set_htlc_id + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UpdateFulfillHTLC_get_payment_preimage * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingSigned_set_signature + * Method: UpdateFulfillHTLC_set_payment_preimage * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingSigned_new - * Signature: ([B[B)J + * Method: UpdateFulfillHTLC_new + * Signature: ([BJ[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new + (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_free + * Method: UpdateFailHTLC_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_clone + * Method: UpdateFailHTLC_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_get_channel_id + * Method: UpdateFailHTLC_get_channel_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_set_channel_id + * Method: UpdateFailHTLC_set_channel_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_get_next_per_commitment_point - * Signature: (J)[B + * Method: UpdateFailHTLC_get_htlc_id + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_set_next_per_commitment_point - * Signature: (J[B)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point - (JNIEnv *, jclass, jlong, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: FundingLocked_new - * Signature: ([B[B)J + * Method: UpdateFailHTLC_set_htlc_id + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Shutdown_free + * Method: UpdateFailMalformedHTLC_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Shutdown_clone + * Method: UpdateFailMalformedHTLC_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Shutdown_get_channel_id + * Method: UpdateFailMalformedHTLC_get_channel_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Shutdown_set_channel_id + * Method: UpdateFailMalformedHTLC_set_channel_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Shutdown_get_scriptpubkey - * Signature: (J)[B + * Method: UpdateFailMalformedHTLC_get_htlc_id + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Shutdown_set_scriptpubkey - * Signature: (J[B)V + * Method: UpdateFailMalformedHTLC_set_htlc_id + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Shutdown_new - * Signature: ([B[B)J + * Method: UpdateFailMalformedHTLC_get_failure_code + * Signature: (J)S */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_free + * Method: UpdateFailMalformedHTLC_set_failure_code + * Signature: (JS)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code + (JNIEnv *, jclass, jlong, jshort); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSigned_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_clone + * Method: CommitmentSigned_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_get_channel_id + * Method: CommitmentSigned_get_channel_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_set_channel_id + * Method: CommitmentSigned_set_channel_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_get_fee_satoshis - * Signature: (J)J + * Method: CommitmentSigned_get_signature + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_set_fee_satoshis - * Signature: (JJ)V + * Method: CommitmentSigned_set_signature + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_get_signature - * Signature: (J)[B + * Method: CommitmentSigned_set_htlc_signatures + * Signature: (J[[B)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures + (JNIEnv *, jclass, jlong, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_set_signature - * Signature: (J[B)V + * Method: CommitmentSigned_new + * Signature: ([B[B[[B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_new - * Signature: ([BJ[B)J + * Method: RevokeAndACK_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new - (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_free - * Signature: (J)V + * Method: RevokeAndACK_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_clone - * Signature: (J)J + * Method: RevokeAndACK_get_channel_id + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_get_channel_id + * Method: RevokeAndACK_set_channel_id + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: RevokeAndACK_get_per_commitment_secret * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_set_channel_id + * Method: RevokeAndACK_set_per_commitment_secret * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_get_htlc_id - * Signature: (J)J + * Method: RevokeAndACK_get_next_per_commitment_point + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_set_htlc_id - * Signature: (JJ)V + * Method: RevokeAndACK_set_next_per_commitment_point + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_get_amount_msat - * Signature: (J)J + * Method: RevokeAndACK_new + * Signature: ([B[B[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: UpdateFee_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_set_amount_msat - * Signature: (JJ)V + * Method: UpdateFee_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_get_payment_hash + * Method: UpdateFee_get_channel_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_set_payment_hash + * Method: UpdateFee_set_channel_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_get_cltv_expiry + * Method: UpdateFee_get_feerate_per_kw * Signature: (J)I */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_set_cltv_expiry + * Method: UpdateFee_set_feerate_per_kw * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_free + * Method: UpdateFee_new + * Signature: ([BI)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new + (JNIEnv *, jclass, jbyteArray, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: DataLossProtect_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_clone + * Method: DataLossProtect_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_get_channel_id + * Method: DataLossProtect_get_your_last_per_commitment_secret * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_set_channel_id + * Method: DataLossProtect_set_your_last_per_commitment_secret * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_get_htlc_id - * Signature: (J)J + * Method: DataLossProtect_get_my_current_per_commitment_point + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_set_htlc_id - * Signature: (JJ)V + * Method: DataLossProtect_set_my_current_per_commitment_point + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_get_payment_preimage - * Signature: (J)[B + * Method: DataLossProtect_new + * Signature: ([B[B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_set_payment_preimage - * Signature: (J[B)V + * Method: ChannelReestablish_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_new - * Signature: ([BJ[B)J + * Method: ChannelReestablish_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new - (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailHTLC_free - * Signature: (J)V + * Method: ChannelReestablish_get_channel_id + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailHTLC_clone - * Signature: (J)J + * Method: ChannelReestablish_set_channel_id + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailHTLC_get_channel_id - * Signature: (J)[B + * Method: ChannelReestablish_get_next_local_commitment_number + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailHTLC_set_channel_id - * Signature: (J[B)V + * Method: ChannelReestablish_set_next_local_commitment_number + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailHTLC_get_htlc_id + * Method: ChannelReestablish_get_next_remote_commitment_number * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailHTLC_set_htlc_id + * Method: ChannelReestablish_set_next_remote_commitment_number * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailMalformedHTLC_free + * Method: AnnouncementSignatures_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailMalformedHTLC_clone + * Method: AnnouncementSignatures_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailMalformedHTLC_get_channel_id + * Method: AnnouncementSignatures_get_channel_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailMalformedHTLC_set_channel_id + * Method: AnnouncementSignatures_set_channel_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailMalformedHTLC_get_htlc_id + * Method: AnnouncementSignatures_get_short_channel_id * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailMalformedHTLC_set_htlc_id + * Method: AnnouncementSignatures_set_short_channel_id * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailMalformedHTLC_get_failure_code - * Signature: (J)S + * Method: AnnouncementSignatures_get_node_signature + * Signature: (J)[B */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailMalformedHTLC_set_failure_code - * Signature: (JS)V + * Method: AnnouncementSignatures_set_node_signature + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code - (JNIEnv *, jclass, jlong, jshort); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CommitmentSigned_free + * Method: AnnouncementSignatures_get_bitcoin_signature + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: AnnouncementSignatures_set_bitcoin_signature + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: AnnouncementSignatures_new + * Signature: ([BJ[B[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new + (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: NetAddress_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentSigned_clone + * Method: NetAddress_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentSigned_get_channel_id + * Method: NetAddress_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentSigned_set_channel_id - * Signature: (J[B)V + * Method: Result_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Result_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CommitmentSigned_get_signature - * Signature: (J)[B + * Method: UnsignedNodeAnnouncement_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentSigned_set_signature - * Signature: (J[B)V + * Method: UnsignedNodeAnnouncement_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentSigned_set_htlc_signatures - * Signature: (J[[B)V + * Method: UnsignedNodeAnnouncement_get_features + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures - (JNIEnv *, jclass, jlong, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentSigned_new - * Signature: ([B[B[[B)J + * Method: UnsignedNodeAnnouncement_set_features + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray, jobjectArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_free - * Signature: (J)V + * Method: UnsignedNodeAnnouncement_get_timestamp + * Signature: (J)I */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_clone - * Signature: (J)J + * Method: UnsignedNodeAnnouncement_set_timestamp + * Signature: (JI)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_get_channel_id + * Method: UnsignedNodeAnnouncement_get_node_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_set_channel_id + * Method: UnsignedNodeAnnouncement_set_node_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_get_per_commitment_secret + * Method: UnsignedNodeAnnouncement_get_rgb * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_set_per_commitment_secret + * Method: UnsignedNodeAnnouncement_set_rgb * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_get_next_per_commitment_point + * Method: UnsignedNodeAnnouncement_get_alias * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_set_next_per_commitment_point + * Method: UnsignedNodeAnnouncement_set_alias * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_new - * Signature: ([B[B[B)J + * Method: UnsignedNodeAnnouncement_set_addresses + * Signature: (J[J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateFee_free + * Method: NodeAnnouncement_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFee_clone + * Method: NodeAnnouncement_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFee_get_channel_id + * Method: NodeAnnouncement_get_signature * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFee_set_channel_id + * Method: NodeAnnouncement_set_signature * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateFee_get_feerate_per_kw - * Signature: (J)I + * Method: NodeAnnouncement_get_contents + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFee_set_feerate_per_kw - * Signature: (JI)V + * Method: NodeAnnouncement_set_contents + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFee_new - * Signature: ([BI)J + * Method: NodeAnnouncement_new + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new - (JNIEnv *, jclass, jbyteArray, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: DataLossProtect_free + * Method: UnsignedChannelAnnouncement_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DataLossProtect_clone + * Method: UnsignedChannelAnnouncement_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DataLossProtect_get_your_last_per_commitment_secret + * Method: UnsignedChannelAnnouncement_get_features + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelAnnouncement_set_features + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelAnnouncement_get_chain_hash * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DataLossProtect_set_your_last_per_commitment_secret + * Method: UnsignedChannelAnnouncement_set_chain_hash * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: DataLossProtect_get_my_current_per_commitment_point + * Method: UnsignedChannelAnnouncement_get_short_channel_id + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelAnnouncement_set_short_channel_id + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelAnnouncement_get_node_id_1 * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11 (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DataLossProtect_set_my_current_per_commitment_point + * Method: UnsignedChannelAnnouncement_set_node_id_1 * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11 (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: DataLossProtect_new - * Signature: ([B[B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: ChannelReestablish_free - * Signature: (J)V + * Method: UnsignedChannelAnnouncement_get_node_id_2 + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12 (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelReestablish_clone - * Signature: (J)J + * Method: UnsignedChannelAnnouncement_set_node_id_2 + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12 + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelReestablish_get_channel_id + * Method: UnsignedChannelAnnouncement_get_bitcoin_key_1 * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11 (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelReestablish_set_channel_id + * Method: UnsignedChannelAnnouncement_set_bitcoin_key_1 * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11 (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelReestablish_get_next_local_commitment_number - * Signature: (J)J + * Method: UnsignedChannelAnnouncement_get_bitcoin_key_2 + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12 (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelReestablish_set_next_local_commitment_number - * Signature: (JJ)V + * Method: UnsignedChannelAnnouncement_set_bitcoin_key_2 + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12 + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelReestablish_get_next_remote_commitment_number - * Signature: (J)J + * Method: ChannelAnnouncement_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelReestablish_set_next_remote_commitment_number - * Signature: (JJ)V + * Method: ChannelAnnouncement_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_free - * Signature: (J)V + * Method: ChannelAnnouncement_get_node_signature_1 + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11 (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_clone - * Signature: (J)J + * Method: ChannelAnnouncement_set_node_signature_1 + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11 + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_get_channel_id + * Method: ChannelAnnouncement_get_node_signature_2 * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12 (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_set_channel_id + * Method: ChannelAnnouncement_set_node_signature_2 * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12 (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_get_short_channel_id - * Signature: (J)J + * Method: ChannelAnnouncement_get_bitcoin_signature_1 + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11 (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_set_short_channel_id - * Signature: (JJ)V + * Method: ChannelAnnouncement_set_bitcoin_signature_1 + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11 + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_get_node_signature + * Method: ChannelAnnouncement_get_bitcoin_signature_2 * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12 (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_set_node_signature + * Method: ChannelAnnouncement_set_bitcoin_signature_2 * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12 (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_get_bitcoin_signature - * Signature: (J)[B + * Method: ChannelAnnouncement_get_contents + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_set_bitcoin_signature - * Signature: (J[B)V + * Method: ChannelAnnouncement_set_contents + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_new - * Signature: ([BJ[B[B)J + * Method: ChannelAnnouncement_new + * Signature: ([B[B[B[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new - (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetAddress_free + * Method: UnsignedChannelUpdate_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetAddress_clone + * Method: UnsignedChannelUpdate_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_free - * Signature: (J)V + * Method: UnsignedChannelUpdate_get_chain_hash + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_clone - * Signature: (J)J + * Method: UnsignedChannelUpdate_set_chain_hash + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_get_features + * Method: UnsignedChannelUpdate_get_short_channel_id * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_set_features + * Method: UnsignedChannelUpdate_set_short_channel_id * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_get_timestamp + * Method: UnsignedChannelUpdate_get_timestamp * Signature: (J)I */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_set_timestamp + * Method: UnsignedChannelUpdate_set_timestamp * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_get_node_id - * Signature: (J)[B + * Method: UnsignedChannelUpdate_get_flags + * Signature: (J)B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_set_node_id - * Signature: (J[B)V + * Method: UnsignedChannelUpdate_set_flags + * Signature: (JB)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags + (JNIEnv *, jclass, jlong, jbyte); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_get_rgb - * Signature: (J)[B + * Method: UnsignedChannelUpdate_get_cltv_expiry_delta + * Signature: (J)S */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_set_rgb - * Signature: (J[B)V + * Method: UnsignedChannelUpdate_set_cltv_expiry_delta + * Signature: (JS)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta + (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_get_alias - * Signature: (J)[B + * Method: UnsignedChannelUpdate_get_htlc_minimum_msat + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_set_alias - * Signature: (J[B)V + * Method: UnsignedChannelUpdate_set_htlc_minimum_msat + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_set_addresses - * Signature: (J[J)V + * Method: UnsignedChannelUpdate_get_fee_base_msat + * Signature: (J)I */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncement_free + * Method: UnsignedChannelUpdate_set_fee_base_msat + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelUpdate_get_fee_proportional_millionths + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelUpdate_set_fee_proportional_millionths + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelUpdate_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncement_clone + * Method: ChannelUpdate_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncement_get_signature + * Method: ChannelUpdate_get_signature * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncement_set_signature + * Method: ChannelUpdate_set_signature * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncement_get_contents + * Method: ChannelUpdate_get_contents * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncement_set_contents + * Method: ChannelUpdate_set_contents * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncement_new + * Method: ChannelUpdate_new * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_free + * Method: QueryChannelRange_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_clone + * Method: QueryChannelRange_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_get_features - * Signature: (J)J + * Method: QueryChannelRange_get_chain_hash + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_set_features - * Signature: (JJ)V + * Method: QueryChannelRange_set_chain_hash + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_get_chain_hash - * Signature: (J)[B + * Method: QueryChannelRange_get_first_blocknum + * Signature: (J)I */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_set_chain_hash - * Signature: (J[B)V + * Method: QueryChannelRange_set_first_blocknum + * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_get_short_channel_id - * Signature: (J)J + * Method: QueryChannelRange_get_number_of_blocks + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_set_short_channel_id - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_get_node_id_1 - * Signature: (J)[B + * Method: QueryChannelRange_set_number_of_blocks + * Signature: (JI)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11 - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_set_node_id_1 - * Signature: (J[B)V + * Method: QueryChannelRange_new + * Signature: ([BII)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11 - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new + (JNIEnv *, jclass, jbyteArray, jint, jint); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_get_node_id_2 - * Signature: (J)[B + * Method: ReplyChannelRange_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12 +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_set_node_id_2 - * Signature: (J[B)V + * Method: ReplyChannelRange_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12 - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_get_bitcoin_key_1 + * Method: ReplyChannelRange_get_chain_hash * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11 +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_set_bitcoin_key_1 + * Method: ReplyChannelRange_set_chain_hash * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11 +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_get_bitcoin_key_2 - * Signature: (J)[B + * Method: ReplyChannelRange_get_first_blocknum + * Signature: (J)I */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12 +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_set_bitcoin_key_2 - * Signature: (J[B)V + * Method: ReplyChannelRange_set_first_blocknum + * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12 - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_free - * Signature: (J)V + * Method: ReplyChannelRange_get_number_of_blocks + * Signature: (J)I */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_clone - * Signature: (J)J + * Method: ReplyChannelRange_set_number_of_blocks + * Signature: (JI)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_get_node_signature_1 - * Signature: (J)[B + * Method: ReplyChannelRange_get_full_information + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11 +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1full_1information (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_set_node_signature_1 - * Signature: (J[B)V + * Method: ReplyChannelRange_set_full_information + * Signature: (JZ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11 - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1full_1information + (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_get_node_signature_2 - * Signature: (J)[B + * Method: ReplyChannelRange_set_short_channel_ids + * Signature: (J[J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12 - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_set_node_signature_2 - * Signature: (J[B)V + * Method: ReplyChannelRange_new + * Signature: ([BIIZ[J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12 - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new + (JNIEnv *, jclass, jbyteArray, jint, jint, jboolean, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_get_bitcoin_signature_1 - * Signature: (J)[B + * Method: QueryShortChannelIds_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11 +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_set_bitcoin_signature_1 - * Signature: (J[B)V + * Method: QueryShortChannelIds_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11 - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_get_bitcoin_signature_2 + * Method: QueryShortChannelIds_get_chain_hash * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12 +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_set_bitcoin_signature_2 + * Method: QueryShortChannelIds_set_chain_hash * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12 +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_get_contents - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_set_contents - * Signature: (JJ)V + * Method: QueryShortChannelIds_set_short_channel_ids + * Signature: (J[J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_new - * Signature: ([B[B[B[BJ)J + * Method: QueryShortChannelIds_new + * Signature: ([B[J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new + (JNIEnv *, jclass, jbyteArray, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_free + * Method: ReplyShortChannelIdsEnd_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_clone + * Method: ReplyShortChannelIdsEnd_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_get_chain_hash + * Method: ReplyShortChannelIdsEnd_get_chain_hash * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_set_chain_hash + * Method: ReplyShortChannelIdsEnd_set_chain_hash * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_get_short_channel_id - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_set_short_channel_id - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_get_timestamp - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_set_timestamp - * Signature: (JI)V + * Method: ReplyShortChannelIdsEnd_get_full_information + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_get_flags - * Signature: (J)B + * Method: ReplyShortChannelIdsEnd_set_full_information + * Signature: (JZ)V */ -JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information + (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_set_flags - * Signature: (JB)V + * Method: ReplyShortChannelIdsEnd_new + * Signature: ([BZ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags - (JNIEnv *, jclass, jlong, jbyte); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new + (JNIEnv *, jclass, jbyteArray, jboolean); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_get_cltv_expiry_delta - * Signature: (J)S + * Method: GossipTimestampFilter_free + * Signature: (J)V */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_set_cltv_expiry_delta - * Signature: (JS)V + * Method: GossipTimestampFilter_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta - (JNIEnv *, jclass, jlong, jshort); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_get_htlc_minimum_msat - * Signature: (J)J + * Method: GossipTimestampFilter_get_chain_hash + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_set_htlc_minimum_msat - * Signature: (JJ)V + * Method: GossipTimestampFilter_set_chain_hash + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_get_fee_base_msat + * Method: GossipTimestampFilter_get_first_timestamp * Signature: (J)I */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_set_fee_base_msat + * Method: GossipTimestampFilter_set_first_timestamp * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_get_fee_proportional_millionths + * Method: GossipTimestampFilter_get_timestamp_range * Signature: (J)I */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_set_fee_proportional_millionths + * Method: GossipTimestampFilter_set_timestamp_range * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdate_free + * Method: GossipTimestampFilter_new + * Signature: ([BII)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new + (JNIEnv *, jclass, jbyteArray, jint, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: ErrorAction_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdate_clone + * Method: ErrorAction_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdate_get_signature - * Signature: (J)[B + * Method: LightningError_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdate_set_signature + * Method: LightningError_get_err + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LightningError_set_err * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdate_get_contents + * Method: LightningError_get_action * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdate_set_contents + * Method: LightningError_set_action * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdate_new + * Method: LightningError_new * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_free + * Method: CommitmentUpdate_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_clone + * Method: CommitmentUpdate_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_get_chain_hash - * Signature: (J)[B + * Method: CommitmentUpdate_set_update_add_htlcs + * Signature: (J[J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_set_chain_hash - * Signature: (J[B)V + * Method: CommitmentUpdate_set_update_fulfill_htlcs + * Signature: (J[J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_get_first_blocknum - * Signature: (J)I + * Method: CommitmentUpdate_set_update_fail_htlcs + * Signature: (J[J)V */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_set_first_blocknum - * Signature: (JI)V + * Method: CommitmentUpdate_set_update_fail_malformed_htlcs + * Signature: (J[J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_get_number_of_blocks - * Signature: (J)I + * Method: CommitmentUpdate_get_update_fee + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_set_number_of_blocks - * Signature: (JI)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks - (JNIEnv *, jclass, jlong, jint); - -/* - * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_new - * Signature: ([BII)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new - (JNIEnv *, jclass, jbyteArray, jint, jint); - -/* - * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_free - * Signature: (J)V + * Method: CommitmentUpdate_set_update_fee + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_clone + * Method: CommitmentUpdate_get_commitment_signed * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_get_chain_hash - * Signature: (J)[B + * Method: CommitmentUpdate_set_commitment_signed + * Signature: (JJ)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_set_chain_hash - * Signature: (J[B)V + * Method: CommitmentUpdate_new + * Signature: ([J[J[J[JJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new + (JNIEnv *, jclass, jlongArray, jlongArray, jlongArray, jlongArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_get_first_blocknum - * Signature: (J)I + * Method: HTLCFailChannelUpdate_free + * Signature: (J)V */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_set_first_blocknum - * Signature: (JI)V + * Method: HTLCFailChannelUpdate_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_get_number_of_blocks - * Signature: (J)I + * Method: ChannelMessageHandler_free + * Signature: (J)V */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_set_number_of_blocks - * Signature: (JI)V + * Method: RoutingMessageHandler_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_get_full_information - * Signature: (J)Z + * Method: AcceptChannel_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1full_1information +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_set_full_information - * Signature: (JZ)V + * Method: AcceptChannel_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1full_1information - (JNIEnv *, jclass, jlong, jboolean); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_set_short_channel_ids - * Signature: (J[J)V + * Method: AnnouncementSignatures_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_new - * Signature: ([BIIZ[J)J + * Method: AnnouncementSignatures_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new - (JNIEnv *, jclass, jbyteArray, jint, jint, jboolean, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: QueryShortChannelIds_free - * Signature: (J)V + * Method: ChannelReestablish_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: QueryShortChannelIds_clone - * Signature: (J)J + * Method: ChannelReestablish_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: QueryShortChannelIds_get_chain_hash + * Method: ClosingSigned_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: QueryShortChannelIds_set_chain_hash - * Signature: (J[B)V + * Method: ClosingSigned_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: QueryShortChannelIds_set_short_channel_ids - * Signature: (J[J)V + * Method: CommitmentSigned_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: QueryShortChannelIds_new - * Signature: ([B[J)J + * Method: CommitmentSigned_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new - (JNIEnv *, jclass, jbyteArray, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ReplyShortChannelIdsEnd_free - * Signature: (J)V + * Method: FundingCreated_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyShortChannelIdsEnd_clone - * Signature: (J)J + * Method: FundingCreated_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ReplyShortChannelIdsEnd_get_chain_hash + * Method: FundingSigned_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyShortChannelIdsEnd_set_chain_hash - * Signature: (J[B)V + * Method: FundingSigned_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ReplyShortChannelIdsEnd_get_full_information - * Signature: (J)Z + * Method: FundingLocked_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyShortChannelIdsEnd_set_full_information - * Signature: (JZ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information - (JNIEnv *, jclass, jlong, jboolean); - -/* - * Class: org_ldk_impl_bindings - * Method: ReplyShortChannelIdsEnd_new - * Signature: ([BZ)J + * Method: FundingLocked_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new - (JNIEnv *, jclass, jbyteArray, jboolean); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_free - * Signature: (J)V + * Method: Init_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Init_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_clone - * Signature: (J)J + * Method: Init_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_get_chain_hash + * Method: OpenChannel_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_set_chain_hash - * Signature: (J[B)V + * Method: OpenChannel_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_get_first_timestamp - * Signature: (J)I + * Method: RevokeAndACK_write + * Signature: (J)[B */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_set_first_timestamp - * Signature: (JI)V + * Method: RevokeAndACK_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_get_timestamp_range - * Signature: (J)I + * Method: Shutdown_write + * Signature: (J)[B */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_set_timestamp_range - * Signature: (JI)V + * Method: Shutdown_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_new - * Signature: ([BII)J + * Method: UpdateFailHTLC_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new - (JNIEnv *, jclass, jbyteArray, jint, jint); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ErrorAction_free - * Signature: (J)V + * Method: UpdateFailHTLC_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ErrorAction_clone - * Signature: (J)J + * Method: UpdateFailMalformedHTLC_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LightningError_free - * Signature: (J)V + * Method: UpdateFailMalformedHTLC_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: LightningError_get_err - * Signature: (J)Ljava/lang/String; + * Method: UpdateFee_write + * Signature: (J)[B */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LightningError_set_err - * Signature: (J[B)V + * Method: UpdateFee_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: LightningError_get_action - * Signature: (J)J + * Method: UpdateFulfillHTLC_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LightningError_set_action - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LightningError_new - * Signature: ([BJ)J + * Method: UpdateFulfillHTLC_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_free - * Signature: (J)V + * Method: UpdateAddHTLC_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_clone - * Signature: (J)J + * Method: UpdateAddHTLC_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_set_update_add_htlcs - * Signature: (J[J)V + * Method: Ping_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Ping_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_set_update_fulfill_htlcs - * Signature: (J[J)V + * Method: Ping_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_set_update_fail_htlcs - * Signature: (J[J)V + * Method: Pong_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Pong_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_set_update_fail_malformed_htlcs - * Signature: (J[J)V + * Method: Pong_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_get_update_fee - * Signature: (J)J + * Method: UnsignedChannelAnnouncement_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_set_update_fee - * Signature: (JJ)V + * Method: UnsignedChannelAnnouncement_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_get_commitment_signed - * Signature: (J)J + * Method: ChannelAnnouncement_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_set_commitment_signed - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CommitmentUpdate_new - * Signature: ([J[J[J[JJJ)J + * Method: ChannelAnnouncement_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new - (JNIEnv *, jclass, jlongArray, jlongArray, jlongArray, jlongArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: HTLCFailChannelUpdate_free - * Signature: (J)V + * Method: UnsignedChannelUpdate_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCFailChannelUpdate_clone - * Signature: (J)J + * Method: UnsignedChannelUpdate_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_free - * Signature: (J)V + * Method: ChannelUpdate_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RoutingMessageHandler_free - * Signature: (J)V + * Method: ChannelUpdate_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_write + * Method: ErrorMessage_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AcceptChannel_read + * Method: ErrorMessage_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_write + * Method: UnsignedNodeAnnouncement_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: AnnouncementSignatures_read + * Method: UnsignedNodeAnnouncement_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelReestablish_write + * Method: NodeAnnouncement_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelReestablish_read + * Method: NodeAnnouncement_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_write + * Method: QueryShortChannelIds_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: QueryShortChannelIds_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingSigned_read + * Method: ReplyShortChannelIdsEnd_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CommitmentSigned_write + * Method: ReplyShortChannelIdsEnd_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentSigned_read + * Method: QueryChannelRange_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_write + * Method: QueryChannelRange_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingCreated_read + * Method: ReplyChannelRange_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingSigned_write + * Method: ReplyChannelRange_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingSigned_read + * Method: GossipTimestampFilter_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_write + * Method: GossipTimestampFilter_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_read - * Signature: ([B)J + * Method: MessageHandler_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Init_write - * Signature: (J)[B + * Method: MessageHandler_get_chan_handler + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Init_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Init_read - * Signature: ([B)J + * Method: MessageHandler_set_chan_handler + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_write - * Signature: (J)[B + * Method: MessageHandler_get_route_handler + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: OpenChannel_read - * Signature: ([B)J + * Method: MessageHandler_set_route_handler + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_write - * Signature: (J)[B + * Method: MessageHandler_new + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RevokeAndACK_read - * Signature: ([B)J + * Method: SocketDescriptor_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Shutdown_write - * Signature: (J)[B + * Method: SocketDescriptor_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Shutdown_read - * Signature: ([B)J + * Method: PeerHandleError_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailHTLC_write - * Signature: (J)[B + * Method: PeerHandleError_get_no_connection_possible + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailHTLC_read - * Signature: ([B)J + * Method: PeerHandleError_set_no_connection_possible + * Signature: (JZ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible + (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailMalformedHTLC_write - * Signature: (J)[B + * Method: PeerHandleError_new + * Signature: (Z)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new + (JNIEnv *, jclass, jboolean); + +/* + * Class: org_ldk_impl_bindings + * Method: PeerManager_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFailMalformedHTLC_read - * Signature: ([B)J + * Method: PeerManager_new + * Signature: (J[B[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFee_write - * Signature: (J)[B + * Method: PeerManager_get_peer_node_ids + * Signature: (J)[[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFee_read - * Signature: ([B)J + * Method: PeerManager_new_outbound_connection + * Signature: (J[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1connection + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: PeerManager_new_inbound_connection + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_write - * Signature: (J)[B + * Method: PeerManager_write_buffer_space_avail + * Signature: (JJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateFulfillHTLC_read - * Signature: ([B)J + * Method: PeerManager_read_event + * Signature: (JJ[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event + (JNIEnv *, jclass, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_write - * Signature: (J)[B + * Method: PeerManager_process_events + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UpdateAddHTLC_read - * Signature: ([B)J + * Method: PeerManager_socket_disconnected + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Ping_write - * Signature: (J)[B + * Method: PeerManager_timer_tick_occured + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Ping_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Ping_read - * Signature: ([B)J + * Method: build_commitment_secret + * Signature: ([BJ)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: Pong_write - * Signature: (J)[B + * Method: derive_private_key + * Signature: ([B[B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Pong_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key + (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Pong_read - * Signature: ([B)J + * Method: derive_public_key + * Signature: ([B[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key + (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_write - * Signature: (J)[B + * Method: derive_private_revocation_key + * Signature: ([B[B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key + (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelAnnouncement_read - * Signature: ([B)J + * Method: derive_public_revocation_key + * Signature: ([B[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key + (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_write - * Signature: (J)[B + * Method: TxCreationKeys_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelAnnouncement_read - * Signature: ([B)J + * Method: TxCreationKeys_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_write + * Method: TxCreationKeys_get_per_commitment_point * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedChannelUpdate_read - * Signature: ([B)J + * Method: TxCreationKeys_set_per_commitment_point + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdate_write + * Method: TxCreationKeys_get_revocation_key * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelUpdate_read - * Signature: ([B)J + * Method: TxCreationKeys_set_revocation_key + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ErrorMessage_write + * Method: TxCreationKeys_get_broadcaster_htlc_key * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ErrorMessage_read - * Signature: ([B)J + * Method: TxCreationKeys_set_broadcaster_htlc_key + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_write + * Method: TxCreationKeys_get_countersignatory_htlc_key * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: UnsignedNodeAnnouncement_read - * Signature: ([B)J + * Method: TxCreationKeys_set_countersignatory_htlc_key + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncement_write + * Method: TxCreationKeys_get_broadcaster_delayed_payment_key * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeAnnouncement_read - * Signature: ([B)J + * Method: TxCreationKeys_set_broadcaster_delayed_payment_key + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: QueryShortChannelIds_read - * Signature: ([B)J + * Method: TxCreationKeys_new + * Signature: ([B[B[B[B[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: QueryShortChannelIds_write + * Method: TxCreationKeys_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyShortChannelIdsEnd_read + * Method: TxCreationKeys_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ReplyShortChannelIdsEnd_write - * Signature: (J)[B + * Method: ChannelPublicKeys_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_read - * Signature: ([B)J + * Method: ChannelPublicKeys_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: QueryChannelRange_write + * Method: ChannelPublicKeys_get_funding_pubkey * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_read - * Signature: ([B)J + * Method: ChannelPublicKeys_set_funding_pubkey + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ReplyChannelRange_write + * Method: ChannelPublicKeys_get_revocation_basepoint * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_read - * Signature: ([B)J + * Method: ChannelPublicKeys_set_revocation_basepoint + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: GossipTimestampFilter_write + * Method: ChannelPublicKeys_get_payment_point * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageHandler_free - * Signature: (J)V + * Method: ChannelPublicKeys_set_payment_point + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: MessageHandler_get_chan_handler - * Signature: (J)J + * Method: ChannelPublicKeys_get_delayed_payment_basepoint + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageHandler_set_chan_handler - * Signature: (JJ)V + * Method: ChannelPublicKeys_set_delayed_payment_basepoint + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: MessageHandler_get_route_handler - * Signature: (J)J + * Method: ChannelPublicKeys_get_htlc_basepoint + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: MessageHandler_set_route_handler - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: MessageHandler_new - * Signature: (JJ)J + * Method: ChannelPublicKeys_set_htlc_basepoint + * Signature: (J[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: SocketDescriptor_clone - * Signature: (J)J + * Method: ChannelPublicKeys_new + * Signature: ([B[B[B[B[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: SocketDescriptor_free - * Signature: (J)V + * Method: ChannelPublicKeys_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeerHandleError_free - * Signature: (J)V + * Method: ChannelPublicKeys_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: PeerHandleError_get_no_connection_possible - * Signature: (J)Z + * Method: TxCreationKeys_derive_new + * Signature: ([B[B[B[B[B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: PeerHandleError_set_no_connection_possible - * Signature: (JZ)V + * Method: TxCreationKeys_from_channel_static_keys + * Signature: ([BJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible - (JNIEnv *, jclass, jlong, jboolean); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1channel_1static_1keys + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeerHandleError_new - * Signature: (Z)J + * Method: get_revokeable_redeemscript + * Signature: ([BS[B)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new - (JNIEnv *, jclass, jboolean); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript + (JNIEnv *, jclass, jbyteArray, jshort, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: PeerManager_free + * Method: HTLCOutputInCommitment_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeerManager_new - * Signature: (J[B[BJ)J + * Method: HTLCOutputInCommitment_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeerManager_get_peer_node_ids - * Signature: (J)[[B + * Method: HTLCOutputInCommitment_get_offered + * Signature: (J)Z */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeerManager_new_outbound_connection - * Signature: (J[BJ)J + * Method: HTLCOutputInCommitment_set_offered + * Signature: (JZ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1connection - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered + (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_ldk_impl_bindings - * Method: PeerManager_new_inbound_connection - * Signature: (JJ)J + * Method: HTLCOutputInCommitment_get_amount_msat + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeerManager_write_buffer_space_avail - * Signature: (JJ)J + * Method: HTLCOutputInCommitment_set_amount_msat + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeerManager_read_event - * Signature: (JJ[B)J + * Method: HTLCOutputInCommitment_get_cltv_expiry + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event - (JNIEnv *, jclass, jlong, jlong, jbyteArray); +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeerManager_process_events - * Signature: (J)V + * Method: HTLCOutputInCommitment_set_cltv_expiry + * Signature: (JI)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry + (JNIEnv *, jclass, jlong, jint); /* * Class: org_ldk_impl_bindings - * Method: PeerManager_socket_disconnected - * Signature: (JJ)V + * Method: HTLCOutputInCommitment_get_payment_hash + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PeerManager_timer_tick_occured - * Signature: (J)V + * Method: HTLCOutputInCommitment_set_payment_hash + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: build_commitment_secret - * Signature: ([BJ)[B + * Method: HTLCOutputInCommitment_write + * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: derive_private_key - * Signature: ([B[B)J + * Method: HTLCOutputInCommitment_read + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: derive_public_key - * Signature: ([B[B)J + * Method: get_htlc_redeemscript + * Signature: (JJ)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: derive_private_revocation_key - * Signature: ([B[B)J + * Method: make_funding_redeemscript + * Signature: ([B[B)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: derive_public_revocation_key - * Signature: ([B[B)J + * Method: build_htlc_transaction + * Signature: ([BISJ[B[B)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction + (JNIEnv *, jclass, jbyteArray, jint, jshort, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_free + * Method: ChannelTransactionParameters_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_clone + * Method: ChannelTransactionParameters_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_get_per_commitment_point - * Signature: (J)[B + * Method: ChannelTransactionParameters_get_holder_pubkeys + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_set_per_commitment_point - * Signature: (J[B)V + * Method: ChannelTransactionParameters_set_holder_pubkeys + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1pubkeys + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_get_revocation_key - * Signature: (J)[B + * Method: ChannelTransactionParameters_get_holder_selected_contest_delay + * Signature: (J)S */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_set_revocation_key - * Signature: (J[B)V + * Method: ChannelTransactionParameters_set_holder_selected_contest_delay + * Signature: (JS)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay + (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_get_broadcaster_htlc_key - * Signature: (J)[B + * Method: ChannelTransactionParameters_get_is_outbound_from_holder + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1is_1outbound_1from_1holder (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_set_broadcaster_htlc_key - * Signature: (J[B)V + * Method: ChannelTransactionParameters_set_is_outbound_from_holder + * Signature: (JZ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1is_1outbound_1from_1holder + (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_get_countersignatory_htlc_key - * Signature: (J)[B + * Method: ChannelTransactionParameters_get_counterparty_parameters + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1counterparty_1parameters (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_set_countersignatory_htlc_key - * Signature: (J[B)V + * Method: ChannelTransactionParameters_set_counterparty_parameters + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1counterparty_1parameters + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_get_broadcaster_delayed_payment_key - * Signature: (J)[B + * Method: ChannelTransactionParameters_get_funding_outpoint + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1funding_1outpoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_set_broadcaster_delayed_payment_key - * Signature: (J[B)V + * Method: ChannelTransactionParameters_set_funding_outpoint + * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1funding_1outpoint + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_new - * Signature: ([B[B[B[B[B)J + * Method: ChannelTransactionParameters_new + * Signature: (JSZJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new + (JNIEnv *, jclass, jlong, jshort, jboolean, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_write - * Signature: (J)[B + * Method: CounterpartyChannelTransactionParameters_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: PreCalculatedTxCreationKeys_free - * Signature: (J)V + * Method: CounterpartyChannelTransactionParameters_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PreCalculatedTxCreationKeys_clone + * Method: CounterpartyChannelTransactionParameters_get_pubkeys * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PreCalculatedTxCreationKeys_new - * Signature: (J)J + * Method: CounterpartyChannelTransactionParameters_set_pubkeys + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1pubkeys + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: PreCalculatedTxCreationKeys_trust_key_derivation - * Signature: (J)J + * Method: CounterpartyChannelTransactionParameters_get_selected_contest_delay + * Signature: (J)S */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: PreCalculatedTxCreationKeys_per_commitment_point - * Signature: (J)[B + * Method: CounterpartyChannelTransactionParameters_set_selected_contest_delay + * Signature: (JS)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay + (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_free - * Signature: (J)V + * Method: CounterpartyChannelTransactionParameters_new + * Signature: (JS)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new + (JNIEnv *, jclass, jlong, jshort); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_clone - * Signature: (J)J + * Method: ChannelTransactionParameters_is_populated + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1is_1populated (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_get_funding_pubkey - * Signature: (J)[B + * Method: ChannelTransactionParameters_as_holder_broadcastable + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1holder_1broadcastable (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_set_funding_pubkey - * Signature: (J[B)V + * Method: ChannelTransactionParameters_as_counterparty_broadcastable + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1counterparty_1broadcastable + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_get_revocation_basepoint + * Method: CounterpartyChannelTransactionParameters_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_set_revocation_basepoint - * Signature: (J[B)V + * Method: CounterpartyChannelTransactionParameters_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_get_payment_point + * Method: ChannelTransactionParameters_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_set_payment_point - * Signature: (J[B)V + * Method: ChannelTransactionParameters_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_get_delayed_payment_basepoint - * Signature: (J)[B + * Method: DirectedChannelTransactionParameters_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_set_delayed_payment_basepoint - * Signature: (J[B)V + * Method: DirectedChannelTransactionParameters_broadcaster_pubkeys + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_get_htlc_basepoint - * Signature: (J)[B + * Method: DirectedChannelTransactionParameters_countersignatory_pubkeys + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_set_htlc_basepoint - * Signature: (J[B)V + * Method: DirectedChannelTransactionParameters_contest_delay + * Signature: (J)S */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_new - * Signature: ([B[B[B[B[B)J + * Method: DirectedChannelTransactionParameters_is_outbound + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_write - * Signature: (J)[B + * Method: DirectedChannelTransactionParameters_funding_outpoint + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelPublicKeys_read - * Signature: ([B)J + * Method: HolderCommitmentTransaction_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TxCreationKeys_derive_new - * Signature: ([B[B[B[B[B)J + * Method: HolderCommitmentTransaction_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: get_revokeable_redeemscript - * Signature: ([BS[B)[B + * Method: HolderCommitmentTransaction_get_counterparty_sig + * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript - (JNIEnv *, jclass, jbyteArray, jshort, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_free - * Signature: (J)V + * Method: HolderCommitmentTransaction_set_counterparty_sig + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_clone - * Signature: (J)J + * Method: HolderCommitmentTransaction_set_counterparty_htlc_sigs + * Signature: (J[[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs + (JNIEnv *, jclass, jlong, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_get_offered - * Signature: (J)Z + * Method: HolderCommitmentTransaction_write + * Signature: (J)[B */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_set_offered - * Signature: (JZ)V + * Method: HolderCommitmentTransaction_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered - (JNIEnv *, jclass, jlong, jboolean); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_get_amount_msat - * Signature: (J)J + * Method: HolderCommitmentTransaction_new + * Signature: (J[B[[B[B[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new + (JNIEnv *, jclass, jlong, jbyteArray, jobjectArray, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_set_amount_msat - * Signature: (JJ)V + * Method: BuiltCommitmentTransaction_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_get_cltv_expiry - * Signature: (J)I + * Method: BuiltCommitmentTransaction_get_transaction + * Signature: (J)[B */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_set_cltv_expiry - * Signature: (JI)V + * Method: BuiltCommitmentTransaction_set_transaction + * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_get_payment_hash + * Method: BuiltCommitmentTransaction_get_txid * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_set_payment_hash + * Method: BuiltCommitmentTransaction_set_txid * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_write - * Signature: (J)[B + * Method: BuiltCommitmentTransaction_new + * Signature: ([B[B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: HTLCOutputInCommitment_read - * Signature: ([B)J + * Method: BuiltCommitmentTransaction_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: get_htlc_redeemscript - * Signature: (JJ)[B + * Method: BuiltCommitmentTransaction_read + * Signature: ([B)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: make_funding_redeemscript - * Signature: ([B[B)[B + * Method: BuiltCommitmentTransaction_get_sighash_all + * Signature: (J[BJ)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1sighash_1all + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: build_htlc_transaction - * Signature: ([BISJ[B[B)[B + * Method: BuiltCommitmentTransaction_sign + * Signature: (J[B[BJ)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction - (JNIEnv *, jclass, jbyteArray, jint, jshort, jlong, jbyteArray, jbyteArray); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_free + * Method: CommitmentTransaction_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_clone + * Method: CommitmentTransaction_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_get_unsigned_tx + * Method: CommitmentTransaction_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_set_unsigned_tx - * Signature: (J[B)V + * Method: CommitmentTransaction_read + * Signature: ([B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1read + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_get_counterparty_sig - * Signature: (J)[B + * Method: CommitmentTransaction_commitment_number + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_set_counterparty_sig - * Signature: (J[B)V + * Method: CommitmentTransaction_to_broadcaster_value_sat + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_get_feerate_per_kw - * Signature: (J)I + * Method: CommitmentTransaction_to_countersignatory_value_sat + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1feerate_1per_1kw +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_set_feerate_per_kw - * Signature: (JI)V + * Method: CommitmentTransaction_feerate_per_kw + * Signature: (J)I */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1feerate_1per_1kw - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_set_per_htlc - * Signature: (J[J)V + * Method: CommitmentTransaction_trust + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1per_1htlc - (JNIEnv *, jclass, jlong, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_new_missing_holder_sig - * Signature: ([B[B[B[BJI[J)J + * Method: CommitmentTransaction_verify + * Signature: (JJJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new_1missing_1holder_1sig - (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jlong, jint, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1verify + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_trust_key_derivation - * Signature: (J)J + * Method: TrustedCommitmentTransaction_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1trust_1key_1derivation +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_txid + * Method: TrustedCommitmentTransaction_txid * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1txid +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_get_holder_sig - * Signature: (J[B[BJ)[B + * Method: TrustedCommitmentTransaction_built_transaction + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1holder_1sig - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_get_htlc_sigs - * Signature: (J[BS)J + * Method: TrustedCommitmentTransaction_keys + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1htlc_1sigs - (JNIEnv *, jclass, jlong, jbyteArray, jshort); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_write - * Signature: (J)[B + * Method: TrustedCommitmentTransaction_get_htlc_sigs + * Signature: (J[BJ)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_read - * Signature: ([B)J + * Method: get_commitment_transaction_number_obscure_factor + * Signature: ([B[BZ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transaction_1number_1obscure_1factor + (JNIEnv *, jclass, jbyteArray, jbyteArray, jboolean); /* * Class: org_ldk_impl_bindings @@ -8546,10 +10474,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free /* * Class: org_ldk_impl_bindings * Method: NetGraphMsgHandler_new - * Signature: (JJ)J + * Signature: ([BJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new - (JNIEnv *, jclass, jlong, jlong); + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -8583,6 +10511,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NetGraphMsgHandler_as_MessageSendEventsProvider + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1MessageSendEventsProvider + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: DirectionalChannelInfo_free @@ -8655,6 +10591,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_fees + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1fees + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DirectionalChannelInfo_set_fees + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1fees + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: DirectionalChannelInfo_get_last_update_message @@ -9090,10 +11042,42 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read /* * Class: org_ldk_impl_bindings * Method: NetworkGraph_new - * Signature: ()J + * Signature: ([B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new - (JNIEnv *, jclass); + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: NetworkGraph_update_node_from_announcement + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NetworkGraph_update_node_from_unsigned_announcement + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1unsigned_1announcement + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NetworkGraph_update_channel_from_announcement + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1announcement + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NetworkGraph_update_channel_from_unsigned_announcement + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1from_1unsigned_1announcement + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -9103,6 +11087,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1from_1update (JNIEnv *, jclass, jlong, jlong, jboolean); +/* + * Class: org_ldk_impl_bindings + * Method: NetworkGraph_update_channel + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NetworkGraph_update_channel_unsigned + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned + (JNIEnv *, jclass, jlong, jlong); + #ifdef __cplusplus } #endif