From: Matt Corallo Date: Sun, 7 Mar 2021 19:18:07 +0000 (-0500) Subject: Update java bindings with new generator and new upstream code X-Git-Tag: v0.0.98~12^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=17113550a5fefab21f39f27fbfe02646b8db53ae;p=ldk-java Update java bindings with new generator and new upstream code --- diff --git a/liblightningjni.so b/liblightningjni.so index 1eb4cbbf..3db2dbaf 100755 Binary files a/liblightningjni.so and b/liblightningjni.so differ diff --git a/src/main/java/org/ldk/enums/LDKAccessError.java b/src/main/java/org/ldk/enums/LDKAccessError.java index 60d85970..2a4c57ff 100644 --- a/src/main/java/org/ldk/enums/LDKAccessError.java +++ b/src/main/java/org/ldk/enums/LDKAccessError.java @@ -1,5 +1,10 @@ package org.ldk.enums; +/** + * An error when accessing the chain via [`Access`]. + * + * [`Access`]: trait.Access.html + */ public enum LDKAccessError { LDKAccessError_UnknownChain, LDKAccessError_UnknownTx, diff --git a/src/main/java/org/ldk/enums/LDKChannelMonitorUpdateErr.java b/src/main/java/org/ldk/enums/LDKChannelMonitorUpdateErr.java index b1f8c65e..de224032 100644 --- a/src/main/java/org/ldk/enums/LDKChannelMonitorUpdateErr.java +++ b/src/main/java/org/ldk/enums/LDKChannelMonitorUpdateErr.java @@ -1,5 +1,8 @@ package org.ldk.enums; +/** + * An error enum representing a failure to persist a channel monitor update. + */ public enum LDKChannelMonitorUpdateErr { LDKChannelMonitorUpdateErr_TemporaryFailure, LDKChannelMonitorUpdateErr_PermanentFailure, diff --git a/src/main/java/org/ldk/enums/LDKConfirmationTarget.java b/src/main/java/org/ldk/enums/LDKConfirmationTarget.java index 786b424c..661de357 100644 --- a/src/main/java/org/ldk/enums/LDKConfirmationTarget.java +++ b/src/main/java/org/ldk/enums/LDKConfirmationTarget.java @@ -1,5 +1,9 @@ package org.ldk.enums; +/** + * An enum that represents the speed at which we want a transaction to confirm used for feerate + * estimation. + */ public enum LDKConfirmationTarget { LDKConfirmationTarget_Background, LDKConfirmationTarget_Normal, diff --git a/src/main/java/org/ldk/enums/LDKLevel.java b/src/main/java/org/ldk/enums/LDKLevel.java index b783548a..87312928 100644 --- a/src/main/java/org/ldk/enums/LDKLevel.java +++ b/src/main/java/org/ldk/enums/LDKLevel.java @@ -1,5 +1,8 @@ package org.ldk.enums; +/** + * An enum representing the available verbosity levels of the logger. + */ public enum LDKLevel { LDKLevel_Off, LDKLevel_Error, diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 6ae3d22f..0a94d538 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -383,6 +383,14 @@ public class bindings { 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 long LDKC2Tuple_u32ScriptZ_new(int a, byte[] b); + public static native int LDKC2Tuple_u32ScriptZ_get_a(long ptr); + public static native byte[] LDKC2Tuple_u32ScriptZ_get_b(long ptr); + public static native long LDKCVec_C2Tuple_u32ScriptZZ_new(long[] elems); + public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(byte[] a, long[] b); + public static native byte[] LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(long ptr); + public static native long[] LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(long ptr); + public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new(long[] elems); 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); @@ -414,29 +422,29 @@ public class bindings { byte[] write(); } public static native long LDKSign_new(LDKSign impl, long pubkeys); - // LDKPublicKey Sign_get_per_commitment_point LDKSign* this_arg, uint64_t idx + // LDKPublicKey Sign_get_per_commitment_point LDKSign *NONNULL_PTR this_arg, uint64_t idx public static native byte[] Sign_get_per_commitment_point(long this_arg, long idx); - // LDKThirtyTwoBytes Sign_release_commitment_secret LDKSign* this_arg, uint64_t idx + // LDKThirtyTwoBytes Sign_release_commitment_secret LDKSign *NONNULL_PTR this_arg, uint64_t idx public static native byte[] Sign_release_commitment_secret(long this_arg, long idx); - // LDKThirtyTwoBytes Sign_channel_keys_id LDKSign* this_arg + // LDKThirtyTwoBytes Sign_channel_keys_id LDKSign *NONNULL_PTR this_arg public static native byte[] Sign_channel_keys_id(long this_arg); - // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_counterparty_commitment LDKSign* this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx + // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_counterparty_commitment LDKSign *NONNULL_PTR this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx public static native long Sign_sign_counterparty_commitment(long this_arg, long commitment_tx); - // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_holder_commitment_and_htlcs LDKSign* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx + // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_holder_commitment_and_htlcs LDKSign *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx public static native long Sign_sign_holder_commitment_and_htlcs(long this_arg, long commitment_tx); - // LDKCResult_SignatureNoneZ Sign_sign_justice_transaction LDKSign* 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 + // LDKCResult_SignatureNoneZ Sign_sign_justice_transaction LDKSign *NONNULL_PTR 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 Sign_sign_justice_transaction(long this_arg, byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc); - // LDKCResult_SignatureNoneZ Sign_sign_counterparty_htlc_transaction LDKSign* this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc + // LDKCResult_SignatureNoneZ Sign_sign_counterparty_htlc_transaction LDKSign *NONNULL_PTR 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 Sign_sign_counterparty_htlc_transaction(long this_arg, byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc); - // LDKCResult_SignatureNoneZ Sign_sign_closing_transaction LDKSign* this_arg, struct LDKTransaction closing_tx + // LDKCResult_SignatureNoneZ Sign_sign_closing_transaction LDKSign *NONNULL_PTR this_arg, struct LDKTransaction closing_tx public static native long Sign_sign_closing_transaction(long this_arg, byte[] closing_tx); - // LDKCResult_SignatureNoneZ Sign_sign_channel_announcement LDKSign* this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg + // LDKCResult_SignatureNoneZ Sign_sign_channel_announcement LDKSign *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg public static native long Sign_sign_channel_announcement(long this_arg, long msg); - // void Sign_ready_channel LDKSign* this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters + // void Sign_ready_channel LDKSign *NONNULL_PTR this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters public static native void Sign_ready_channel(long this_arg, long channel_parameters); - // LDKCVec_u8Z Sign_write LDKSign* this_arg + // LDKCVec_u8Z Sign_write LDKSign *NONNULL_PTR this_arg public static native byte[] Sign_write(long this_arg); - // LDKChannelPublicKeys Sign_get_pubkeys LDKSign* this_arg + // LDKChannelPublicKeys Sign_get_pubkeys LDKSign *NONNULL_PTR this_arg public static native long Sign_get_pubkeys(long this_arg); public static native long LDKC2Tuple_BlockHashChannelMonitorZ_new(byte[] a, long b); public static native byte[] LDKC2Tuple_BlockHashChannelMonitorZ_get_a(long ptr); @@ -507,17 +515,17 @@ public class bindings { long[] release_pending_monitor_events(); } public static native long LDKWatch_new(LDKWatch impl); - // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_watch_channel LDKWatch* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor + // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_watch_channel LDKWatch *NONNULL_PTR 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, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update + // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_update_channel LDKWatch *NONNULL_PTR 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 + // LDKCVec_MonitorEventZ Watch_release_pending_monitor_events LDKWatch *NONNULL_PTR this_arg public static native long[] Watch_release_pending_monitor_events(long this_arg); public interface LDKBroadcasterInterface { void broadcast_transaction(byte[] tx); } public static native long LDKBroadcasterInterface_new(LDKBroadcasterInterface impl); - // void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface* this_arg, struct LDKTransaction tx + // void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface *NONNULL_PTR this_arg, struct LDKTransaction tx public static native void BroadcasterInterface_broadcast_transaction(long this_arg, byte[] tx); public static native boolean LDKCResult_SignDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_SignDecodeErrorZ_get_ok(long arg); @@ -531,23 +539,23 @@ public class bindings { long read_chan_signer(byte[] reader); } public static native long LDKKeysInterface_new(LDKKeysInterface impl); - // LDKSecretKey KeysInterface_get_node_secret LDKKeysInterface* this_arg + // LDKSecretKey KeysInterface_get_node_secret LDKKeysInterface *NONNULL_PTR this_arg public static native byte[] KeysInterface_get_node_secret(long this_arg); - // LDKCVec_u8Z KeysInterface_get_destination_script LDKKeysInterface* this_arg + // LDKCVec_u8Z KeysInterface_get_destination_script LDKKeysInterface *NONNULL_PTR this_arg public static native byte[] KeysInterface_get_destination_script(long this_arg); - // LDKPublicKey KeysInterface_get_shutdown_pubkey LDKKeysInterface* this_arg + // LDKPublicKey KeysInterface_get_shutdown_pubkey LDKKeysInterface *NONNULL_PTR this_arg public static native byte[] KeysInterface_get_shutdown_pubkey(long this_arg); - // LDKSign KeysInterface_get_channel_signer LDKKeysInterface* this_arg, bool inbound, uint64_t channel_value_satoshis + // LDKSign KeysInterface_get_channel_signer LDKKeysInterface *NONNULL_PTR this_arg, bool inbound, uint64_t channel_value_satoshis public static native long KeysInterface_get_channel_signer(long this_arg, boolean inbound, long channel_value_satoshis); - // LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface* this_arg + // LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface *NONNULL_PTR this_arg public static native byte[] KeysInterface_get_secure_random_bytes(long this_arg); - // LDKCResult_SignDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface* this_arg, struct LDKu8slice reader + // LDKCResult_SignDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface *NONNULL_PTR 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); } public static native long LDKFeeEstimator_new(LDKFeeEstimator impl); - // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator* this_arg, enum LDKConfirmationTarget confirmation_target + // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator *NONNULL_PTR 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); @@ -687,46 +695,46 @@ public class bindings { long[] get_and_clear_pending_msg_events(); } public static native long LDKMessageSendEventsProvider_new(LDKMessageSendEventsProvider impl); - // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider* this_arg + // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider *NONNULL_PTR 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); - // LDKCVec_EventZ EventsProvider_get_and_clear_pending_events LDKEventsProvider* this_arg + // LDKCVec_EventZ EventsProvider_get_and_clear_pending_events LDKEventsProvider *NONNULL_PTR 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); - // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id + // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess *NONNULL_PTR 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 LDKListen { void block_connected(byte[] block, int height); void block_disconnected(byte[] header, int height); } public static native long LDKListen_new(LDKListen impl); - // void Listen_block_connected LDKListen* this_arg, struct LDKu8slice block, uint32_t height + // void Listen_block_connected LDKListen *NONNULL_PTR this_arg, struct LDKu8slice block, uint32_t height public static native void Listen_block_connected(long this_arg, byte[] block, int height); - // void Listen_block_disconnected LDKListen* this_arg, const uint8_t (*header)[80], uint32_t height + // void Listen_block_disconnected LDKListen *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height public static native void Listen_block_disconnected(long this_arg, byte[] header, int height); public interface LDKFilter { void register_tx(byte[] txid, byte[] script_pubkey); void register_output(long outpoint, byte[] script_pubkey); } public static native long LDKFilter_new(LDKFilter impl); - // void Filter_register_tx LDKFilter* this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey + // void Filter_register_tx LDKFilter *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey public static native void Filter_register_tx(long this_arg, byte[] txid, byte[] script_pubkey); - // void Filter_register_output LDKFilter* this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey + // void Filter_register_output LDKFilter *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey public static native void Filter_register_output(long this_arg, long outpoint, byte[] script_pubkey); 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); - // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data + // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist *NONNULL_PTR 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 + // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist *NONNULL_PTR 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); @@ -750,43 +758,43 @@ public class bindings { void handle_error(byte[] their_node_id, long msg); } public static native long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider); - // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg + // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg + // void ChannelMessageHandler_handle_accept_channel LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg + // void ChannelMessageHandler_handle_funding_created LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg + // void ChannelMessageHandler_handle_funding_signed LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg + // void ChannelMessageHandler_handle_funding_locked LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg + // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_shutdown(long this_arg, byte[] their_node_id, long their_features, long msg); - // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg + // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg + // void ChannelMessageHandler_handle_update_add_htlc LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg + // void ChannelMessageHandler_handle_update_fulfill_htlc LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg + // void ChannelMessageHandler_handle_update_fail_htlc LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg + // void ChannelMessageHandler_handle_update_fail_malformed_htlc LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg + // void ChannelMessageHandler_handle_commitment_signed LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg + // void ChannelMessageHandler_handle_revoke_and_ack LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg + // void ChannelMessageHandler_handle_update_fee LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg + // void ChannelMessageHandler_handle_announcement_signatures LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, bool no_connection_possible + // void ChannelMessageHandler_peer_disconnected LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg + // void ChannelMessageHandler_peer_connected LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg + // void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler *NONNULL_PTR 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, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg + // void ChannelMessageHandler_handle_error LDKChannelMessageHandler *NONNULL_PTR 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 interface LDKRoutingMessageHandler { long handle_node_announcement(long msg); @@ -802,27 +810,27 @@ public class bindings { long handle_query_short_channel_ids(byte[] their_node_id, long msg); } public static native long LDKRoutingMessageHandler_new(LDKRoutingMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider); - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler* this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler *NONNULL_PTR 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 struct LDKChannelAnnouncement *NONNULL_PTR msg + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR 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 struct LDKChannelUpdate *NONNULL_PTR msg + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler *NONNULL_PTR 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 struct LDKHTLCFailChannelUpdate *NONNULL_PTR update + // void RoutingMessageHandler_handle_htlc_fail_channel_update LDKRoutingMessageHandler *NONNULL_PTR 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 + // LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ RoutingMessageHandler_get_next_channel_announcements LDKRoutingMessageHandler *NONNULL_PTR 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, struct LDKPublicKey starting_point, uint8_t batch_amount + // LDKCVec_NodeAnnouncementZ RoutingMessageHandler_get_next_node_announcements LDKRoutingMessageHandler *NONNULL_PTR 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); - // void RoutingMessageHandler_sync_routing_table LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init + // void RoutingMessageHandler_sync_routing_table LDKRoutingMessageHandler *NONNULL_PTR 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 + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_channel_range LDKRoutingMessageHandler *NONNULL_PTR 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 + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_short_channel_ids_end LDKRoutingMessageHandler *NONNULL_PTR 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 + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_channel_range LDKRoutingMessageHandler *NONNULL_PTR 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 + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_short_channel_ids LDKRoutingMessageHandler *NONNULL_PTR 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); @@ -831,11 +839,11 @@ public class bindings { long hash(); } public static native long LDKSocketDescriptor_new(LDKSocketDescriptor impl); - // uintptr_t SocketDescriptor_send_data LDKSocketDescriptor* this_arg, struct LDKu8slice data, bool resume_read + // uintptr_t SocketDescriptor_send_data LDKSocketDescriptor *NONNULL_PTR 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 + // void SocketDescriptor_disconnect_socket LDKSocketDescriptor *NONNULL_PTR this_arg public static native void SocketDescriptor_disconnect_socket(long this_arg); - // uint64_t SocketDescriptor_hash LDKSocketDescriptor* this_arg + // uint64_t SocketDescriptor_hash LDKSocketDescriptor *NONNULL_PTR this_arg public static native long SocketDescriptor_hash(long this_arg); // void Transaction_free(struct LDKTransaction _res); public static native void Transaction_free(byte[] _res); @@ -1131,6 +1139,20 @@ public class bindings { public static native long C2Tuple_OutPointScriptZ_new(long a, byte[] b); // void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res); public static native void C2Tuple_OutPointScriptZ_free(long _res); + // struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig); + public static native long C2Tuple_u32ScriptZ_clone(long orig); + // struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b); + public static native long C2Tuple_u32ScriptZ_new(int a, byte[] b); + // void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res); + public static native void C2Tuple_u32ScriptZ_free(long _res); + // void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res); + public static native void CVec_C2Tuple_u32ScriptZZ_free(long[] _res); + // struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b); + public static native long C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(byte[] a, long[] b); + // void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res); + public static native void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(long _res); + // void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res); + public static native void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(long[] _res); // void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); public static native void CVec_TransactionZ_free(byte[][] _res); // struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig); @@ -1583,8 +1605,8 @@ public class bindings { public static native LDKLevel Level_max(); // void Logger_free(struct LDKLogger this_ptr); public static native void Logger_free(long this_ptr); - // void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_ptr); - public static native void ChannelHandshakeConfig_free(long this_ptr); + // void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj); + public static native void ChannelHandshakeConfig_free(long this_obj); // 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(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val); @@ -1603,8 +1625,8 @@ public class bindings { public static native long ChannelHandshakeConfig_clone(long orig); // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void); public static native long ChannelHandshakeConfig_default(); - // void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_ptr); - public static native void ChannelHandshakeLimits_free(long this_ptr); + // void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj); + public static native void ChannelHandshakeLimits_free(long this_obj); // 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(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); @@ -1651,8 +1673,8 @@ public class bindings { public static native long ChannelHandshakeLimits_clone(long orig); // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void); public static native long ChannelHandshakeLimits_default(); - // void ChannelConfig_free(struct LDKChannelConfig this_ptr); - public static native void ChannelConfig_free(long this_ptr); + // void ChannelConfig_free(struct LDKChannelConfig this_obj); + public static native void ChannelConfig_free(long this_obj); // 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(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val); @@ -1675,8 +1697,8 @@ public class bindings { public static native byte[] ChannelConfig_write(long obj); // struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser); public static native long ChannelConfig_read(byte[] ser); - // void UserConfig_free(struct LDKUserConfig this_ptr); - public static native void UserConfig_free(long this_ptr); + // void UserConfig_free(struct LDKUserConfig this_obj); + public static native void UserConfig_free(long this_obj); // 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(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val); @@ -1711,8 +1733,8 @@ public class bindings { public static native LDKConfirmationTarget ConfirmationTarget_clone(long orig); // void FeeEstimator_free(struct LDKFeeEstimator this_ptr); public static native void FeeEstimator_free(long this_ptr); - // void ChainMonitor_free(struct LDKChainMonitor this_ptr); - public static native void ChainMonitor_free(long this_ptr); + // void ChainMonitor_free(struct LDKChainMonitor this_obj); + public static native void ChainMonitor_free(long this_obj); // 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 struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height); @@ -1723,8 +1745,8 @@ public class bindings { public static native long ChainMonitor_as_Watch(long 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(struct LDKChannelMonitorUpdate this_ptr); - public static native void ChannelMonitorUpdate_free(long this_ptr); + // void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj); + public static native void ChannelMonitorUpdate_free(long this_obj); // 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(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val); @@ -1737,24 +1759,24 @@ public class bindings { public static native long ChannelMonitorUpdate_read(byte[] ser); // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig); public static native LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(long orig); - // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_ptr); - public static native void MonitorUpdateError_free(long this_ptr); + // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj); + public static native void MonitorUpdateError_free(long this_obj); // struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig); public static native long MonitorUpdateError_clone(long orig); // void MonitorEvent_free(struct LDKMonitorEvent this_ptr); public static native void MonitorEvent_free(long this_ptr); // struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig); public static native long MonitorEvent_clone(long orig); - // void HTLCUpdate_free(struct LDKHTLCUpdate this_ptr); - public static native void HTLCUpdate_free(long this_ptr); + // void HTLCUpdate_free(struct LDKHTLCUpdate this_obj); + public static native void HTLCUpdate_free(long this_obj); // struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig); public static native long HTLCUpdate_clone(long orig); // struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj); public static native byte[] HTLCUpdate_write(long obj); // struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser); public static native long HTLCUpdate_read(byte[] ser); - // void ChannelMonitor_free(struct LDKChannelMonitor this_ptr); - public static native void ChannelMonitor_free(long this_ptr); + // void ChannelMonitor_free(struct LDKChannelMonitor this_obj); + public static native void ChannelMonitor_free(long this_obj); // struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig); public static native long ChannelMonitor_clone(long orig); // struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj); @@ -1765,6 +1787,10 @@ public class bindings { public static native long ChannelMonitor_get_latest_update_id(long 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 struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg); + public static native long[] ChannelMonitor_get_outputs_to_watch(long this_arg); + // void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter); + public static native void ChannelMonitor_load_outputs_to_watch(long this_arg, long filter); // MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg); public static native long[] ChannelMonitor_get_and_clear_pending_monitor_events(long this_arg); // MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg); @@ -1779,8 +1805,8 @@ public class bindings { 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); + // void OutPoint_free(struct LDKOutPoint this_obj); + public static native void OutPoint_free(long this_obj); // 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(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -1799,8 +1825,8 @@ public class bindings { public static native byte[] OutPoint_write(long obj); // struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser); public static native long OutPoint_read(byte[] ser); - // void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_ptr); - public static native void DelayedPaymentOutputDescriptor_free(long this_ptr); + // void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj); + public static native void DelayedPaymentOutputDescriptor_free(long this_obj); // struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); public static native long DelayedPaymentOutputDescriptor_get_outpoint(long this_ptr); // void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val); @@ -1831,8 +1857,8 @@ public class bindings { public static native long DelayedPaymentOutputDescriptor_new(long outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, long output_arg, byte[] revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg); // struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig); public static native long DelayedPaymentOutputDescriptor_clone(long orig); - // void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_ptr); - public static native void StaticPaymentOutputDescriptor_free(long this_ptr); + // void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj); + public static native void StaticPaymentOutputDescriptor_free(long this_obj); // struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr); public static native long StaticPaymentOutputDescriptor_get_outpoint(long this_ptr); // void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val); @@ -1865,8 +1891,8 @@ public class bindings { public static native void Sign_free(long this_ptr); // void KeysInterface_free(struct LDKKeysInterface this_ptr); public static native void KeysInterface_free(long this_ptr); - // void InMemorySigner_free(struct LDKInMemorySigner this_ptr); - public static native void InMemorySigner_free(long this_ptr); + // void InMemorySigner_free(struct LDKInMemorySigner this_obj); + public static native void InMemorySigner_free(long this_obj); // const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; public static native byte[] InMemorySigner_get_funding_key(long this_ptr); // void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); @@ -1917,8 +1943,8 @@ public class bindings { public static native byte[] InMemorySigner_write(long obj); // struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser); public static native long InMemorySigner_read(byte[] ser); - // void KeysManager_free(struct LDKKeysManager this_ptr); - public static native void KeysManager_free(long this_ptr); + // void KeysManager_free(struct LDKKeysManager this_obj); + public static native void KeysManager_free(long this_obj); // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos); public static native long KeysManager_new(byte[] seed, long starting_time_secs, int starting_time_nanos); // MUST_USE_RES struct LDKInMemorySigner KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]); @@ -1927,10 +1953,10 @@ public class bindings { public static native long KeysManager_spend_spendable_outputs(long this_arg, long[] descriptors, long[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight); // 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(struct LDKChannelManager this_ptr); - public static native void ChannelManager_free(long this_ptr); - // void ChainParameters_free(struct LDKChainParameters this_ptr); - public static native void ChainParameters_free(long this_ptr); + // void ChannelManager_free(struct LDKChannelManager this_obj); + public static native void ChannelManager_free(long this_obj); + // void ChainParameters_free(struct LDKChainParameters this_obj); + public static native void ChainParameters_free(long this_obj); // enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr); public static native LDKNetwork ChainParameters_get_network(long this_ptr); // void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val); @@ -1945,8 +1971,8 @@ public class bindings { public static native void ChainParameters_set_latest_height(long this_ptr, long val); // MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKThirtyTwoBytes latest_hash_arg, uintptr_t latest_height_arg); public static native long ChainParameters_new(LDKNetwork network_arg, byte[] latest_hash_arg, long latest_height_arg); - // void ChannelDetails_free(struct LDKChannelDetails this_ptr); - public static native void ChannelDetails_free(long this_ptr); + // void ChannelDetails_free(struct LDKChannelDetails this_obj); + public static native void ChannelDetails_free(long this_obj); // 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(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2033,8 +2059,8 @@ public class bindings { public static native long ChannelManager_as_ChannelMessageHandler(long this_arg); // 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); + // void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj); + public static native void ChannelManagerReadArgs_free(long this_obj); // 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(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val); @@ -2063,12 +2089,12 @@ public class bindings { 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); // 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 DecodeError_free(struct LDKDecodeError this_obj); + public static native void DecodeError_free(long this_obj); // struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig); public static native long DecodeError_clone(long orig); - // void Init_free(struct LDKInit this_ptr); - public static native void Init_free(long this_ptr); + // void Init_free(struct LDKInit this_obj); + public static native void Init_free(long this_obj); // struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr); public static native long Init_get_features(long this_ptr); // void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val); @@ -2077,8 +2103,8 @@ public class bindings { public static native long Init_new(long features_arg); // struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig); public static native long Init_clone(long orig); - // void ErrorMessage_free(struct LDKErrorMessage this_ptr); - public static native void ErrorMessage_free(long this_ptr); + // void ErrorMessage_free(struct LDKErrorMessage this_obj); + public static native void ErrorMessage_free(long this_obj); // 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(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2091,8 +2117,8 @@ public class bindings { public static native long ErrorMessage_new(byte[] channel_id_arg, byte[] data_arg); // struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig); public static native long ErrorMessage_clone(long orig); - // void Ping_free(struct LDKPing this_ptr); - public static native void Ping_free(long this_ptr); + // void Ping_free(struct LDKPing this_obj); + public static native void Ping_free(long this_obj); // 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(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val); @@ -2105,8 +2131,8 @@ public class bindings { public static native long Ping_new(short ponglen_arg, short byteslen_arg); // struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig); public static native long Ping_clone(long orig); - // void Pong_free(struct LDKPong this_ptr); - public static native void Pong_free(long this_ptr); + // void Pong_free(struct LDKPong this_obj); + public static native void Pong_free(long this_obj); // 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(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val); @@ -2115,8 +2141,8 @@ public class bindings { public static native long Pong_new(short byteslen_arg); // struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig); public static native long Pong_clone(long orig); - // void OpenChannel_free(struct LDKOpenChannel this_ptr); - public static native void OpenChannel_free(long this_ptr); + // void OpenChannel_free(struct LDKOpenChannel this_obj); + public static native void OpenChannel_free(long this_obj); // 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(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2191,8 +2217,8 @@ public class bindings { public static native void OpenChannel_set_channel_flags(long this_ptr, byte val); // struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig); public static native long OpenChannel_clone(long orig); - // void AcceptChannel_free(struct LDKAcceptChannel this_ptr); - public static native void AcceptChannel_free(long this_ptr); + // void AcceptChannel_free(struct LDKAcceptChannel this_obj); + public static native void AcceptChannel_free(long this_obj); // 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(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2251,8 +2277,8 @@ public class bindings { public static native void AcceptChannel_set_first_per_commitment_point(long this_ptr, byte[] val); // struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig); public static native long AcceptChannel_clone(long orig); - // void FundingCreated_free(struct LDKFundingCreated this_ptr); - public static native void FundingCreated_free(long this_ptr); + // void FundingCreated_free(struct LDKFundingCreated this_obj); + public static native void FundingCreated_free(long this_obj); // 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(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2273,8 +2299,8 @@ public class bindings { public static native long FundingCreated_new(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg); // struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig); public static native long FundingCreated_clone(long orig); - // void FundingSigned_free(struct LDKFundingSigned this_ptr); - public static native void FundingSigned_free(long this_ptr); + // void FundingSigned_free(struct LDKFundingSigned this_obj); + public static native void FundingSigned_free(long this_obj); // 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(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2287,8 +2313,8 @@ public class bindings { public static native long FundingSigned_new(byte[] channel_id_arg, byte[] signature_arg); // struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig); public static native long FundingSigned_clone(long orig); - // void FundingLocked_free(struct LDKFundingLocked this_ptr); - public static native void FundingLocked_free(long this_ptr); + // void FundingLocked_free(struct LDKFundingLocked this_obj); + public static native void FundingLocked_free(long this_obj); // 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(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2301,8 +2327,8 @@ public class bindings { public static native long FundingLocked_new(byte[] channel_id_arg, byte[] next_per_commitment_point_arg); // struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig); public static native long FundingLocked_clone(long orig); - // void Shutdown_free(struct LDKShutdown this_ptr); - public static native void Shutdown_free(long this_ptr); + // void Shutdown_free(struct LDKShutdown this_obj); + public static native void Shutdown_free(long this_obj); // 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(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2315,8 +2341,8 @@ public class bindings { public static native long Shutdown_new(byte[] channel_id_arg, byte[] scriptpubkey_arg); // struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig); public static native long Shutdown_clone(long orig); - // void ClosingSigned_free(struct LDKClosingSigned this_ptr); - public static native void ClosingSigned_free(long this_ptr); + // void ClosingSigned_free(struct LDKClosingSigned this_obj); + public static native void ClosingSigned_free(long this_obj); // 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(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2333,8 +2359,8 @@ public class bindings { public static native long ClosingSigned_new(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg); // struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig); public static native long ClosingSigned_clone(long orig); - // void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr); - public static native void UpdateAddHTLC_free(long this_ptr); + // void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj); + public static native void UpdateAddHTLC_free(long this_obj); // 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(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2357,8 +2383,8 @@ public class bindings { public static native void UpdateAddHTLC_set_cltv_expiry(long this_ptr, int val); // struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig); public static native long UpdateAddHTLC_clone(long orig); - // void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr); - public static native void UpdateFulfillHTLC_free(long this_ptr); + // void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj); + public static native void UpdateFulfillHTLC_free(long this_obj); // 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(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2375,8 +2401,8 @@ public class bindings { public static native long UpdateFulfillHTLC_new(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg); // struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig); public static native long UpdateFulfillHTLC_clone(long orig); - // void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr); - public static native void UpdateFailHTLC_free(long this_ptr); + // void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj); + public static native void UpdateFailHTLC_free(long this_obj); // 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(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2387,8 +2413,8 @@ public class bindings { public static native void UpdateFailHTLC_set_htlc_id(long this_ptr, long val); // struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig); public static native long UpdateFailHTLC_clone(long orig); - // void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr); - public static native void UpdateFailMalformedHTLC_free(long this_ptr); + // void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj); + public static native void UpdateFailMalformedHTLC_free(long this_obj); // 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(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2403,8 +2429,8 @@ public class bindings { public static native void UpdateFailMalformedHTLC_set_failure_code(long this_ptr, short val); // struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig); public static native long UpdateFailMalformedHTLC_clone(long orig); - // void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr); - public static native void CommitmentSigned_free(long this_ptr); + // void CommitmentSigned_free(struct LDKCommitmentSigned this_obj); + public static native void CommitmentSigned_free(long this_obj); // 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(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2419,8 +2445,8 @@ public class bindings { public static native long CommitmentSigned_new(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg); // struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); public static native long CommitmentSigned_clone(long orig); - // void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr); - public static native void RevokeAndACK_free(long this_ptr); + // void RevokeAndACK_free(struct LDKRevokeAndACK this_obj); + public static native void RevokeAndACK_free(long this_obj); // 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(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2437,8 +2463,8 @@ public class bindings { public static native long RevokeAndACK_new(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg); // struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig); public static native long RevokeAndACK_clone(long orig); - // void UpdateFee_free(struct LDKUpdateFee this_ptr); - public static native void UpdateFee_free(long this_ptr); + // void UpdateFee_free(struct LDKUpdateFee this_obj); + public static native void UpdateFee_free(long this_obj); // 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(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2451,8 +2477,8 @@ public class bindings { public static native long UpdateFee_new(byte[] channel_id_arg, int feerate_per_kw_arg); // struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig); public static native long UpdateFee_clone(long orig); - // void DataLossProtect_free(struct LDKDataLossProtect this_ptr); - public static native void DataLossProtect_free(long this_ptr); + // void DataLossProtect_free(struct LDKDataLossProtect this_obj); + public static native void DataLossProtect_free(long this_obj); // 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(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2465,8 +2491,8 @@ public class bindings { public static native long DataLossProtect_new(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg); // struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig); public static native long DataLossProtect_clone(long orig); - // void ChannelReestablish_free(struct LDKChannelReestablish this_ptr); - public static native void ChannelReestablish_free(long this_ptr); + // void ChannelReestablish_free(struct LDKChannelReestablish this_obj); + public static native void ChannelReestablish_free(long this_obj); // 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(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2481,8 +2507,8 @@ public class bindings { public static native void ChannelReestablish_set_next_remote_commitment_number(long this_ptr, long val); // struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig); public static native long ChannelReestablish_clone(long orig); - // void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr); - public static native void AnnouncementSignatures_free(long this_ptr); + // void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj); + public static native void AnnouncementSignatures_free(long this_obj); // 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(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2511,8 +2537,8 @@ public class bindings { 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); + // void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj); + public static native void UnsignedNodeAnnouncement_free(long this_obj); // 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(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); @@ -2537,8 +2563,8 @@ public class bindings { public static native void UnsignedNodeAnnouncement_set_addresses(long this_ptr, long[] val); // struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig); public static native long UnsignedNodeAnnouncement_clone(long orig); - // void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr); - public static native void NodeAnnouncement_free(long this_ptr); + // void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj); + public static native void NodeAnnouncement_free(long this_obj); // 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(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); @@ -2551,8 +2577,8 @@ public class bindings { public static native long NodeAnnouncement_new(byte[] signature_arg, long contents_arg); // struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig); public static native long NodeAnnouncement_clone(long orig); - // void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr); - public static native void UnsignedChannelAnnouncement_free(long this_ptr); + // void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj); + public static native void UnsignedChannelAnnouncement_free(long this_obj); // 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(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); @@ -2583,8 +2609,8 @@ public class bindings { public static native void UnsignedChannelAnnouncement_set_bitcoin_key_2(long this_ptr, byte[] val); // struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig); public static native long UnsignedChannelAnnouncement_clone(long orig); - // void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr); - public static native void ChannelAnnouncement_free(long this_ptr); + // void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj); + public static native void ChannelAnnouncement_free(long this_obj); // 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(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); @@ -2609,8 +2635,8 @@ public class bindings { 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); // struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig); public static native long ChannelAnnouncement_clone(long orig); - // void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr); - public static native void UnsignedChannelUpdate_free(long this_ptr); + // void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj); + public static native void UnsignedChannelUpdate_free(long this_obj); // 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(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2645,8 +2671,8 @@ public class bindings { public static native void UnsignedChannelUpdate_set_fee_proportional_millionths(long this_ptr, int val); // struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); public static native long UnsignedChannelUpdate_clone(long orig); - // void ChannelUpdate_free(struct LDKChannelUpdate this_ptr); - public static native void ChannelUpdate_free(long this_ptr); + // void ChannelUpdate_free(struct LDKChannelUpdate this_obj); + public static native void ChannelUpdate_free(long this_obj); // 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(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val); @@ -2659,8 +2685,8 @@ public class bindings { public static native long ChannelUpdate_new(byte[] signature_arg, long contents_arg); // struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig); public static native long ChannelUpdate_clone(long orig); - // void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr); - public static native void QueryChannelRange_free(long this_ptr); + // void QueryChannelRange_free(struct LDKQueryChannelRange this_obj); + public static native void QueryChannelRange_free(long this_obj); // 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(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2677,8 +2703,8 @@ public class bindings { public static native long QueryChannelRange_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg); // struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig); public static native long QueryChannelRange_clone(long orig); - // void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr); - public static native void ReplyChannelRange_free(long this_ptr); + // void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj); + public static native void ReplyChannelRange_free(long this_obj); // 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(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2701,8 +2727,8 @@ public class bindings { public static native long ReplyChannelRange_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean sync_complete_arg, long[] short_channel_ids_arg); // struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig); public static native long ReplyChannelRange_clone(long orig); - // void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr); - public static native void QueryShortChannelIds_free(long this_ptr); + // void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj); + public static native void QueryShortChannelIds_free(long this_obj); // 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(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2713,8 +2739,8 @@ public class bindings { public static native long QueryShortChannelIds_new(byte[] chain_hash_arg, long[] short_channel_ids_arg); // struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig); public static native long QueryShortChannelIds_clone(long orig); - // void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr); - public static native void ReplyShortChannelIdsEnd_free(long this_ptr); + // void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj); + public static native void ReplyShortChannelIdsEnd_free(long this_obj); // 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(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2727,8 +2753,8 @@ public class bindings { public static native long ReplyShortChannelIdsEnd_new(byte[] chain_hash_arg, boolean full_information_arg); // struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig); public static native long ReplyShortChannelIdsEnd_clone(long orig); - // void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr); - public static native void GossipTimestampFilter_free(long this_ptr); + // void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj); + public static native void GossipTimestampFilter_free(long this_obj); // 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(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); @@ -2749,8 +2775,8 @@ public class bindings { public static native void ErrorAction_free(long this_ptr); // struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig); public static native long ErrorAction_clone(long orig); - // void LightningError_free(struct LDKLightningError this_ptr); - public static native void LightningError_free(long this_ptr); + // void LightningError_free(struct LDKLightningError this_obj); + public static native void LightningError_free(long this_obj); // 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(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); @@ -2763,8 +2789,8 @@ public class bindings { public static native long LightningError_new(byte[] err_arg, long action_arg); // struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig); public static native long LightningError_clone(long orig); - // void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr); - public static native void CommitmentUpdate_free(long this_ptr); + // void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj); + public static native void CommitmentUpdate_free(long this_obj); // 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(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val); @@ -2917,24 +2943,24 @@ public class bindings { public static native long GossipTimestampFilter_read(byte[] ser); // struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj); public static native byte[] GossipTimestampFilter_write(long obj); - // void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_ptr); - public static native void IgnoringMessageHandler_free(long this_ptr); + // void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj); + public static native void IgnoringMessageHandler_free(long this_obj); // MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void); public static native long IgnoringMessageHandler_new(); // struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); public static native long IgnoringMessageHandler_as_MessageSendEventsProvider(long this_arg); // struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); public static native long IgnoringMessageHandler_as_RoutingMessageHandler(long this_arg); - // void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_ptr); - public static native void ErroringMessageHandler_free(long this_ptr); + // void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj); + public static native void ErroringMessageHandler_free(long this_obj); // MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void); public static native long ErroringMessageHandler_new(); // struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg); public static native long ErroringMessageHandler_as_MessageSendEventsProvider(long this_arg); // struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg); public static native long ErroringMessageHandler_as_ChannelMessageHandler(long this_arg); - // void MessageHandler_free(struct LDKMessageHandler this_ptr); - public static native void MessageHandler_free(long this_ptr); + // void MessageHandler_free(struct LDKMessageHandler this_obj); + public static native void MessageHandler_free(long this_obj); // 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(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val); @@ -2949,8 +2975,8 @@ public class bindings { public static native long SocketDescriptor_clone(long orig); // void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr); public static native void SocketDescriptor_free(long this_ptr); - // void PeerHandleError_free(struct LDKPeerHandleError this_ptr); - public static native void PeerHandleError_free(long this_ptr); + // void PeerHandleError_free(struct LDKPeerHandleError this_obj); + public static native void PeerHandleError_free(long this_obj); // 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(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val); @@ -2959,8 +2985,8 @@ public class bindings { public static native long PeerHandleError_new(boolean no_connection_possible_arg); // struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig); public static native long PeerHandleError_clone(long orig); - // void PeerManager_free(struct LDKPeerManager this_ptr); - public static native void PeerManager_free(long this_ptr); + // void PeerManager_free(struct LDKPeerManager this_obj); + public static native void PeerManager_free(long this_obj); // 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 struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg); @@ -2991,8 +3017,8 @@ public class bindings { public static native long derive_private_revocation_key(byte[] per_commitment_secret, byte[] countersignatory_revocation_base_secret); // struct LDKCResult_PublicKeyErrorZ 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(struct LDKTxCreationKeys this_ptr); - public static native void TxCreationKeys_free(long this_ptr); + // void TxCreationKeys_free(struct LDKTxCreationKeys this_obj); + public static native void TxCreationKeys_free(long this_obj); // 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(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); @@ -3021,8 +3047,8 @@ public class bindings { public static native byte[] TxCreationKeys_write(long obj); // struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser); public static native long TxCreationKeys_read(byte[] ser); - // void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_ptr); - public static native void ChannelPublicKeys_free(long this_ptr); + // void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj); + public static native void ChannelPublicKeys_free(long this_obj); // 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(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); @@ -3057,8 +3083,8 @@ public class bindings { 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(struct LDKHTLCOutputInCommitment this_ptr); - public static native void HTLCOutputInCommitment_free(long this_ptr); + // void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj); + public static native void HTLCOutputInCommitment_free(long this_obj); // 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(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val); @@ -3087,8 +3113,8 @@ public class bindings { public static native byte[] make_funding_redeemscript(byte[] broadcaster, byte[] countersignatory); // 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 ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_ptr); - public static native void ChannelTransactionParameters_free(long this_ptr); + // void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj); + public static native void ChannelTransactionParameters_free(long this_obj); // 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); @@ -3113,8 +3139,8 @@ public class bindings { 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); // struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig); public static native long ChannelTransactionParameters_clone(long orig); - // void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr); - public static native void CounterpartyChannelTransactionParameters_free(long this_ptr); + // void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj); + public static native void CounterpartyChannelTransactionParameters_free(long this_obj); // 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); @@ -3141,8 +3167,8 @@ public class bindings { public static native byte[] ChannelTransactionParameters_write(long obj); // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ 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); + // void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj); + public static native void DirectedChannelTransactionParameters_free(long this_obj); // 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); @@ -3153,8 +3179,8 @@ public class bindings { 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); + // void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj); + public static native void HolderCommitmentTransaction_free(long this_obj); // 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(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val); @@ -3169,8 +3195,8 @@ public class bindings { public static native long HolderCommitmentTransaction_read(byte[] ser); // 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); + // void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj); + public static native void BuiltCommitmentTransaction_free(long this_obj); // 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); @@ -3191,8 +3217,8 @@ public class bindings { 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); + // void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj); + public static native void CommitmentTransaction_free(long this_obj); // 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); @@ -3211,8 +3237,8 @@ public class bindings { 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); + // void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj); + public static native void TrustedCommitmentTransaction_free(long this_obj); // 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); @@ -3229,12 +3255,12 @@ public class bindings { public static native long NodeFeatures_clone(long orig); // struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig); public static native long ChannelFeatures_clone(long orig); - // void InitFeatures_free(struct LDKInitFeatures this_ptr); - public static native void InitFeatures_free(long this_ptr); - // void NodeFeatures_free(struct LDKNodeFeatures this_ptr); - public static native void NodeFeatures_free(long this_ptr); - // void ChannelFeatures_free(struct LDKChannelFeatures this_ptr); - public static native void ChannelFeatures_free(long this_ptr); + // void InitFeatures_free(struct LDKInitFeatures this_obj); + public static native void InitFeatures_free(long this_obj); + // void NodeFeatures_free(struct LDKNodeFeatures this_obj); + public static native void NodeFeatures_free(long this_obj); + // void ChannelFeatures_free(struct LDKChannelFeatures this_obj); + public static native void ChannelFeatures_free(long this_obj); // MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void); public static native long InitFeatures_empty(); // MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void); @@ -3259,8 +3285,8 @@ public class bindings { public static native long NodeFeatures_read(byte[] ser); // struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser); public static native long ChannelFeatures_read(byte[] ser); - // void RouteHop_free(struct LDKRouteHop this_ptr); - public static native void RouteHop_free(long this_ptr); + // void RouteHop_free(struct LDKRouteHop this_obj); + public static native void RouteHop_free(long this_obj); // 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(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); @@ -3289,8 +3315,8 @@ public class bindings { 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); // struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); public static native long RouteHop_clone(long orig); - // void Route_free(struct LDKRoute this_ptr); - public static native void Route_free(long this_ptr); + // void Route_free(struct LDKRoute this_obj); + public static native void Route_free(long this_obj); // 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 struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg); @@ -3301,8 +3327,8 @@ public class bindings { 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(struct LDKRouteHint this_ptr); - public static native void RouteHint_free(long this_ptr); + // void RouteHint_free(struct LDKRouteHint this_obj); + public static native void RouteHint_free(long this_obj); // 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(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKPublicKey val); @@ -3323,14 +3349,14 @@ public class bindings { public static native long RouteHint_clone(long orig); // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct 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[] payee, long[] first_hops, long[] last_hops, long final_value_msat, int final_cltv, long logger); - // void NetworkGraph_free(struct LDKNetworkGraph this_ptr); - public static native void NetworkGraph_free(long this_ptr); + // void NetworkGraph_free(struct LDKNetworkGraph this_obj); + public static native void NetworkGraph_free(long this_obj); // struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig); public static native long NetworkGraph_clone(long orig); - // void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_ptr); - public static native void LockedNetworkGraph_free(long this_ptr); - // void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_ptr); - public static native void NetGraphMsgHandler_free(long this_ptr); + // void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj); + public static native void LockedNetworkGraph_free(long this_obj); + // void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj); + public static native void NetGraphMsgHandler_free(long this_obj); // 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); @@ -3345,8 +3371,8 @@ public class bindings { public static native long NetGraphMsgHandler_as_RoutingMessageHandler(long this_arg); // 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); + // void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj); + public static native void DirectionalChannelInfo_free(long this_obj); // 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(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val); @@ -3377,8 +3403,8 @@ public class bindings { public static native byte[] DirectionalChannelInfo_write(long obj); // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser); public static native long DirectionalChannelInfo_read(byte[] ser); - // void ChannelInfo_free(struct LDKChannelInfo this_ptr); - public static native void ChannelInfo_free(long this_ptr); + // void ChannelInfo_free(struct LDKChannelInfo this_obj); + public static native void ChannelInfo_free(long this_obj); // 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(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); @@ -3409,8 +3435,8 @@ public class bindings { public static native byte[] ChannelInfo_write(long obj); // struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser); public static native long ChannelInfo_read(byte[] ser); - // void RoutingFees_free(struct LDKRoutingFees this_ptr); - public static native void RoutingFees_free(long this_ptr); + // void RoutingFees_free(struct LDKRoutingFees this_obj); + public static native void RoutingFees_free(long this_obj); // 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(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); @@ -3427,8 +3453,8 @@ public class bindings { public static native long RoutingFees_read(byte[] ser); // 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); + // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj); + public static native void NodeAnnouncementInfo_free(long this_obj); // 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(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); @@ -3459,8 +3485,8 @@ public class bindings { 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(struct LDKNodeInfo this_ptr); - public static native void NodeInfo_free(long this_ptr); + // void NodeInfo_free(struct LDKNodeInfo this_obj); + public static native void NodeInfo_free(long this_obj); // 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); // struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr); diff --git a/src/main/java/org/ldk/structs/APIError.java b/src/main/java/org/ldk/structs/APIError.java index fdcfc09b..6e760fbb 100644 --- a/src/main/java/org/ldk/structs/APIError.java +++ b/src/main/java/org/ldk/structs/APIError.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Indicates an error on the client's part (usually some variant of attempting to use too-low or + * too-high values) + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class APIError extends CommonBase { private APIError(Object _dummy, long ptr) { super(ptr); } diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index 2771149f..4e19d30e 100644 --- a/src/main/java/org/ldk/structs/AcceptChannel.java +++ b/src/main/java/org/ldk/structs/AcceptChannel.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An accept_channel message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class AcceptChannel extends CommonBase { AcceptChannel(Object _dummy, long ptr) { super(ptr); } @@ -14,132 +18,219 @@ public class AcceptChannel extends CommonBase { if (ptr != 0) { bindings.AcceptChannel_free(ptr); } } + /** + * A temporary channel ID, until the funding outpoint is announced + */ public byte[] get_temporary_channel_id() { byte[] ret = bindings.AcceptChannel_get_temporary_channel_id(this.ptr); return ret; } + /** + * A temporary channel ID, until the funding outpoint is announced + */ public void set_temporary_channel_id(byte[] val) { bindings.AcceptChannel_set_temporary_channel_id(this.ptr, val); } + /** + * The threshold below which outputs on transactions broadcast by sender will be omitted + */ public long get_dust_limit_satoshis() { long ret = bindings.AcceptChannel_get_dust_limit_satoshis(this.ptr); return ret; } + /** + * The threshold below which outputs on transactions broadcast by sender will be omitted + */ public void set_dust_limit_satoshis(long val) { bindings.AcceptChannel_set_dust_limit_satoshis(this.ptr, val); } + /** + * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + */ public long get_max_htlc_value_in_flight_msat() { long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this.ptr); return ret; } + /** + * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + */ public void set_max_htlc_value_in_flight_msat(long val) { bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this.ptr, val); } + /** + * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel + */ public long get_channel_reserve_satoshis() { long ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this.ptr); return ret; } + /** + * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel + */ public void set_channel_reserve_satoshis(long val) { bindings.AcceptChannel_set_channel_reserve_satoshis(this.ptr, val); } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public long get_htlc_minimum_msat() { long ret = bindings.AcceptChannel_get_htlc_minimum_msat(this.ptr); return ret; } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public void set_htlc_minimum_msat(long val) { bindings.AcceptChannel_set_htlc_minimum_msat(this.ptr, val); } + /** + * Minimum depth of the funding transaction before the channel is considered open + */ public int get_minimum_depth() { int ret = bindings.AcceptChannel_get_minimum_depth(this.ptr); return ret; } + /** + * Minimum depth of the funding transaction before the channel is considered open + */ public void set_minimum_depth(int val) { bindings.AcceptChannel_set_minimum_depth(this.ptr, val); } + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction + */ public short get_to_self_delay() { short ret = bindings.AcceptChannel_get_to_self_delay(this.ptr); return ret; } + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction + */ public void set_to_self_delay(short val) { bindings.AcceptChannel_set_to_self_delay(this.ptr, val); } + /** + * The maximum number of inbound HTLCs towards sender + */ public short get_max_accepted_htlcs() { short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this.ptr); return ret; } + /** + * The maximum number of inbound HTLCs towards sender + */ public void set_max_accepted_htlcs(short val) { bindings.AcceptChannel_set_max_accepted_htlcs(this.ptr, val); } + /** + * The sender's key controlling the funding transaction + */ public byte[] get_funding_pubkey() { byte[] ret = bindings.AcceptChannel_get_funding_pubkey(this.ptr); return ret; } + /** + * The sender's key controlling the funding transaction + */ public void set_funding_pubkey(byte[] val) { bindings.AcceptChannel_set_funding_pubkey(this.ptr, val); } + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ public byte[] get_revocation_basepoint() { byte[] ret = bindings.AcceptChannel_get_revocation_basepoint(this.ptr); return ret; } + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ public void set_revocation_basepoint(byte[] val) { bindings.AcceptChannel_set_revocation_basepoint(this.ptr, val); } + /** + * A payment key to sender for transactions broadcast by counterparty + */ public byte[] get_payment_point() { byte[] ret = bindings.AcceptChannel_get_payment_point(this.ptr); return ret; } + /** + * A payment key to sender for transactions broadcast by counterparty + */ public void set_payment_point(byte[] val) { bindings.AcceptChannel_set_payment_point(this.ptr, val); } + /** + * Used to derive a payment key to sender for transactions broadcast by sender + */ public byte[] get_delayed_payment_basepoint() { byte[] ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this.ptr); return ret; } + /** + * Used to derive a payment key to sender for transactions broadcast by sender + */ public void set_delayed_payment_basepoint(byte[] val) { bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, val); } + /** + * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty + */ public byte[] get_htlc_basepoint() { byte[] ret = bindings.AcceptChannel_get_htlc_basepoint(this.ptr); return ret; } + /** + * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty + */ public void set_htlc_basepoint(byte[] val) { bindings.AcceptChannel_set_htlc_basepoint(this.ptr, val); } + /** + * The first to-be-broadcast-by-sender transaction's per commitment point + */ public byte[] get_first_per_commitment_point() { byte[] ret = bindings.AcceptChannel_get_first_per_commitment_point(this.ptr); return ret; } + /** + * The first to-be-broadcast-by-sender transaction's per commitment point + */ public void set_first_per_commitment_point(byte[] val) { bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, val); } + /** + * Creates a copy of the AcceptChannel + */ public AcceptChannel clone() { long ret = bindings.AcceptChannel_clone(this.ptr); AcceptChannel ret_hu_conv = new AcceptChannel(null, ret); @@ -147,11 +238,17 @@ public class AcceptChannel extends CommonBase { return ret_hu_conv; } + /** + * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read + */ public byte[] write() { byte[] ret = bindings.AcceptChannel_write(this.ptr); return ret; } + /** + * Read a AcceptChannel from a byte array, created by AcceptChannel_write + */ public static Result_AcceptChannelDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.AcceptChannel_read(ser); Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/Access.java b/src/main/java/org/ldk/structs/Access.java index 6b4c9a9f..afb25ad3 100644 --- a/src/main/java/org/ldk/structs/Access.java +++ b/src/main/java/org/ldk/structs/Access.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * The `Access` trait defines behavior for accessing chain data and state, such as blocks and + * UTXOs. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Access extends CommonBase { final bindings.LDKAccess bindings_instance; @@ -20,6 +24,13 @@ public class Access extends CommonBase { } public static interface AccessInterface { + /** + * Returns the transaction output of a funding transaction encoded by [`short_channel_id`]. + * Returns an error if `genesis_hash` is for a different chain or if such a transaction output + * is unknown. + * + * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id + */ Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id); } private static class LDKAccessHolder { Access held; } @@ -34,6 +45,13 @@ public class Access extends CommonBase { }); return impl_holder.held; } + /** + * Returns the transaction output of a funding transaction encoded by [`short_channel_id`]. + * Returns an error if `genesis_hash` is for a different chain or if such a transaction output + * is unknown. + * + * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id + */ 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); diff --git a/src/main/java/org/ldk/structs/AnnouncementSignatures.java b/src/main/java/org/ldk/structs/AnnouncementSignatures.java index 14aba588..f903d679 100644 --- a/src/main/java/org/ldk/structs/AnnouncementSignatures.java +++ b/src/main/java/org/ldk/structs/AnnouncementSignatures.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An announcement_signatures message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class AnnouncementSignatures extends CommonBase { AnnouncementSignatures(Object _dummy, long ptr) { super(ptr); } @@ -14,42 +18,69 @@ public class AnnouncementSignatures extends CommonBase { if (ptr != 0) { bindings.AnnouncementSignatures_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.AnnouncementSignatures_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.AnnouncementSignatures_set_channel_id(this.ptr, val); } + /** + * The short channel ID + */ public long get_short_channel_id() { long ret = bindings.AnnouncementSignatures_get_short_channel_id(this.ptr); return ret; } + /** + * The short channel ID + */ public void set_short_channel_id(long val) { bindings.AnnouncementSignatures_set_short_channel_id(this.ptr, val); } + /** + * A signature by the node key + */ public byte[] get_node_signature() { byte[] ret = bindings.AnnouncementSignatures_get_node_signature(this.ptr); return ret; } + /** + * A signature by the node key + */ public void set_node_signature(byte[] val) { bindings.AnnouncementSignatures_set_node_signature(this.ptr, val); } + /** + * A signature by the funding key + */ public byte[] get_bitcoin_signature() { byte[] ret = bindings.AnnouncementSignatures_get_bitcoin_signature(this.ptr); return ret; } + /** + * A signature by the funding key + */ public void set_bitcoin_signature(byte[] val) { bindings.AnnouncementSignatures_set_bitcoin_signature(this.ptr, val); } + /** + * Constructs a new AnnouncementSignatures given each field + */ public static AnnouncementSignatures constructor_new(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg) { long ret = bindings.AnnouncementSignatures_new(channel_id_arg, short_channel_id_arg, node_signature_arg, bitcoin_signature_arg); AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret); @@ -57,6 +88,9 @@ public class AnnouncementSignatures extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the AnnouncementSignatures + */ public AnnouncementSignatures clone() { long ret = bindings.AnnouncementSignatures_clone(this.ptr); AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret); @@ -64,11 +98,17 @@ public class AnnouncementSignatures extends CommonBase { return ret_hu_conv; } + /** + * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read + */ public byte[] write() { byte[] ret = bindings.AnnouncementSignatures_write(this.ptr); return ret; } + /** + * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write + */ public static Result_AnnouncementSignaturesDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.AnnouncementSignatures_read(ser); Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/BroadcasterInterface.java b/src/main/java/org/ldk/structs/BroadcasterInterface.java index df6b6493..6deb3973 100644 --- a/src/main/java/org/ldk/structs/BroadcasterInterface.java +++ b/src/main/java/org/ldk/structs/BroadcasterInterface.java @@ -5,6 +5,9 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * An interface to send a transaction to the Bitcoin network. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class BroadcasterInterface extends CommonBase { final bindings.LDKBroadcasterInterface bindings_instance; @@ -20,6 +23,9 @@ public class BroadcasterInterface extends CommonBase { } public static interface BroadcasterInterfaceInterface { + /** + * Sends a transaction out to (hopefully) be mined. + */ void broadcast_transaction(byte[] tx); } private static class LDKBroadcasterInterfaceHolder { BroadcasterInterface held; } @@ -32,6 +38,9 @@ public class BroadcasterInterface extends CommonBase { }); return impl_holder.held; } + /** + * Sends a transaction out to (hopefully) be mined. + */ public void broadcast_transaction(byte[] tx) { bindings.BroadcasterInterface_broadcast_transaction(this.ptr, tx); } diff --git a/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java b/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java index 337469f3..0e36c36a 100644 --- a/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A pre-built Bitcoin commitment transaction and its txid. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class BuiltCommitmentTransaction extends CommonBase { BuiltCommitmentTransaction(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,45 @@ public class BuiltCommitmentTransaction extends CommonBase { if (ptr != 0) { bindings.BuiltCommitmentTransaction_free(ptr); } } + /** + * The commitment transaction + */ public byte[] get_transaction() { byte[] ret = bindings.BuiltCommitmentTransaction_get_transaction(this.ptr); return ret; } + /** + * The commitment transaction + */ public void set_transaction(byte[] val) { bindings.BuiltCommitmentTransaction_set_transaction(this.ptr, val); } + /** + * The txid for the commitment transaction. + * + * This is provided as a performance optimization, instead of calling transaction.txid() + * multiple times. + */ public byte[] get_txid() { byte[] ret = bindings.BuiltCommitmentTransaction_get_txid(this.ptr); return ret; } + /** + * The txid for the commitment transaction. + * + * This is provided as a performance optimization, instead of calling transaction.txid() + * multiple times. + */ public void set_txid(byte[] val) { bindings.BuiltCommitmentTransaction_set_txid(this.ptr, val); } + /** + * Constructs a new BuiltCommitmentTransaction given each field + */ 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); @@ -39,6 +64,9 @@ public class BuiltCommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the BuiltCommitmentTransaction + */ public BuiltCommitmentTransaction clone() { long ret = bindings.BuiltCommitmentTransaction_clone(this.ptr); BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret); @@ -46,22 +74,37 @@ public class BuiltCommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read + */ public byte[] write() { byte[] ret = bindings.BuiltCommitmentTransaction_write(this.ptr); return ret; } + /** + * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write + */ public static Result_BuiltCommitmentTransactionDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.BuiltCommitmentTransaction_read(ser); Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Get the SIGHASH_ALL sighash value of the transaction. + * + * This can be used to verify a signature. + */ 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; } + /** + * Sign a transaction, either because we are counter-signing the counterparty's transaction or + * because we are about to broadcast a holder transaction. + */ 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 737433d8..a32ef2d3 100644 --- a/src/main/java/org/ldk/structs/ChainMonitor.java +++ b/src/main/java/org/ldk/structs/ChainMonitor.java @@ -5,6 +5,19 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An implementation of [`chain::Watch`] for monitoring channels. + * + * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by + * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally + * or used independently to monitor channels remotely. See the [module-level documentation] for + * details. + * + * [`chain::Watch`]: ../trait.Watch.html + * [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html + * [module-level documentation]: index.html + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChainMonitor extends CommonBase { ChainMonitor(Object _dummy, long ptr) { super(ptr); } @@ -14,15 +27,48 @@ public class ChainMonitor extends CommonBase { if (ptr != 0) { bindings.ChainMonitor_free(ptr); } } + /** + * Dispatches to per-channel monitors, which are responsible for updating their on-chain view + * of a channel and reacting accordingly based on transactions in the connected block. See + * [`ChannelMonitor::block_connected`] for details. Any HTLCs that were resolved on chain will + * be returned by [`chain::Watch::release_pending_monitor_events`]. + * + * Calls back to [`chain::Filter`] if any monitor indicated new outputs to watch. Subsequent + * calls must not exclude any transactions matching the new outputs nor any in-block + * descendants of such transactions. It is not necessary to re-fetch the block to obtain + * updated `txdata`. + * + * [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected + * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events + * [`chain::Filter`]: ../trait.Filter.html + */ public void block_connected(byte[] header, TwoTuple[] txdata, int height) { bindings.ChainMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray(), height); /* TODO 2 TwoTuple */; } + /** + * Dispatches to per-channel monitors, which are responsible for updating their on-chain view + * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for + * details. + * + * [`ChannelMonitor::block_disconnected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_disconnected + */ public void block_disconnected(byte[] header, int disconnected_height) { bindings.ChainMonitor_block_disconnected(this.ptr, header, disconnected_height); } + /** + * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels. + * + * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor + * will call back to it indicating transactions and outputs of interest. This allows clients to + * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may + * always need to fetch full blocks absent another means for determining which blocks contain + * transactions relevant to the watched channels. + * + * [`chain::Filter`]: ../trait.Filter.html + */ 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); @@ -35,6 +81,10 @@ public class ChainMonitor extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new Watch which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is + */ public Watch as_Watch() { long ret = bindings.ChainMonitor_as_Watch(this.ptr); Watch ret_hu_conv = new Watch(null, ret); @@ -42,6 +92,10 @@ public class ChainMonitor extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new EventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is + */ public EventsProvider as_EventsProvider() { long ret = bindings.ChainMonitor_as_EventsProvider(this.ptr); EventsProvider ret_hu_conv = new EventsProvider(null, ret); diff --git a/src/main/java/org/ldk/structs/ChainParameters.java b/src/main/java/org/ldk/structs/ChainParameters.java index 06e56937..f1cafe33 100644 --- a/src/main/java/org/ldk/structs/ChainParameters.java +++ b/src/main/java/org/ldk/structs/ChainParameters.java @@ -5,6 +5,14 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Chain-related parameters used to construct a new `ChannelManager`. + * + * Typically, the block-specific parameters are derived from the best block hash for the network, + * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters + * are not needed when deserializing a previously constructed `ChannelManager`. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChainParameters extends CommonBase { ChainParameters(Object _dummy, long ptr) { super(ptr); } @@ -14,33 +22,58 @@ public class ChainParameters extends CommonBase { if (ptr != 0) { bindings.ChainParameters_free(ptr); } } + /** + * The network for determining the `chain_hash` in Lightning messages. + */ public LDKNetwork get_network() { LDKNetwork ret = bindings.ChainParameters_get_network(this.ptr); return ret; } + /** + * The network for determining the `chain_hash` in Lightning messages. + */ public void set_network(LDKNetwork val) { bindings.ChainParameters_set_network(this.ptr, val); } + /** + * The hash of the latest block successfully connected. + */ public byte[] get_latest_hash() { byte[] ret = bindings.ChainParameters_get_latest_hash(this.ptr); return ret; } + /** + * The hash of the latest block successfully connected. + */ public void set_latest_hash(byte[] val) { bindings.ChainParameters_set_latest_hash(this.ptr, val); } + /** + * The height of the latest block successfully connected. + * + * Used to track on-chain channel funding outputs and send payments with reliable timelocks. + */ public long get_latest_height() { long ret = bindings.ChainParameters_get_latest_height(this.ptr); return ret; } + /** + * The height of the latest block successfully connected. + * + * Used to track on-chain channel funding outputs and send payments with reliable timelocks. + */ public void set_latest_height(long val) { bindings.ChainParameters_set_latest_height(this.ptr, val); } + /** + * Constructs a new ChainParameters given each field + */ public static ChainParameters constructor_new(LDKNetwork network_arg, byte[] latest_hash_arg, long latest_height_arg) { long ret = bindings.ChainParameters_new(network_arg, latest_hash_arg, latest_height_arg); ChainParameters ret_hu_conv = new ChainParameters(null, ret); diff --git a/src/main/java/org/ldk/structs/ChannelAnnouncement.java b/src/main/java/org/ldk/structs/ChannelAnnouncement.java index 52c88eac..447b9bf0 100644 --- a/src/main/java/org/ldk/structs/ChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/ChannelAnnouncement.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A channel_announcement message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelAnnouncement extends CommonBase { ChannelAnnouncement(Object _dummy, long ptr) { super(ptr); } @@ -14,42 +18,69 @@ public class ChannelAnnouncement extends CommonBase { if (ptr != 0) { bindings.ChannelAnnouncement_free(ptr); } } + /** + * Authentication of the announcement by the first public node + */ public byte[] get_node_signature_1() { byte[] ret = bindings.ChannelAnnouncement_get_node_signature_1(this.ptr); return ret; } + /** + * Authentication of the announcement by the first public node + */ public void set_node_signature_1(byte[] val) { bindings.ChannelAnnouncement_set_node_signature_1(this.ptr, val); } + /** + * Authentication of the announcement by the second public node + */ public byte[] get_node_signature_2() { byte[] ret = bindings.ChannelAnnouncement_get_node_signature_2(this.ptr); return ret; } + /** + * Authentication of the announcement by the second public node + */ public void set_node_signature_2(byte[] val) { bindings.ChannelAnnouncement_set_node_signature_2(this.ptr, val); } + /** + * Proof of funding UTXO ownership by the first public node + */ public byte[] get_bitcoin_signature_1() { byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_1(this.ptr); return ret; } + /** + * Proof of funding UTXO ownership by the first public node + */ public void set_bitcoin_signature_1(byte[] val) { bindings.ChannelAnnouncement_set_bitcoin_signature_1(this.ptr, val); } + /** + * Proof of funding UTXO ownership by the second public node + */ public byte[] get_bitcoin_signature_2() { byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_2(this.ptr); return ret; } + /** + * Proof of funding UTXO ownership by the second public node + */ public void set_bitcoin_signature_2(byte[] val) { bindings.ChannelAnnouncement_set_bitcoin_signature_2(this.ptr, val); } + /** + * The actual announcement + */ public UnsignedChannelAnnouncement get_contents() { long ret = bindings.ChannelAnnouncement_get_contents(this.ptr); UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); @@ -57,11 +88,17 @@ public class ChannelAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * The actual announcement + */ public void set_contents(UnsignedChannelAnnouncement val) { bindings.ChannelAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Constructs a new ChannelAnnouncement given each field + */ public static ChannelAnnouncement constructor_new(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) { long ret = bindings.ChannelAnnouncement_new(node_signature_1_arg, node_signature_2_arg, bitcoin_signature_1_arg, bitcoin_signature_2_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret); @@ -70,6 +107,9 @@ public class ChannelAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ChannelAnnouncement + */ public ChannelAnnouncement clone() { long ret = bindings.ChannelAnnouncement_clone(this.ptr); ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret); @@ -77,11 +117,17 @@ public class ChannelAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read + */ public byte[] write() { byte[] ret = bindings.ChannelAnnouncement_write(this.ptr); return ret; } + /** + * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write + */ public static Result_ChannelAnnouncementDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelAnnouncement_read(ser); Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ChannelConfig.java b/src/main/java/org/ldk/structs/ChannelConfig.java index 5af68d38..f465f6cf 100644 --- a/src/main/java/org/ldk/structs/ChannelConfig.java +++ b/src/main/java/org/ldk/structs/ChannelConfig.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Options which apply on a per-channel basis and may change at runtime or based on negotiation + * with our counterparty. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelConfig extends CommonBase { ChannelConfig(Object _dummy, long ptr) { super(ptr); } @@ -14,33 +19,102 @@ public class ChannelConfig extends CommonBase { if (ptr != 0) { bindings.ChannelConfig_free(ptr); } } + /** + * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi. + * This may be allowed to change at runtime in a later update, however doing so must result in + * update messages sent to notify all nodes of our updated relay fee. + * + * Default value: 0. + */ public int get_fee_proportional_millionths() { int ret = bindings.ChannelConfig_get_fee_proportional_millionths(this.ptr); return ret; } + /** + * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi. + * This may be allowed to change at runtime in a later update, however doing so must result in + * update messages sent to notify all nodes of our updated relay fee. + * + * Default value: 0. + */ public void set_fee_proportional_millionths(int val) { bindings.ChannelConfig_set_fee_proportional_millionths(this.ptr, val); } + /** + * Set to announce the channel publicly and notify all nodes that they can route via this + * channel. + * + * This should only be set to true for nodes which expect to be online reliably. + * + * As the node which funds a channel picks this value this will only apply for new outbound + * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set. + * + * This cannot be changed after the initial channel handshake. + * + * Default value: false. + */ public boolean get_announced_channel() { boolean ret = bindings.ChannelConfig_get_announced_channel(this.ptr); return ret; } + /** + * Set to announce the channel publicly and notify all nodes that they can route via this + * channel. + * + * This should only be set to true for nodes which expect to be online reliably. + * + * As the node which funds a channel picks this value this will only apply for new outbound + * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set. + * + * This cannot be changed after the initial channel handshake. + * + * Default value: false. + */ public void set_announced_channel(boolean val) { bindings.ChannelConfig_set_announced_channel(this.ptr, val); } + /** + * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty + * supports it, they will then enforce the mutual-close output to us matches what we provided + * at intialization, preventing us from closing to an alternate pubkey. + * + * This is set to true by default to provide a slight increase in security, though ultimately + * any attacker who is able to take control of a channel can just as easily send the funds via + * lightning payments, so we never require that our counterparties support this option. + * + * This cannot be changed after a channel has been initialized. + * + * Default value: true. + */ public boolean get_commit_upfront_shutdown_pubkey() { boolean ret = bindings.ChannelConfig_get_commit_upfront_shutdown_pubkey(this.ptr); return ret; } + /** + * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty + * supports it, they will then enforce the mutual-close output to us matches what we provided + * at intialization, preventing us from closing to an alternate pubkey. + * + * This is set to true by default to provide a slight increase in security, though ultimately + * any attacker who is able to take control of a channel can just as easily send the funds via + * lightning payments, so we never require that our counterparties support this option. + * + * This cannot be changed after a channel has been initialized. + * + * Default value: true. + */ public void set_commit_upfront_shutdown_pubkey(boolean val) { bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this.ptr, val); } + /** + * Constructs a new ChannelConfig given each field + */ public static ChannelConfig constructor_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) { long ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg); ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); @@ -48,6 +122,9 @@ public class ChannelConfig extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ChannelConfig + */ public ChannelConfig clone() { long ret = bindings.ChannelConfig_clone(this.ptr); ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); @@ -55,6 +132,9 @@ public class ChannelConfig extends CommonBase { return ret_hu_conv; } + /** + * Creates a "default" ChannelConfig. See other documentaiton for details on what this implies. + */ public static ChannelConfig constructor_default() { long ret = bindings.ChannelConfig_default(); ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); @@ -62,11 +142,17 @@ public class ChannelConfig extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read + */ public byte[] write() { byte[] ret = bindings.ChannelConfig_write(this.ptr); return ret; } + /** + * Read a ChannelConfig from a byte array, created by ChannelConfig_write + */ public static Result_ChannelConfigDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelConfig_read(ser); Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ChannelDetails.java b/src/main/java/org/ldk/structs/ChannelDetails.java index 216c017b..2f34454c 100644 --- a/src/main/java/org/ldk/structs/ChannelDetails.java +++ b/src/main/java/org/ldk/structs/ChannelDetails.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelDetails extends CommonBase { ChannelDetails(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,47 @@ public class ChannelDetails extends CommonBase { if (ptr != 0) { bindings.ChannelDetails_free(ptr); } } + /** + * The channel's ID (prior to funding transaction generation, this is a random 32 bytes, + * thereafter this is the txid of the funding transaction xor the funding transaction output). + * Note that this means this value is *not* persistent - it can change once during the + * lifetime of the channel. + */ public byte[] get_channel_id() { byte[] ret = bindings.ChannelDetails_get_channel_id(this.ptr); return ret; } + /** + * The channel's ID (prior to funding transaction generation, this is a random 32 bytes, + * thereafter this is the txid of the funding transaction xor the funding transaction output). + * Note that this means this value is *not* persistent - it can change once during the + * lifetime of the channel. + */ public void set_channel_id(byte[] val) { bindings.ChannelDetails_set_channel_id(this.ptr, val); } + /** + * The node_id of our counterparty + */ public byte[] get_remote_network_id() { byte[] ret = bindings.ChannelDetails_get_remote_network_id(this.ptr); return ret; } + /** + * The node_id of our counterparty + */ public void set_remote_network_id(byte[] val) { bindings.ChannelDetails_set_remote_network_id(this.ptr, val); } + /** + * The Features the channel counterparty provided upon last connection. + * Useful for routing as it is the most up-to-date copy of the counterparty's features and + * many routing-relevant features are present in the init context. + */ public InitFeatures get_counterparty_features() { long ret = bindings.ChannelDetails_get_counterparty_features(this.ptr); InitFeatures ret_hu_conv = new InitFeatures(null, ret); @@ -39,56 +66,110 @@ public class ChannelDetails extends CommonBase { return ret_hu_conv; } + /** + * The Features the channel counterparty provided upon last connection. + * Useful for routing as it is the most up-to-date copy of the counterparty's features and + * many routing-relevant features are present in the init context. + */ 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); } + /** + * The value, in satoshis, of this channel as appears in the funding output + */ public long get_channel_value_satoshis() { long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr); return ret; } + /** + * The value, in satoshis, of this channel as appears in the funding output + */ public void set_channel_value_satoshis(long val) { bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val); } + /** + * The user_id passed in to create_channel, or 0 if the channel was inbound. + */ public long get_user_id() { long ret = bindings.ChannelDetails_get_user_id(this.ptr); return ret; } + /** + * The user_id passed in to create_channel, or 0 if the channel was inbound. + */ public void set_user_id(long val) { bindings.ChannelDetails_set_user_id(this.ptr, val); } + /** + * The available outbound capacity for sending HTLCs to the remote peer. This does not include + * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not + * available for inclusion in new outbound HTLCs). This further does not include any pending + * outgoing HTLCs which are awaiting some other resolution to be sent. + */ public long get_outbound_capacity_msat() { long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr); return ret; } + /** + * The available outbound capacity for sending HTLCs to the remote peer. This does not include + * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not + * available for inclusion in new outbound HTLCs). This further does not include any pending + * outgoing HTLCs which are awaiting some other resolution to be sent. + */ public void set_outbound_capacity_msat(long val) { bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val); } + /** + * The available inbound capacity for the remote peer to send HTLCs to us. This does not + * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not + * available for inclusion in new inbound HTLCs). + * Note that there are some corner cases not fully handled here, so the actual available + * inbound capacity may be slightly higher than this. + */ public long get_inbound_capacity_msat() { long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr); return ret; } + /** + * The available inbound capacity for the remote peer to send HTLCs to us. This does not + * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not + * available for inclusion in new inbound HTLCs). + * Note that there are some corner cases not fully handled here, so the actual available + * inbound capacity may be slightly higher than this. + */ public void set_inbound_capacity_msat(long val) { bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val); } + /** + * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) + * the peer is connected, and (c) no monitor update failure is pending resolution. + */ public boolean get_is_live() { boolean ret = bindings.ChannelDetails_get_is_live(this.ptr); return ret; } + /** + * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) + * the peer is connected, and (c) no monitor update failure is pending resolution. + */ public void set_is_live(boolean val) { bindings.ChannelDetails_set_is_live(this.ptr, val); } + /** + * Creates a copy of the ChannelDetails + */ public ChannelDetails clone() { long ret = bindings.ChannelDetails_clone(this.ptr); ChannelDetails ret_hu_conv = new ChannelDetails(null, ret); diff --git a/src/main/java/org/ldk/structs/ChannelFeatures.java b/src/main/java/org/ldk/structs/ChannelFeatures.java index 7b10e51b..bac024ad 100644 --- a/src/main/java/org/ldk/structs/ChannelFeatures.java +++ b/src/main/java/org/ldk/structs/ChannelFeatures.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Features used within a `channel_announcement` message. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelFeatures extends CommonBase { ChannelFeatures(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,9 @@ public class ChannelFeatures extends CommonBase { if (ptr != 0) { bindings.ChannelFeatures_free(ptr); } } + /** + * Creates a copy of the ChannelFeatures + */ public ChannelFeatures clone() { long ret = bindings.ChannelFeatures_clone(this.ptr); ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret); @@ -21,6 +28,9 @@ public class ChannelFeatures extends CommonBase { return ret_hu_conv; } + /** + * Create a blank Features with no features set + */ public static ChannelFeatures constructor_empty() { long ret = bindings.ChannelFeatures_empty(); ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret); @@ -28,6 +38,11 @@ public class ChannelFeatures extends CommonBase { return ret_hu_conv; } + /** + * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. + * + * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS + */ public static ChannelFeatures constructor_known() { long ret = bindings.ChannelFeatures_known(); ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret); @@ -35,11 +50,17 @@ public class ChannelFeatures extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read + */ public byte[] write() { byte[] ret = bindings.ChannelFeatures_write(this.ptr); return ret; } + /** + * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write + */ public static Result_ChannelFeaturesDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelFeatures_read(ser); Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java index 730d50ad..3bab616c 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java @@ -5,6 +5,12 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Configuration we set when applicable. + * + * Default::default() provides sane defaults. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelHandshakeConfig extends CommonBase { ChannelHandshakeConfig(Object _dummy, long ptr) { super(ptr); } @@ -14,33 +20,96 @@ public class ChannelHandshakeConfig extends CommonBase { if (ptr != 0) { bindings.ChannelHandshakeConfig_free(ptr); } } + /** + * Confirmations we will wait for before considering the channel locked in. + * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the + * equivalent limit applied to outbound channels). + * + * Default value: 6. + */ public int get_minimum_depth() { int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this.ptr); return ret; } + /** + * Confirmations we will wait for before considering the channel locked in. + * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the + * equivalent limit applied to outbound channels). + * + * Default value: 6. + */ public void set_minimum_depth(int val) { bindings.ChannelHandshakeConfig_set_minimum_depth(this.ptr, val); } + /** + * Set to the amount of time we require our counterparty to wait to claim their money. + * + * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST + * be online to check for peer having broadcast a revoked transaction to steal our funds + * at least once every our_to_self_delay blocks. + * + * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in + * case of an honest unilateral channel close, which implicitly decrease the economic value of + * our channel. + * + * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel + * opening so you can tweak config to ask for more security, not less. + */ public short get_our_to_self_delay() { short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr); return ret; } + /** + * Set to the amount of time we require our counterparty to wait to claim their money. + * + * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST + * be online to check for peer having broadcast a revoked transaction to steal our funds + * at least once every our_to_self_delay blocks. + * + * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in + * case of an honest unilateral channel close, which implicitly decrease the economic value of + * our channel. + * + * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel + * opening so you can tweak config to ask for more security, not less. + */ public void set_our_to_self_delay(short val) { bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val); } + /** + * Set to the smallest value HTLC we will accept to process. + * + * This value is sent to our counterparty on channel-open and we close the channel any time + * our counterparty misbehaves by sending us an HTLC with a value smaller than this. + * + * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required + * by the protocol. + */ public long get_our_htlc_minimum_msat() { long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr); return ret; } + /** + * Set to the smallest value HTLC we will accept to process. + * + * This value is sent to our counterparty on channel-open and we close the channel any time + * our counterparty misbehaves by sending us an HTLC with a value smaller than this. + * + * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required + * by the protocol. + */ public void set_our_htlc_minimum_msat(long val) { bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this.ptr, val); } + /** + * Constructs a new ChannelHandshakeConfig given each field + */ public static ChannelHandshakeConfig constructor_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg) { long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); @@ -48,6 +117,9 @@ public class ChannelHandshakeConfig extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ChannelHandshakeConfig + */ public ChannelHandshakeConfig clone() { long ret = bindings.ChannelHandshakeConfig_clone(this.ptr); ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); @@ -55,6 +127,9 @@ public class ChannelHandshakeConfig extends CommonBase { return ret_hu_conv; } + /** + * Creates a "default" ChannelHandshakeConfig. See other documentaiton for details on what this implies. + */ public static ChannelHandshakeConfig constructor_default() { long ret = bindings.ChannelHandshakeConfig_default(); ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java index 33eec305..e154ab0a 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java @@ -5,6 +5,20 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Optional channel limits which are applied during channel creation. + * + * These limits are only applied to our counterparty's limits, not our own. + * + * Use 0/::max_value() as appropriate to skip checking. + * + * Provides sane defaults for most configurations. + * + * Most additional limits are disabled except those with which specify a default in individual + * field documentation. Note that this may result in barely-usable channels, but since they + * are applied mostly only to incoming channels that's not much of a problem. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelHandshakeLimits extends CommonBase { ChannelHandshakeLimits(Object _dummy, long ptr) { super(ptr); } @@ -14,96 +28,245 @@ public class ChannelHandshakeLimits extends CommonBase { if (ptr != 0) { bindings.ChannelHandshakeLimits_free(ptr); } } + /** + * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so + * only applies to inbound channels. + * + * Default value: 0. + */ public long get_min_funding_satoshis() { long ret = bindings.ChannelHandshakeLimits_get_min_funding_satoshis(this.ptr); return ret; } + /** + * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so + * only applies to inbound channels. + * + * Default value: 0. + */ public void set_min_funding_satoshis(long val) { bindings.ChannelHandshakeLimits_set_min_funding_satoshis(this.ptr, val); } + /** + * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows + * you to limit the maximum minimum-size they can require. + * + * Default value: u64::max_value. + */ public long get_max_htlc_minimum_msat() { long ret = bindings.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this.ptr); return ret; } + /** + * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows + * you to limit the maximum minimum-size they can require. + * + * Default value: u64::max_value. + */ public void set_max_htlc_minimum_msat(long val) { bindings.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this.ptr, val); } + /** + * The remote node sets a limit on the maximum value of pending HTLCs to them at any given + * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value. + * + * Default value: 0. + */ public long get_min_max_htlc_value_in_flight_msat() { long ret = bindings.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this.ptr); return ret; } + /** + * The remote node sets a limit on the maximum value of pending HTLCs to them at any given + * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value. + * + * Default value: 0. + */ public void set_min_max_htlc_value_in_flight_msat(long val) { bindings.ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this.ptr, val); } + /** + * The remote node will require we keep a certain amount in direct payment to ourselves at all + * time, ensuring that we are able to be punished if we broadcast an old state. This allows to + * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs). + * + * Default value: u64::max_value. + */ public long get_max_channel_reserve_satoshis() { long ret = bindings.ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this.ptr); return ret; } + /** + * The remote node will require we keep a certain amount in direct payment to ourselves at all + * time, ensuring that we are able to be punished if we broadcast an old state. This allows to + * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs). + * + * Default value: u64::max_value. + */ public void set_max_channel_reserve_satoshis(long val) { bindings.ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this.ptr, val); } + /** + * The remote node sets a limit on the maximum number of pending HTLCs to them at any given + * time. This allows you to set a minimum such value. + * + * Default value: 0. + */ public short get_min_max_accepted_htlcs() { short ret = bindings.ChannelHandshakeLimits_get_min_max_accepted_htlcs(this.ptr); return ret; } + /** + * The remote node sets a limit on the maximum number of pending HTLCs to them at any given + * time. This allows you to set a minimum such value. + * + * Default value: 0. + */ public void set_min_max_accepted_htlcs(short val) { bindings.ChannelHandshakeLimits_set_min_max_accepted_htlcs(this.ptr, val); } + /** + * Outputs below a certain value will not be added to on-chain transactions. The dust value is + * required to always be higher than this value so this only applies to HTLC outputs (and + * potentially to-self outputs before any payments have been made). + * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain. + * This setting allows you to set a minimum dust limit for their commitment transactions, + * reflecting the reality that tiny outputs are not considered standard transactions and will + * not propagate through the Bitcoin network. + * + * Default value: 546, the current dust limit on the Bitcoin network. + */ public long get_min_dust_limit_satoshis() { long ret = bindings.ChannelHandshakeLimits_get_min_dust_limit_satoshis(this.ptr); return ret; } + /** + * Outputs below a certain value will not be added to on-chain transactions. The dust value is + * required to always be higher than this value so this only applies to HTLC outputs (and + * potentially to-self outputs before any payments have been made). + * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain. + * This setting allows you to set a minimum dust limit for their commitment transactions, + * reflecting the reality that tiny outputs are not considered standard transactions and will + * not propagate through the Bitcoin network. + * + * Default value: 546, the current dust limit on the Bitcoin network. + */ public void set_min_dust_limit_satoshis(long val) { bindings.ChannelHandshakeLimits_set_min_dust_limit_satoshis(this.ptr, val); } + /** + * Maximum allowed threshold above which outputs will not be generated in their commitment + * transactions. + * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain. + * + * Default value: u64::max_value. + */ public long get_max_dust_limit_satoshis() { long ret = bindings.ChannelHandshakeLimits_get_max_dust_limit_satoshis(this.ptr); return ret; } + /** + * Maximum allowed threshold above which outputs will not be generated in their commitment + * transactions. + * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain. + * + * Default value: u64::max_value. + */ public void set_max_dust_limit_satoshis(long val) { bindings.ChannelHandshakeLimits_set_max_dust_limit_satoshis(this.ptr, val); } + /** + * Before a channel is usable the funding transaction will need to be confirmed by at least a + * certain number of blocks, specified by the node which is not the funder (as the funder can + * assume they aren't going to double-spend themselves). + * This config allows you to set a limit on the maximum amount of time to wait. + * + * Default value: 144, or roughly one day and only applies to outbound channels. + */ public int get_max_minimum_depth() { int ret = bindings.ChannelHandshakeLimits_get_max_minimum_depth(this.ptr); return ret; } + /** + * Before a channel is usable the funding transaction will need to be confirmed by at least a + * certain number of blocks, specified by the node which is not the funder (as the funder can + * assume they aren't going to double-spend themselves). + * This config allows you to set a limit on the maximum amount of time to wait. + * + * Default value: 144, or roughly one day and only applies to outbound channels. + */ public void set_max_minimum_depth(int val) { bindings.ChannelHandshakeLimits_set_max_minimum_depth(this.ptr, val); } + /** + * Set to force the incoming channel to match our announced channel preference in + * ChannelConfig. + * + * Default value: true, to make the default that no announced channels are possible (which is + * appropriate for any nodes which are not online very reliably). + */ public boolean get_force_announced_channel_preference() { boolean ret = bindings.ChannelHandshakeLimits_get_force_announced_channel_preference(this.ptr); return ret; } + /** + * Set to force the incoming channel to match our announced channel preference in + * ChannelConfig. + * + * Default value: true, to make the default that no announced channels are possible (which is + * appropriate for any nodes which are not online very reliably). + */ public void set_force_announced_channel_preference(boolean val) { bindings.ChannelHandshakeLimits_set_force_announced_channel_preference(this.ptr, val); } + /** + * Set to the amount of time we're willing to wait to claim money back to us. + * + * Not checking this value would be a security issue, as our peer would be able to set it to + * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time. + * + * Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value + * so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts) + */ public short get_their_to_self_delay() { short ret = bindings.ChannelHandshakeLimits_get_their_to_self_delay(this.ptr); return ret; } + /** + * Set to the amount of time we're willing to wait to claim money back to us. + * + * Not checking this value would be a security issue, as our peer would be able to set it to + * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time. + * + * Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value + * so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts) + */ public void set_their_to_self_delay(short val) { bindings.ChannelHandshakeLimits_set_their_to_self_delay(this.ptr, val); } + /** + * Constructs a new ChannelHandshakeLimits given each field + */ public static ChannelHandshakeLimits constructor_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) { long ret = bindings.ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, min_dust_limit_satoshis_arg, max_dust_limit_satoshis_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); @@ -111,6 +274,9 @@ public class ChannelHandshakeLimits extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ChannelHandshakeLimits + */ public ChannelHandshakeLimits clone() { long ret = bindings.ChannelHandshakeLimits_clone(this.ptr); ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); @@ -118,6 +284,9 @@ public class ChannelHandshakeLimits extends CommonBase { return ret_hu_conv; } + /** + * Creates a "default" ChannelHandshakeLimits. See other documentaiton for details on what this implies. + */ public static ChannelHandshakeLimits constructor_default() { long ret = bindings.ChannelHandshakeLimits_default(); ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index 90f1f4b7..8206d572 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Details about a channel (both directions). + * Received within a channel announcement. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelInfo extends CommonBase { ChannelInfo(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +19,9 @@ public class ChannelInfo extends CommonBase { if (ptr != 0) { bindings.ChannelInfo_free(ptr); } } + /** + * Protocol features of a channel communicated during its announcement + */ public ChannelFeatures get_features() { long ret = bindings.ChannelInfo_get_features(this.ptr); ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret); @@ -21,20 +29,32 @@ public class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Protocol features of a channel communicated during its announcement + */ public void set_features(ChannelFeatures val) { bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Source node of the first direction of a channel + */ public byte[] get_node_one() { byte[] ret = bindings.ChannelInfo_get_node_one(this.ptr); return ret; } + /** + * Source node of the first direction of a channel + */ public void set_node_one(byte[] val) { bindings.ChannelInfo_set_node_one(this.ptr, val); } + /** + * Details about the first direction of a channel + */ public DirectionalChannelInfo get_one_to_two() { long ret = bindings.ChannelInfo_get_one_to_two(this.ptr); DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret); @@ -42,20 +62,32 @@ public class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Details about the first direction of a channel + */ 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); } + /** + * Source node of the second direction of a channel + */ public byte[] get_node_two() { byte[] ret = bindings.ChannelInfo_get_node_two(this.ptr); return ret; } + /** + * Source node of the second direction of a channel + */ public void set_node_two(byte[] val) { bindings.ChannelInfo_set_node_two(this.ptr, val); } + /** + * Details about the second direction of a channel + */ public DirectionalChannelInfo get_two_to_one() { long ret = bindings.ChannelInfo_get_two_to_one(this.ptr); DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret); @@ -63,11 +95,20 @@ public class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Details about the second direction of a channel + */ 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); } + /** + * An initial announcement of the channel + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + */ public ChannelAnnouncement get_announcement_message() { long ret = bindings.ChannelInfo_get_announcement_message(this.ptr); ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret); @@ -75,11 +116,20 @@ public class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * An initial announcement of the channel + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + */ public void set_announcement_message(ChannelAnnouncement val) { bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Creates a copy of the ChannelInfo + */ public ChannelInfo clone() { long ret = bindings.ChannelInfo_clone(this.ptr); ChannelInfo ret_hu_conv = new ChannelInfo(null, ret); @@ -87,11 +137,17 @@ public class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read + */ public byte[] write() { byte[] ret = bindings.ChannelInfo_write(this.ptr); return ret; } + /** + * Read a ChannelInfo from a byte array, created by ChannelInfo_write + */ public static Result_ChannelInfoDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelInfo_read(ser); Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index 48780568..c5afb196 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -5,6 +5,45 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Manager which keeps track of a number of channels and sends messages to the appropriate + * channel, also tracking HTLC preimages and forwarding onion packets appropriately. + * + * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through + * to individual Channels. + * + * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for + * all peers during write/read (though does not modify this instance, only the instance being + * serialized). This will result in any channels which have not yet exchanged funding_created (ie + * called funding_transaction_generated for outbound channels). + * + * Note that you can be a bit lazier about writing out ChannelManager than you can be with + * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before + * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates + * happens out-of-band (and will prevent any other ChannelManager operations from occurring during + * the serialization process). If the deserialized version is out-of-date compared to the + * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the + * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees). + * + * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which + * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along + * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call + * block_connected() to step towards your best block) upon deserialization before using the + * object! + * + * Note that ChannelManager is responsible for tracking liveness of its channels and generating + * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid + * spam due to quick disconnection/reconnection, updates are not sent until the channel has been + * offline for a full minute. In order to track this, you must call + * timer_chan_freshness_every_min roughly once per minute, though it doesn't have to be perfect. + * + * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager + * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but + * essentially you should default to using a SimpleRefChannelManager, and use a + * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when + * you're using lightning-net-tokio. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelManager extends CommonBase { ChannelManager(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +53,20 @@ public class ChannelManager extends CommonBase { if (ptr != 0) { bindings.ChannelManager_free(ptr); } } + /** + * Constructs a new ChannelManager to hold several channels and route between them. + * + * This is the main \"logic hub\" for all channel-related actions, and implements + * ChannelMessageHandler. + * + * Non-proportional fees are fixed according to our risk using the provided fee estimator. + * + * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`! + * + * Users need to notify the new ChannelManager when a new block is connected or + * disconnected using its `block_connected` and `block_disconnected` methods, starting + * from after `params.latest_hash`. + */ public static ChannelManager constructor_new(FeeEstimator fee_est, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, KeysInterface keys_manager, UserConfig config, LDKNetwork params_network_arg, byte[] params_latest_hash_arg, long params_latest_height_arg) { long ret = bindings.ChannelManager_new(fee_est == null ? 0 : fee_est.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, keys_manager == null ? 0 : keys_manager.ptr, config == null ? 0 : config.ptr & ~1, bindings.ChainParameters_new(params_network_arg, params_latest_hash_arg, params_latest_height_arg)); ChannelManager ret_hu_conv = new ChannelManager(null, ret); @@ -27,6 +80,20 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Creates a new outbound channel to the given remote node and with the given value. + * + * user_id will be provided back as user_channel_id in FundingGenerationReady and + * FundingBroadcastSafe events to allow tracking of which events correspond with which + * create_channel call. Note that user_channel_id defaults to 0 for inbound channels, so you + * may wish to avoid using 0 for user_id here. + * + * If successful, will generate a SendOpenChannel message event, so you should probably poll + * PeerManager::process_events afterwards. + * + * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is + * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000. + */ 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); @@ -34,6 +101,10 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Gets the list of open channels, in random order. See ChannelDetail field documentation for + * more information. + */ public ChannelDetails[] list_channels() { long[] ret = bindings.ChannelManager_list_channels(this.ptr); ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length]; @@ -46,6 +117,13 @@ public class ChannelManager extends CommonBase { return ret_conv_16_arr; } + /** + * Gets the list of usable channels, in random order. Useful as an argument to + * get_route to ensure non-announced channels are used. + * + * These are guaranteed to have their is_live value set to true, see the documentation for + * ChannelDetails::is_live for more info on exactly what the criteria are. + */ public ChannelDetails[] list_usable_channels() { long[] ret = bindings.ChannelManager_list_usable_channels(this.ptr); ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length]; @@ -58,22 +136,78 @@ public class ChannelManager extends CommonBase { return ret_conv_16_arr; } + /** + * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs + * will be accepted on the given channel, and after additional timeout/the closing of all + * pending HTLCs, the channel will be closed on chain. + * + * May generate a SendShutdown message event on success, which should be relayed. + */ 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); return ret_hu_conv; } + /** + * Force closes a channel, immediately broadcasting the latest local commitment transaction to + * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager. + */ public Result_NoneAPIErrorZ force_close_channel(byte[] channel_id) { long ret = bindings.ChannelManager_force_close_channel(this.ptr, channel_id); Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Force close all channels, immediately broadcasting the latest local commitment transaction + * for each to the chain and rejecting new HTLCs on each. + */ public void force_close_all_channels() { bindings.ChannelManager_force_close_all_channels(this.ptr); } + /** + * Sends a payment along a given route. + * + * Value parameters are provided via the last hop in route, see documentation for RouteHop + * fields for more info. + * + * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative + * payment), we don't do anything to stop you! We always try to ensure that if the provided + * next hop knows the preimage to payment_hash they can claim an additional amount as + * specified in the last hop in the route! Thus, you should probably do your own + * payment_preimage tracking (which you should already be doing as they represent \"proof of + * payment\") and prevent double-sends yourself. + * + * May generate SendHTLCs message(s) event on success, which should be relayed. + * + * Each path may have a different return value, and PaymentSendValue may return a Vec with + * each entry matching the corresponding-index entry in the route paths, see + * PaymentSendFailure for more info. + * + * In general, a path may raise: + * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee, + * node public key) is specified. + * APIError::ChannelUnavailable if the next-hop channel is not available for updates + * (including due to previous monitor update failure or new permanent monitor update + * failure). + * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the + * relevant updates. + * + * Note that depending on the type of the PaymentSendFailure the HTLC may have been + * irrevocably committed to on our end. In such a case, do NOT retry the payment with a + * different route unless you intend to pay twice! + * + * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate + * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For + * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route + * must not contain multiple paths as multi-path payments require a recipient-provided + * payment_secret. + * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature + * bit set (either as required or as available). If multiple paths are present in the Route, + * we assume the invoice had the basic_mpp feature set. + */ 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); @@ -81,44 +215,138 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Call this upon creation of a funding transaction for the given channel. + * + * Note that ALL inputs in the transaction pointed to by funding_txo MUST spend SegWit outputs + * or your counterparty can steal your funds! + * + * Panics if a funding transaction has already been provided for this channel. + * + * May panic if the funding_txo is duplicative with some other channel (note that this should + * be trivially prevented by using unique funding transaction keys per-channel). + */ public void funding_transaction_generated(byte[] temporary_channel_id, OutPoint funding_txo) { bindings.ChannelManager_funding_transaction_generated(this.ptr, temporary_channel_id, funding_txo == null ? 0 : funding_txo.ptr & ~1); this.ptrs_to.add(funding_txo); } + /** + * Generates a signed node_announcement from the given arguments and creates a + * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have + * seen a channel_announcement from us (ie unless we have public channels open). + * + * RGB is a node \"color\" and alias is a printable human-readable string to describe this node + * to humans. They carry no in-protocol meaning. + * + * addresses represent the set (possibly empty) of socket addresses on which this node accepts + * incoming connections. These will be broadcast to the network, publicly tying these + * addresses together. If you wish to preserve user privacy, addresses should likely contain + * only Tor Onion addresses. + * + * Panics if addresses is absurdly large (more than 500). + */ public void broadcast_node_announcement(byte[] rgb, byte[] alias, NetAddress[] addresses) { bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, Arrays.stream(addresses).mapToLong(addresses_conv_12 -> addresses_conv_12.ptr).toArray()); /* TODO 2 NetAddress */; } + /** + * Processes HTLCs which are pending waiting on random forward delay. + * + * Should only really ever be called in response to a PendingHTLCsForwardable event. + * Will likely generate further events. + */ public void process_pending_htlc_forwards() { bindings.ChannelManager_process_pending_htlc_forwards(this.ptr); } + /** + * If a peer is disconnected we mark any channels with that peer as 'disabled'. + * After some time, if channels are still disabled we need to broadcast a ChannelUpdate + * to inform the network about the uselessness of these channels. + * + * This method handles all the details, and must be called roughly once per minute. + * + * Note that in some rare cases this may generate a `chain::Watch::update_channel` call. + */ public void timer_chan_freshness_every_min() { bindings.ChannelManager_timer_chan_freshness_every_min(this.ptr); } + /** + * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect + * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources + * along the path (including in our own channel on which we received it). + * Returns false if no payment was found to fail backwards, true if the process of failing the + * HTLC backwards has been started. + */ public boolean fail_htlc_backwards(byte[] payment_hash, byte[] payment_secret) { boolean ret = bindings.ChannelManager_fail_htlc_backwards(this.ptr, payment_hash, payment_secret); return ret; } + /** + * Provides a payment preimage in response to a PaymentReceived event, returning true and + * generating message events for the net layer to claim the payment, if possible. Thus, you + * should probably kick the net layer to go send messages if this returns true! + * + * You must specify the expected amounts for this HTLC, and we will only claim HTLCs + * available within a few percent of the expected amount. This is critical for several + * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the + * payment_preimage without having provided the full value and b) it avoids certain + * privacy-breaking recipient-probing attacks which may reveal payment activity to + * motivated attackers. + * + * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret + * set. Thus, for such payments we will claim any payments which do not under-pay. + * + * May panic if called except in response to a PaymentReceived event. + */ public boolean claim_funds(byte[] payment_preimage, byte[] payment_secret, long expected_amount) { boolean ret = bindings.ChannelManager_claim_funds(this.ptr, payment_preimage, payment_secret, expected_amount); return ret; } + /** + * Gets the node_id held by this ChannelManager + */ public byte[] get_our_node_id() { byte[] ret = bindings.ChannelManager_get_our_node_id(this.ptr); return ret; } + /** + * Restores a single, given channel to normal operation after a + * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update + * operation. + * + * All ChannelMonitor updates up to and including highest_applied_update_id must have been + * fully committed in every copy of the given channels' ChannelMonitors. + * + * Note that there is no effect to calling with a highest_applied_update_id other than the + * current latest ChannelMonitorUpdate and one call to this function after multiple + * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field + * exists largely only to prevent races between this and concurrent update_monitor calls. + * + * Thus, the anticipated use is, at a high level: + * 1) You register a chain::Watch with this ChannelManager, + * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of + * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures + * any time it cannot do so instantly, + * 3) update(s) are applied to each remote copy of a ChannelMonitor, + * 4) once all remote copies are updated, you call this function with the update_id that + * completed, and once it is the latest the Channel will be re-enabled. + */ public void channel_monitor_updated(OutPoint funding_txo, long highest_applied_update_id) { bindings.ChannelManager_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, highest_applied_update_id); this.ptrs_to.add(funding_txo); } + /** + * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is + */ public MessageSendEventsProvider as_MessageSendEventsProvider() { long ret = bindings.ChannelManager_as_MessageSendEventsProvider(this.ptr); MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret); @@ -126,6 +354,10 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new EventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is + */ public EventsProvider as_EventsProvider() { long ret = bindings.ChannelManager_as_EventsProvider(this.ptr); EventsProvider ret_hu_conv = new EventsProvider(null, ret); @@ -133,6 +365,10 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new Listen which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is + */ public Listen as_Listen() { long ret = bindings.ChannelManager_as_Listen(this.ptr); Listen ret_hu_conv = new Listen(null, ret); @@ -140,19 +376,37 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Updates channel state based on transactions seen in a connected block. + */ public void block_connected(byte[] header, TwoTuple[] txdata, int height) { bindings.ChannelManager_block_connected(this.ptr, header, Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray(), height); /* TODO 2 TwoTuple */; } + /** + * Updates channel state based on a disconnected block. + * + * If necessary, the channel may be force-closed without letting the counterparty participate + * in the shutdown. + */ public void block_disconnected(byte[] header) { bindings.ChannelManager_block_disconnected(this.ptr, header); } + /** + * Blocks until ChannelManager needs to be persisted. Only one listener on + * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken + * up. + */ public void await_persistable_update() { bindings.ChannelManager_await_persistable_update(this.ptr); } + /** + * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is + */ public ChannelMessageHandler as_ChannelMessageHandler() { long ret = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr); ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret); @@ -160,6 +414,9 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read + */ public byte[] write() { byte[] ret = bindings.ChannelManager_write(this.ptr); return ret; diff --git a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java index 5653e5d4..87af037c 100644 --- a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java +++ b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java @@ -5,6 +5,34 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Arguments for the creation of a ChannelManager that are not deserialized. + * + * At a high-level, the process for deserializing a ChannelManager and resuming normal operation + * is: + * 1) Deserialize all stored ChannelMonitors. + * 2) Deserialize the ChannelManager by filling in this struct and calling: + * <(BlockHash, ChannelManager)>::read(reader, args) + * This may result in closing some Channels if the ChannelMonitor is newer than the stored + * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted. + * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same + * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and + * ChannelMonitor::get_funding_txo(). + * 4) Reconnect blocks on your ChannelMonitors. + * 5) Disconnect/connect blocks on the ChannelManager. + * 6) Move the ChannelMonitors into your local chain::Watch. + * + * Note that the ordering of #4-6 is not of importance, however all three must occur before you + * call any other methods on the newly-deserialized ChannelManager. + * + * Note that because some channels may be closed during deserialization, it is critical that you + * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to + * you. If you deserialize an old ChannelManager (during which force-closure transactions may be + * broadcast), and then later deserialize a newer version of the same ChannelManager (which will + * not force-close the same channels but consider them live), you may end up revoking a state for + * which you've already broadcasted the transaction. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelManagerReadArgs extends CommonBase { ChannelManagerReadArgs(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +42,11 @@ public class ChannelManagerReadArgs extends CommonBase { if (ptr != 0) { bindings.ChannelManagerReadArgs_free(ptr); } } + /** + * The keys provider which will give us relevant keys. Some keys will be loaded during + * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel + * signing data. + */ public KeysInterface get_keys_manager() { long ret = bindings.ChannelManagerReadArgs_get_keys_manager(this.ptr); KeysInterface ret_hu_conv = new KeysInterface(null, ret); @@ -21,11 +54,21 @@ public class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * The keys provider which will give us relevant keys. Some keys will be loaded during + * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel + * signing data. + */ public void set_keys_manager(KeysInterface val) { bindings.ChannelManagerReadArgs_set_keys_manager(this.ptr, val == null ? 0 : val.ptr); this.ptrs_to.add(val); } + /** + * The fee_estimator for use in the ChannelManager in the future. + * + * No calls to the FeeEstimator will be made during deserialization. + */ public FeeEstimator get_fee_estimator() { long ret = bindings.ChannelManagerReadArgs_get_fee_estimator(this.ptr); FeeEstimator ret_hu_conv = new FeeEstimator(null, ret); @@ -33,11 +76,23 @@ public class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * The fee_estimator for use in the ChannelManager in the future. + * + * No calls to the FeeEstimator will be made during deserialization. + */ public void set_fee_estimator(FeeEstimator val) { bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val == null ? 0 : val.ptr); this.ptrs_to.add(val); } + /** + * The chain::Watch for use in the ChannelManager in the future. + * + * No calls to the chain::Watch will be made during deserialization. It is assumed that + * you have deserialized ChannelMonitors separately and will add them to your + * chain::Watch after deserializing this ChannelManager. + */ public Watch get_chain_monitor() { long ret = bindings.ChannelManagerReadArgs_get_chain_monitor(this.ptr); Watch ret_hu_conv = new Watch(null, ret); @@ -45,11 +100,23 @@ public class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * The chain::Watch for use in the ChannelManager in the future. + * + * No calls to the chain::Watch will be made during deserialization. It is assumed that + * you have deserialized ChannelMonitors separately and will add them to your + * chain::Watch after deserializing this ChannelManager. + */ public void set_chain_monitor(Watch val) { bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val == null ? 0 : val.ptr); this.ptrs_to.add(val); } + /** + * The BroadcasterInterface which will be used in the ChannelManager in the future and may be + * used to broadcast the latest local commitment transactions of channels which must be + * force-closed during deserialization. + */ public BroadcasterInterface get_tx_broadcaster() { long ret = bindings.ChannelManagerReadArgs_get_tx_broadcaster(this.ptr); BroadcasterInterface ret_hu_conv = new BroadcasterInterface(null, ret); @@ -57,11 +124,20 @@ public class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * The BroadcasterInterface which will be used in the ChannelManager in the future and may be + * used to broadcast the latest local commitment transactions of channels which must be + * force-closed during deserialization. + */ public void set_tx_broadcaster(BroadcasterInterface val) { bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val == null ? 0 : val.ptr); this.ptrs_to.add(val); } + /** + * The Logger for use in the ChannelManager and which may be used to log information during + * deserialization. + */ public Logger get_logger() { long ret = bindings.ChannelManagerReadArgs_get_logger(this.ptr); Logger ret_hu_conv = new Logger(null, ret); @@ -69,11 +145,19 @@ public class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * The Logger for use in the ChannelManager and which may be used to log information during + * deserialization. + */ public void set_logger(Logger val) { bindings.ChannelManagerReadArgs_set_logger(this.ptr, val == null ? 0 : val.ptr); this.ptrs_to.add(val); } + /** + * Default settings used for new channels. Any existing channels will continue to use the + * runtime settings which were stored when the ChannelManager was serialized. + */ public UserConfig get_default_config() { long ret = bindings.ChannelManagerReadArgs_get_default_config(this.ptr); UserConfig ret_hu_conv = new UserConfig(null, ret); @@ -81,11 +165,20 @@ public class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * Default settings used for new channels. Any existing channels will continue to use the + * runtime settings which were stored when the ChannelManager was serialized. + */ public void set_default_config(UserConfig val) { bindings.ChannelManagerReadArgs_set_default_config(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Simple utility function to create a ChannelManagerReadArgs which creates the monitor + * HashMap for you. This is primarily useful for C bindings where it is not practical to + * populate a HashMap directly from C. + */ public static ChannelManagerReadArgs constructor_new(KeysInterface keys_manager, FeeEstimator fee_estimator, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, UserConfig default_config, ChannelMonitor[] channel_monitors) { long ret = bindings.ChannelManagerReadArgs_new(keys_manager == null ? 0 : keys_manager.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, default_config == null ? 0 : default_config.ptr & ~1, Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr & ~1).toArray()); ChannelManagerReadArgs ret_hu_conv = new ChannelManagerReadArgs(null, ret); diff --git a/src/main/java/org/ldk/structs/ChannelMessageHandler.java b/src/main/java/org/ldk/structs/ChannelMessageHandler.java index 2b9aebe4..5eaedc16 100644 --- a/src/main/java/org/ldk/structs/ChannelMessageHandler.java +++ b/src/main/java/org/ldk/structs/ChannelMessageHandler.java @@ -5,6 +5,12 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * A trait to describe an object which can receive channel messages. + * + * Messages MAY be called in parallel when they originate from different their_node_ids, however + * they MUST NOT be called in parallel when the two calls have the same their_node_id. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelMessageHandler extends CommonBase { final bindings.LDKChannelMessageHandler bindings_instance; @@ -21,24 +27,84 @@ public class ChannelMessageHandler extends CommonBase { } public static interface ChannelMessageHandlerInterface { + /** + * Handle an incoming open_channel message from the given peer. + */ void handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg); + /** + * Handle an incoming accept_channel message from the given peer. + */ void handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg); + /** + * Handle an incoming funding_created message from the given peer. + */ void handle_funding_created(byte[] their_node_id, FundingCreated msg); + /** + * Handle an incoming funding_signed message from the given peer. + */ void handle_funding_signed(byte[] their_node_id, FundingSigned msg); + /** + * Handle an incoming funding_locked message from the given peer. + */ void handle_funding_locked(byte[] their_node_id, FundingLocked msg); + /** + * Handle an incoming shutdown message from the given peer. + */ void handle_shutdown(byte[] their_node_id, InitFeatures their_features, Shutdown msg); + /** + * Handle an incoming closing_signed message from the given peer. + */ void handle_closing_signed(byte[] their_node_id, ClosingSigned msg); + /** + * Handle an incoming update_add_htlc message from the given peer. + */ void handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg); + /** + * Handle an incoming update_fulfill_htlc message from the given peer. + */ void handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg); + /** + * Handle an incoming update_fail_htlc message from the given peer. + */ void handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg); + /** + * Handle an incoming update_fail_malformed_htlc message from the given peer. + */ void handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg); + /** + * Handle an incoming commitment_signed message from the given peer. + */ void handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg); + /** + * Handle an incoming revoke_and_ack message from the given peer. + */ void handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg); + /** + * Handle an incoming update_fee message from the given peer. + */ void handle_update_fee(byte[] their_node_id, UpdateFee msg); + /** + * Handle an incoming announcement_signatures message from the given peer. + */ void handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg); + /** + * Indicates a connection to the peer failed/an existing connection was lost. If no connection + * is believed to be possible in the future (eg they're sending us messages we don't + * understand or indicate they require unknown feature bits), no_connection_possible is set + * and any outstanding channels should be failed. + */ void peer_disconnected(byte[] their_node_id, boolean no_connection_possible); + /** + * Handle a peer reconnecting, possibly generating channel_reestablish message(s). + */ void peer_connected(byte[] their_node_id, Init msg); + /** + * Handle an incoming channel_reestablish message from the given peer. + */ void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg); + /** + * Handle an incoming error message from the given peer. + */ void handle_error(byte[] their_node_id, ErrorMessage msg); } private static class LDKChannelMessageHandlerHolder { ChannelMessageHandler held; } @@ -128,98 +194,158 @@ public class ChannelMessageHandler extends CommonBase { }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance); return impl_holder.held; } + /** + * Handle an incoming open_channel message from the given peer. + */ 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); } + /** + * Handle an incoming accept_channel message from the given peer. + */ 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); } + /** + * Handle an incoming funding_created message from the given peer. + */ 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); } + /** + * Handle an incoming funding_signed message from the given peer. + */ public void handle_funding_signed(byte[] their_node_id, FundingSigned msg) { bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming funding_locked message from the given peer. + */ public void handle_funding_locked(byte[] their_node_id, FundingLocked msg) { bindings.ChannelMessageHandler_handle_funding_locked(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming shutdown message from the given peer. + */ public void handle_shutdown(byte[] their_node_id, InitFeatures their_features, Shutdown msg) { bindings.ChannelMessageHandler_handle_shutdown(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); } + /** + * Handle an incoming closing_signed message from the given peer. + */ public void handle_closing_signed(byte[] their_node_id, ClosingSigned msg) { bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming update_add_htlc message from the given peer. + */ public void handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg) { bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming update_fulfill_htlc message from the given peer. + */ public void handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg) { bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming update_fail_htlc message from the given peer. + */ public void handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg) { bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming update_fail_malformed_htlc message from the given peer. + */ public void handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg) { bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming commitment_signed message from the given peer. + */ public void handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg) { bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming revoke_and_ack message from the given peer. + */ public void handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg) { bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming update_fee message from the given peer. + */ public void handle_update_fee(byte[] their_node_id, UpdateFee msg) { bindings.ChannelMessageHandler_handle_update_fee(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming announcement_signatures message from the given peer. + */ public void handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg) { bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Indicates a connection to the peer failed/an existing connection was lost. If no connection + * is believed to be possible in the future (eg they're sending us messages we don't + * understand or indicate they require unknown feature bits), no_connection_possible is set + * and any outstanding channels should be failed. + */ public void peer_disconnected(byte[] their_node_id, boolean no_connection_possible) { bindings.ChannelMessageHandler_peer_disconnected(this.ptr, their_node_id, no_connection_possible); } + /** + * Handle a peer reconnecting, possibly generating channel_reestablish message(s). + */ public void peer_connected(byte[] their_node_id, Init msg) { bindings.ChannelMessageHandler_peer_connected(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming channel_reestablish message from the given peer. + */ public void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg) { bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } + /** + * Handle an incoming error message from the given peer. + */ public void handle_error(byte[] their_node_id, ErrorMessage msg) { bindings.ChannelMessageHandler_handle_error(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 84f7f4e8..1ab69bc7 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitor.java +++ b/src/main/java/org/ldk/structs/ChannelMonitor.java @@ -5,6 +5,25 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates + * on-chain transactions to ensure no loss of funds occurs. + * + * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date + * information and are actively monitoring the chain. + * + * Pending Events or updated HTLCs which have not yet been read out by + * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and + * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events + * gotten are fully handled before re-serializing the new state. + * + * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which + * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along + * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the + * returned block hash and the the current chain and then reconnecting blocks to get to the + * best chain) upon deserializing the object! + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelMonitor extends CommonBase { ChannelMonitor(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +33,9 @@ public class ChannelMonitor extends CommonBase { if (ptr != 0) { bindings.ChannelMonitor_free(ptr); } } + /** + * Creates a copy of the ChannelMonitor + */ public ChannelMonitor clone() { long ret = bindings.ChannelMonitor_clone(this.ptr); ChannelMonitor ret_hu_conv = new ChannelMonitor(null, ret); @@ -21,11 +43,20 @@ public class ChannelMonitor extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read + */ public byte[] write() { byte[] ret = bindings.ChannelMonitor_write(this.ptr); return ret; } + /** + * Updates a ChannelMonitor on the basis of some new information provided by the Channel + * itself. + * + * panics if the given update is not the next update by update_id. + */ 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); @@ -36,11 +67,18 @@ public class ChannelMonitor extends CommonBase { return ret_hu_conv; } + /** + * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this + * ChannelMonitor. + */ public long get_latest_update_id() { long ret = bindings.ChannelMonitor_get_latest_update_id(this.ptr); return ret; } + /** + * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for. + */ public TwoTuple get_funding_txo() { long ret = bindings.ChannelMonitor_get_funding_txo(this.ptr); long ret_a = bindings.LDKC2Tuple_OutPointScriptZ_get_a(ret); @@ -54,6 +92,50 @@ public class ChannelMonitor extends CommonBase { return ret_conv; } + /** + * Gets a list of txids, with their output scripts (in the order they appear in the + * transaction), which we must learn about spends of via block_connected(). + */ + public TwoTuple[]>[] get_outputs_to_watch() { + long[] ret = bindings.ChannelMonitor_get_outputs_to_watch(this.ptr); + TwoTuple[]>[] ret_conv_47_arr = new TwoTuple[ret.length]; + for (int v = 0; v < ret.length; v++) { + long ret_conv_47 = ret[v]; + byte[] ret_conv_47_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(ret_conv_47); + long[] ret_conv_47_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(ret_conv_47); + TwoTuple[] ret_conv_47_b_conv_27_arr = new TwoTuple[ret_conv_47_b.length]; + for (int b = 0; b < ret_conv_47_b.length; b++) { + long ret_conv_47_b_conv_27 = ret_conv_47_b[b]; + int ret_conv_47_b_conv_27_a = bindings.LDKC2Tuple_u32ScriptZ_get_a(ret_conv_47_b_conv_27); + byte[] ret_conv_47_b_conv_27_b = bindings.LDKC2Tuple_u32ScriptZ_get_b(ret_conv_47_b_conv_27); + TwoTuple ret_conv_47_b_conv_27_conv = new TwoTuple(ret_conv_47_b_conv_27_a, ret_conv_47_b_conv_27_b, () -> { + bindings.C2Tuple_u32ScriptZ_free(ret_conv_47_b_conv_27); + }); + ret_conv_47_b_conv_27_arr[b] = ret_conv_47_b_conv_27_conv; + }; + TwoTuple[]> ret_conv_47_conv = new TwoTuple[]>(ret_conv_47_a, ret_conv_47_b_conv_27_arr); + // Warning: We may not free the C tuple object! + ret_conv_47_arr[v] = ret_conv_47_conv; + } + return ret_conv_47_arr; + } + + /** + * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly + * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs + * have been registered. + */ + public void load_outputs_to_watch(Filter filter) { + bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter == null ? 0 : filter.ptr); + this.ptrs_to.add(filter); + } + + /** + * Get the list of HTLCs who's status has been updated on chain. This should be called by + * ChannelManager via [`chain::Watch::release_pending_monitor_events`]. + * + * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events + */ public MonitorEvent[] get_and_clear_pending_monitor_events() { long[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr); MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret.length]; @@ -66,6 +148,14 @@ public class ChannelMonitor extends CommonBase { return ret_conv_14_arr; } + /** + * Gets the list of pending events which were generated by previous actions, clearing the list + * in the process. + * + * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to + * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do + * no internal locking in ChannelMonitors. + */ public Event[] get_and_clear_pending_events() { long[] ret = bindings.ChannelMonitor_get_and_clear_pending_events(this.ptr); Event[] ret_conv_7_arr = new Event[ret.length]; @@ -78,12 +168,36 @@ public class ChannelMonitor extends CommonBase { return ret_conv_7_arr; } + /** + * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of + * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of + * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows + * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these + * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to + * broadcast them if counterparty don't close channel with his higher commitment transaction after a + * substantial amount of time (a month or even a year) to get back funds. Best may be to contact + * out-of-band the other node operator to coordinate with him if option is available to you. + * In any-case, choice is up to the user. + */ public byte[][] get_latest_holder_commitment_txn(Logger logger) { byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : logger.ptr); this.ptrs_to.add(logger); return ret; } + /** + * Processes transactions in a newly connected block, which may result in any of the following: + * - update the monitor's state against resolved HTLCs + * - punish the counterparty in the case of seeing a revoked commitment transaction + * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration + * - detect settled outputs for later spending + * - schedule and bump any in-flight claims + * + * Returns any new outputs to watch from `txdata`; after called, these are also included in + * [`get_outputs_to_watch`]. + * + * [`get_outputs_to_watch`]: #method.get_outputs_to_watch + */ 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(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray(), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); TwoTuple[]>[] ret_conv_46_arr = new TwoTuple[ret.length]; @@ -114,6 +228,10 @@ public class ChannelMonitor extends CommonBase { return ret_conv_46_arr; } + /** + * Determines if the disconnected block contained any transactions of interest and updates + * appropriately. + */ public void block_disconnected(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { bindings.ChannelMonitor_block_disconnected(this.ptr, header, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); this.ptrs_to.add(broadcaster); diff --git a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java index 179a200d..4373180a 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An update generated by the underlying Channel itself which contains some new information the + * ChannelMonitor should be made aware of. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelMonitorUpdate extends CommonBase { ChannelMonitorUpdate(Object _dummy, long ptr) { super(ptr); } @@ -14,15 +19,48 @@ public class ChannelMonitorUpdate extends CommonBase { if (ptr != 0) { bindings.ChannelMonitorUpdate_free(ptr); } } + /** + * The sequence number of this update. Updates *must* be replayed in-order according to this + * sequence number (and updates may panic if they are not). The update_id values are strictly + * increasing and increase by one for each new update, with one exception specified below. + * + * This sequence number is also used to track up to which points updates which returned + * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given + * ChannelMonitor when ChannelManager::channel_monitor_updated is called. + * + * The only instance where update_id values are not strictly increasing is the case where we + * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See + * its docs for more details. + * + * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html + */ public long get_update_id() { long ret = bindings.ChannelMonitorUpdate_get_update_id(this.ptr); return ret; } + /** + * The sequence number of this update. Updates *must* be replayed in-order according to this + * sequence number (and updates may panic if they are not). The update_id values are strictly + * increasing and increase by one for each new update, with one exception specified below. + * + * This sequence number is also used to track up to which points updates which returned + * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given + * ChannelMonitor when ChannelManager::channel_monitor_updated is called. + * + * The only instance where update_id values are not strictly increasing is the case where we + * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See + * its docs for more details. + * + * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html + */ public void set_update_id(long val) { bindings.ChannelMonitorUpdate_set_update_id(this.ptr, val); } + /** + * Creates a copy of the ChannelMonitorUpdate + */ public ChannelMonitorUpdate clone() { long ret = bindings.ChannelMonitorUpdate_clone(this.ptr); ChannelMonitorUpdate ret_hu_conv = new ChannelMonitorUpdate(null, ret); @@ -30,11 +68,17 @@ public class ChannelMonitorUpdate extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read + */ public byte[] write() { byte[] ret = bindings.ChannelMonitorUpdate_write(this.ptr); return ret; } + /** + * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write + */ public static Result_ChannelMonitorUpdateDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelMonitorUpdate_read(ser); Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ChannelPublicKeys.java b/src/main/java/org/ldk/structs/ChannelPublicKeys.java index 0d2664a6..c67b24a7 100644 --- a/src/main/java/org/ldk/structs/ChannelPublicKeys.java +++ b/src/main/java/org/ldk/structs/ChannelPublicKeys.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * One counterparty's public keys which do not change over the life of a channel. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelPublicKeys extends CommonBase { ChannelPublicKeys(Object _dummy, long ptr) { super(ptr); } @@ -14,51 +18,102 @@ public class ChannelPublicKeys extends CommonBase { if (ptr != 0) { bindings.ChannelPublicKeys_free(ptr); } } + /** + * The public key which is used to sign all commitment transactions, as it appears in the + * on-chain channel lock-in 2-of-2 multisig output. + */ public byte[] get_funding_pubkey() { byte[] ret = bindings.ChannelPublicKeys_get_funding_pubkey(this.ptr); return ret; } + /** + * The public key which is used to sign all commitment transactions, as it appears in the + * on-chain channel lock-in 2-of-2 multisig output. + */ public void set_funding_pubkey(byte[] val) { bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, val); } + /** + * The base point which is used (with derive_public_revocation_key) to derive per-commitment + * revocation keys. This is combined with the per-commitment-secret generated by the + * counterparty to create a secret which the counterparty can reveal to revoke previous + * states. + */ public byte[] get_revocation_basepoint() { byte[] ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this.ptr); return ret; } + /** + * The base point which is used (with derive_public_revocation_key) to derive per-commitment + * revocation keys. This is combined with the per-commitment-secret generated by the + * counterparty to create a secret which the counterparty can reveal to revoke previous + * states. + */ public void set_revocation_basepoint(byte[] val) { bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val); } + /** + * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately + * spendable primary channel balance on the broadcaster's commitment transaction. This key is + * static across every commitment transaction. + */ public byte[] get_payment_point() { byte[] ret = bindings.ChannelPublicKeys_get_payment_point(this.ptr); return ret; } + /** + * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately + * spendable primary channel balance on the broadcaster's commitment transaction. This key is + * static across every commitment transaction. + */ public void set_payment_point(byte[] val) { bindings.ChannelPublicKeys_set_payment_point(this.ptr, val); } + /** + * The base point which is used (with derive_public_key) to derive a per-commitment payment + * public key which receives non-HTLC-encumbered funds which are only available for spending + * after some delay (or can be claimed via the revocation path). + */ public byte[] get_delayed_payment_basepoint() { byte[] ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this.ptr); return ret; } + /** + * The base point which is used (with derive_public_key) to derive a per-commitment payment + * public key which receives non-HTLC-encumbered funds which are only available for spending + * after some delay (or can be claimed via the revocation path). + */ public void set_delayed_payment_basepoint(byte[] val) { bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val); } + /** + * The base point which is used (with derive_public_key) to derive a per-commitment public key + * which is used to encumber HTLC-in-flight outputs. + */ public byte[] get_htlc_basepoint() { byte[] ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this.ptr); return ret; } + /** + * The base point which is used (with derive_public_key) to derive a per-commitment public key + * which is used to encumber HTLC-in-flight outputs. + */ public void set_htlc_basepoint(byte[] val) { bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val); } + /** + * Constructs a new ChannelPublicKeys given each field + */ public static ChannelPublicKeys constructor_new(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg) { long ret = bindings.ChannelPublicKeys_new(funding_pubkey_arg, revocation_basepoint_arg, payment_point_arg, delayed_payment_basepoint_arg, htlc_basepoint_arg); ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); @@ -66,6 +121,9 @@ public class ChannelPublicKeys extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ChannelPublicKeys + */ public ChannelPublicKeys clone() { long ret = bindings.ChannelPublicKeys_clone(this.ptr); ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); @@ -73,11 +131,17 @@ public class ChannelPublicKeys extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read + */ public byte[] write() { byte[] ret = bindings.ChannelPublicKeys_write(this.ptr); return ret; } + /** + * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write + */ public static Result_ChannelPublicKeysDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelPublicKeys_read(ser); Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ChannelReestablish.java b/src/main/java/org/ldk/structs/ChannelReestablish.java index be928489..bd5fe0ea 100644 --- a/src/main/java/org/ldk/structs/ChannelReestablish.java +++ b/src/main/java/org/ldk/structs/ChannelReestablish.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A channel_reestablish message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelReestablish extends CommonBase { ChannelReestablish(Object _dummy, long ptr) { super(ptr); } @@ -14,33 +18,54 @@ public class ChannelReestablish extends CommonBase { if (ptr != 0) { bindings.ChannelReestablish_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.ChannelReestablish_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.ChannelReestablish_set_channel_id(this.ptr, val); } + /** + * The next commitment number for the sender + */ public long get_next_local_commitment_number() { long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this.ptr); return ret; } + /** + * The next commitment number for the sender + */ public void set_next_local_commitment_number(long val) { bindings.ChannelReestablish_set_next_local_commitment_number(this.ptr, val); } + /** + * The next commitment number for the recipient + */ public long get_next_remote_commitment_number() { long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this.ptr); return ret; } + /** + * The next commitment number for the recipient + */ public void set_next_remote_commitment_number(long val) { bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val); } + /** + * Creates a copy of the ChannelReestablish + */ public ChannelReestablish clone() { long ret = bindings.ChannelReestablish_clone(this.ptr); ChannelReestablish ret_hu_conv = new ChannelReestablish(null, ret); @@ -48,11 +73,17 @@ public class ChannelReestablish extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read + */ public byte[] write() { byte[] ret = bindings.ChannelReestablish_write(this.ptr); return ret; } + /** + * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write + */ public static Result_ChannelReestablishDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelReestablish_read(ser); Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java index a64af173..2930d5cb 100644 --- a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java @@ -5,6 +5,14 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction). + * The fields are organized by holder/counterparty. + * + * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters + * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelTransactionParameters extends CommonBase { ChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +22,9 @@ public class ChannelTransactionParameters extends CommonBase { if (ptr != 0) { bindings.ChannelTransactionParameters_free(ptr); } } + /** + * Holder public keys + */ public ChannelPublicKeys get_holder_pubkeys() { long ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr); ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); @@ -21,29 +32,50 @@ public class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Holder public keys + */ 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); } + /** + * The contest delay selected by the holder, which applies to counterparty-broadcast transactions + */ public short get_holder_selected_contest_delay() { short ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr); return ret; } + /** + * The contest delay selected by the holder, which applies to counterparty-broadcast transactions + */ public void set_holder_selected_contest_delay(short val) { bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val); } + /** + * Whether the holder is the initiator of this channel. + * This is an input to the commitment number obscure factor computation. + */ public boolean get_is_outbound_from_holder() { boolean ret = bindings.ChannelTransactionParameters_get_is_outbound_from_holder(this.ptr); return ret; } + /** + * Whether the holder is the initiator of this channel. + * This is an input to the commitment number obscure factor computation. + */ public void set_is_outbound_from_holder(boolean val) { bindings.ChannelTransactionParameters_set_is_outbound_from_holder(this.ptr, val); } + /** + * The late-bound counterparty channel transaction parameters. + * These parameters are populated at the point in the protocol where the counterparty provides them. + */ public CounterpartyChannelTransactionParameters get_counterparty_parameters() { long ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr); CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); @@ -51,11 +83,18 @@ public class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * The late-bound counterparty channel transaction parameters. + * These parameters are populated at the point in the protocol where the counterparty provides them. + */ 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); } + /** + * The late-bound funding outpoint + */ public OutPoint get_funding_outpoint() { long ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr); OutPoint ret_hu_conv = new OutPoint(null, ret); @@ -63,11 +102,17 @@ public class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * The late-bound funding outpoint + */ 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); } + /** + * Constructs a new ChannelTransactionParameters given each field + */ 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); @@ -78,6 +123,9 @@ public class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ChannelTransactionParameters + */ public ChannelTransactionParameters clone() { long ret = bindings.ChannelTransactionParameters_clone(this.ptr); ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); @@ -85,11 +133,20 @@ public class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Whether the late bound parameters are populated. + */ public boolean is_populated() { boolean ret = bindings.ChannelTransactionParameters_is_populated(this.ptr); return ret; } + /** + * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters, + * given that the holder is the broadcaster. + * + * self.is_populated() must be true before calling this function. + */ public DirectedChannelTransactionParameters as_holder_broadcastable() { long ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr); DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); @@ -97,6 +154,12 @@ public class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters, + * given that the counterparty is the broadcaster. + * + * self.is_populated() must be true before calling this function. + */ public DirectedChannelTransactionParameters as_counterparty_broadcastable() { long ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr); DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); @@ -104,11 +167,17 @@ public class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read + */ public byte[] write() { byte[] ret = bindings.ChannelTransactionParameters_write(this.ptr); return ret; } + /** + * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write + */ public static Result_ChannelTransactionParametersDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelTransactionParameters_read(ser); Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ChannelUpdate.java b/src/main/java/org/ldk/structs/ChannelUpdate.java index 805b4511..cce8c155 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelUpdate.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A channel_update message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ChannelUpdate extends CommonBase { ChannelUpdate(Object _dummy, long ptr) { super(ptr); } @@ -14,15 +18,24 @@ public class ChannelUpdate extends CommonBase { if (ptr != 0) { bindings.ChannelUpdate_free(ptr); } } + /** + * A signature of the channel update + */ public byte[] get_signature() { byte[] ret = bindings.ChannelUpdate_get_signature(this.ptr); return ret; } + /** + * A signature of the channel update + */ public void set_signature(byte[] val) { bindings.ChannelUpdate_set_signature(this.ptr, val); } + /** + * The actual channel update + */ public UnsignedChannelUpdate get_contents() { long ret = bindings.ChannelUpdate_get_contents(this.ptr); UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret); @@ -30,11 +43,17 @@ public class ChannelUpdate extends CommonBase { return ret_hu_conv; } + /** + * The actual channel update + */ public void set_contents(UnsignedChannelUpdate val) { bindings.ChannelUpdate_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Constructs a new ChannelUpdate given each field + */ public static ChannelUpdate constructor_new(byte[] signature_arg, UnsignedChannelUpdate contents_arg) { long ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret); @@ -43,6 +62,9 @@ public class ChannelUpdate extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ChannelUpdate + */ public ChannelUpdate clone() { long ret = bindings.ChannelUpdate_clone(this.ptr); ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret); @@ -50,11 +72,17 @@ public class ChannelUpdate extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read + */ public byte[] write() { byte[] ret = bindings.ChannelUpdate_write(this.ptr); return ret; } + /** + * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write + */ public static Result_ChannelUpdateDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelUpdate_read(ser); Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ClosingSigned.java b/src/main/java/org/ldk/structs/ClosingSigned.java index a42c3e50..4fe37bd1 100644 --- a/src/main/java/org/ldk/structs/ClosingSigned.java +++ b/src/main/java/org/ldk/structs/ClosingSigned.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A closing_signed message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ClosingSigned extends CommonBase { ClosingSigned(Object _dummy, long ptr) { super(ptr); } @@ -14,33 +18,54 @@ public class ClosingSigned extends CommonBase { if (ptr != 0) { bindings.ClosingSigned_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.ClosingSigned_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.ClosingSigned_set_channel_id(this.ptr, val); } + /** + * The proposed total fee for the closing transaction + */ public long get_fee_satoshis() { long ret = bindings.ClosingSigned_get_fee_satoshis(this.ptr); return ret; } + /** + * The proposed total fee for the closing transaction + */ public void set_fee_satoshis(long val) { bindings.ClosingSigned_set_fee_satoshis(this.ptr, val); } + /** + * A signature on the closing transaction + */ public byte[] get_signature() { byte[] ret = bindings.ClosingSigned_get_signature(this.ptr); return ret; } + /** + * A signature on the closing transaction + */ public void set_signature(byte[] val) { bindings.ClosingSigned_set_signature(this.ptr, val); } + /** + * Constructs a new ClosingSigned given each field + */ public static ClosingSigned constructor_new(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg) { long ret = bindings.ClosingSigned_new(channel_id_arg, fee_satoshis_arg, signature_arg); ClosingSigned ret_hu_conv = new ClosingSigned(null, ret); @@ -48,6 +73,9 @@ public class ClosingSigned extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ClosingSigned + */ public ClosingSigned clone() { long ret = bindings.ClosingSigned_clone(this.ptr); ClosingSigned ret_hu_conv = new ClosingSigned(null, ret); @@ -55,11 +83,17 @@ public class ClosingSigned extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read + */ public byte[] write() { byte[] ret = bindings.ClosingSigned_write(this.ptr); return ret; } + /** + * Read a ClosingSigned from a byte array, created by ClosingSigned_write + */ public static Result_ClosingSignedDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ClosingSigned_read(ser); Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/CommitmentSigned.java b/src/main/java/org/ldk/structs/CommitmentSigned.java index b14e1ca4..35100476 100644 --- a/src/main/java/org/ldk/structs/CommitmentSigned.java +++ b/src/main/java/org/ldk/structs/CommitmentSigned.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A commitment_signed message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class CommitmentSigned extends CommonBase { CommitmentSigned(Object _dummy, long ptr) { super(ptr); } @@ -14,28 +18,46 @@ public class CommitmentSigned extends CommonBase { if (ptr != 0) { bindings.CommitmentSigned_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.CommitmentSigned_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.CommitmentSigned_set_channel_id(this.ptr, val); } + /** + * A signature on the commitment transaction + */ public byte[] get_signature() { byte[] ret = bindings.CommitmentSigned_get_signature(this.ptr); return ret; } + /** + * A signature on the commitment transaction + */ public void set_signature(byte[] val) { bindings.CommitmentSigned_set_signature(this.ptr, val); } + /** + * Signatures on the HTLC transactions + */ public void set_htlc_signatures(byte[][] val) { bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val); } + /** + * Constructs a new CommitmentSigned given each field + */ public static CommitmentSigned constructor_new(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) { long ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg); CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret); @@ -43,6 +65,9 @@ public class CommitmentSigned extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the CommitmentSigned + */ public CommitmentSigned clone() { long ret = bindings.CommitmentSigned_clone(this.ptr); CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret); @@ -50,11 +75,17 @@ public class CommitmentSigned extends CommonBase { return ret_hu_conv; } + /** + * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read + */ public byte[] write() { byte[] ret = bindings.CommitmentSigned_write(this.ptr); return ret; } + /** + * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write + */ public static Result_CommitmentSignedDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.CommitmentSigned_read(ser); Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/CommitmentTransaction.java b/src/main/java/org/ldk/structs/CommitmentTransaction.java index a4f1698c..70b0ab5a 100644 --- a/src/main/java/org/ldk/structs/CommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/CommitmentTransaction.java @@ -5,6 +5,15 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * This class tracks the per-transaction information needed to build a commitment transaction and to + * actually build it and sign. It is used for holder transactions that we sign only when needed + * and for transactions we sign for the counterparty. + * + * This class can be used inside a signer implementation to generate a signature given the relevant + * secret key. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class CommitmentTransaction extends CommonBase { CommitmentTransaction(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +23,9 @@ public class CommitmentTransaction extends CommonBase { if (ptr != 0) { bindings.CommitmentTransaction_free(ptr); } } + /** + * Creates a copy of the CommitmentTransaction + */ public CommitmentTransaction clone() { long ret = bindings.CommitmentTransaction_clone(this.ptr); CommitmentTransaction ret_hu_conv = new CommitmentTransaction(null, ret); @@ -21,37 +33,63 @@ public class CommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read + */ public byte[] write() { byte[] ret = bindings.CommitmentTransaction_write(this.ptr); return ret; } + /** + * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write + */ public static Result_CommitmentTransactionDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.CommitmentTransaction_read(ser); Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * The backwards-counting commitment number + */ public long commitment_number() { long ret = bindings.CommitmentTransaction_commitment_number(this.ptr); return ret; } + /** + * The value to be sent to the broadcaster + */ public long to_broadcaster_value_sat() { long ret = bindings.CommitmentTransaction_to_broadcaster_value_sat(this.ptr); return ret; } + /** + * The value to be sent to the counterparty + */ public long to_countersignatory_value_sat() { long ret = bindings.CommitmentTransaction_to_countersignatory_value_sat(this.ptr); return ret; } + /** + * The feerate paid per 1000-weight-unit in this commitment transaction. + */ public int feerate_per_kw() { int ret = bindings.CommitmentTransaction_feerate_per_kw(this.ptr); return ret; } + /** + * Trust our pre-built transaction and derived transaction creation public keys. + * + * Applies a wrapper which allows access to these fields. + * + * This should only be used if you fully trust the builder of this object. It should not + * \tbe used by an external signer - instead use the verify function. + */ public TrustedCommitmentTransaction trust() { long ret = bindings.CommitmentTransaction_trust(this.ptr); TrustedCommitmentTransaction ret_hu_conv = new TrustedCommitmentTransaction(null, ret); @@ -59,6 +97,14 @@ public class CommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Verify our pre-built transaction and derived transaction creation public keys. + * + * Applies a wrapper which allows access to these fields. + * + * An external validating signer must call this method before signing + * or using the built transaction. + */ 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); diff --git a/src/main/java/org/ldk/structs/CommitmentUpdate.java b/src/main/java/org/ldk/structs/CommitmentUpdate.java index b6c5d482..94bc354c 100644 --- a/src/main/java/org/ldk/structs/CommitmentUpdate.java +++ b/src/main/java/org/ldk/structs/CommitmentUpdate.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment + * transaction updates if they were pending. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class CommitmentUpdate extends CommonBase { CommitmentUpdate(Object _dummy, long ptr) { super(ptr); } @@ -14,26 +19,41 @@ public class CommitmentUpdate extends CommonBase { if (ptr != 0) { bindings.CommitmentUpdate_free(ptr); } } + /** + * update_add_htlc messages which should be sent + */ public void set_update_add_htlcs(UpdateAddHTLC[] val) { bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_15 -> val_conv_15 == null ? 0 : val_conv_15.ptr & ~1).toArray()); /* TODO 2 UpdateAddHTLC */; } + /** + * update_fulfill_htlc messages which should be sent + */ public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) { bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_19 -> val_conv_19 == null ? 0 : val_conv_19.ptr & ~1).toArray()); /* TODO 2 UpdateFulfillHTLC */; } + /** + * update_fail_htlc messages which should be sent + */ public void set_update_fail_htlcs(UpdateFailHTLC[] val) { bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray()); /* TODO 2 UpdateFailHTLC */; } + /** + * update_fail_malformed_htlc messages which should be sent + */ public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) { bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_25 -> val_conv_25 == null ? 0 : val_conv_25.ptr & ~1).toArray()); /* TODO 2 UpdateFailMalformedHTLC */; } + /** + * An update_fee message which should be sent + */ public UpdateFee get_update_fee() { long ret = bindings.CommitmentUpdate_get_update_fee(this.ptr); UpdateFee ret_hu_conv = new UpdateFee(null, ret); @@ -41,11 +61,17 @@ public class CommitmentUpdate extends CommonBase { return ret_hu_conv; } + /** + * An update_fee message which should be sent + */ public void set_update_fee(UpdateFee val) { bindings.CommitmentUpdate_set_update_fee(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Finally, the commitment_signed message which should be sent + */ public CommitmentSigned get_commitment_signed() { long ret = bindings.CommitmentUpdate_get_commitment_signed(this.ptr); CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret); @@ -53,11 +79,17 @@ public class CommitmentUpdate extends CommonBase { return ret_hu_conv; } + /** + * Finally, the commitment_signed message which should be sent + */ public void set_commitment_signed(CommitmentSigned val) { bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Constructs a new CommitmentUpdate given each field + */ public static CommitmentUpdate constructor_new(UpdateAddHTLC[] update_add_htlcs_arg, UpdateFulfillHTLC[] update_fulfill_htlcs_arg, UpdateFailHTLC[] update_fail_htlcs_arg, UpdateFailMalformedHTLC[] update_fail_malformed_htlcs_arg, UpdateFee update_fee_arg, CommitmentSigned commitment_signed_arg) { long ret = bindings.CommitmentUpdate_new(Arrays.stream(update_add_htlcs_arg).mapToLong(update_add_htlcs_arg_conv_15 -> update_add_htlcs_arg_conv_15 == null ? 0 : update_add_htlcs_arg_conv_15.ptr & ~1).toArray(), Arrays.stream(update_fulfill_htlcs_arg).mapToLong(update_fulfill_htlcs_arg_conv_19 -> update_fulfill_htlcs_arg_conv_19 == null ? 0 : update_fulfill_htlcs_arg_conv_19.ptr & ~1).toArray(), Arrays.stream(update_fail_htlcs_arg).mapToLong(update_fail_htlcs_arg_conv_16 -> update_fail_htlcs_arg_conv_16 == null ? 0 : update_fail_htlcs_arg_conv_16.ptr & ~1).toArray(), Arrays.stream(update_fail_malformed_htlcs_arg).mapToLong(update_fail_malformed_htlcs_arg_conv_25 -> update_fail_malformed_htlcs_arg_conv_25 == null ? 0 : update_fail_malformed_htlcs_arg_conv_25.ptr & ~1).toArray(), update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1); CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret); @@ -71,6 +103,9 @@ public class CommitmentUpdate extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the CommitmentUpdate + */ public CommitmentUpdate clone() { long ret = bindings.CommitmentUpdate_clone(this.ptr); CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret); diff --git a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java index ae2d77cc..b06ef372 100644 --- a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Late-bound per-channel counterparty data used to build transactions. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class CounterpartyChannelTransactionParameters extends CommonBase { CounterpartyChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,9 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { if (ptr != 0) { bindings.CounterpartyChannelTransactionParameters_free(ptr); } } + /** + * Counter-party public keys + */ public ChannelPublicKeys get_pubkeys() { long ret = bindings.CounterpartyChannelTransactionParameters_get_pubkeys(this.ptr); ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); @@ -21,20 +28,32 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Counter-party public keys + */ public void set_pubkeys(ChannelPublicKeys val) { bindings.CounterpartyChannelTransactionParameters_set_pubkeys(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * The contest delay selected by the counterparty, which applies to holder-broadcast transactions + */ public short get_selected_contest_delay() { short ret = bindings.CounterpartyChannelTransactionParameters_get_selected_contest_delay(this.ptr); return ret; } + /** + * The contest delay selected by the counterparty, which applies to holder-broadcast transactions + */ public void set_selected_contest_delay(short val) { bindings.CounterpartyChannelTransactionParameters_set_selected_contest_delay(this.ptr, val); } + /** + * Constructs a new CounterpartyChannelTransactionParameters given each field + */ 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); @@ -43,6 +62,9 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the CounterpartyChannelTransactionParameters + */ public CounterpartyChannelTransactionParameters clone() { long ret = bindings.CounterpartyChannelTransactionParameters_clone(this.ptr); CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); @@ -50,11 +72,17 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read + */ public byte[] write() { byte[] ret = bindings.CounterpartyChannelTransactionParameters_write(this.ptr); return ret; } + /** + * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write + */ public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.CounterpartyChannelTransactionParameters_read(ser); Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/DataLossProtect.java b/src/main/java/org/ldk/structs/DataLossProtect.java index 4d0e79d4..17d56110 100644 --- a/src/main/java/org/ldk/structs/DataLossProtect.java +++ b/src/main/java/org/ldk/structs/DataLossProtect.java @@ -5,6 +5,13 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Proof that the sender knows the per-commitment secret of the previous commitment transaction. + * This is used to convince the recipient that the channel is at a certain commitment + * number even if they lost that data due to a local failure. Of course, the peer may lie + * and even later commitments may have been revoked. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DataLossProtect extends CommonBase { DataLossProtect(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +21,41 @@ public class DataLossProtect extends CommonBase { if (ptr != 0) { bindings.DataLossProtect_free(ptr); } } + /** + * Proof that the sender knows the per-commitment secret of a specific commitment transaction + * belonging to the recipient + */ public byte[] get_your_last_per_commitment_secret() { byte[] ret = bindings.DataLossProtect_get_your_last_per_commitment_secret(this.ptr); return ret; } + /** + * Proof that the sender knows the per-commitment secret of a specific commitment transaction + * belonging to the recipient + */ public void set_your_last_per_commitment_secret(byte[] val) { bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, val); } + /** + * The sender's per-commitment point for their current commitment transaction + */ public byte[] get_my_current_per_commitment_point() { byte[] ret = bindings.DataLossProtect_get_my_current_per_commitment_point(this.ptr); return ret; } + /** + * The sender's per-commitment point for their current commitment transaction + */ public void set_my_current_per_commitment_point(byte[] val) { bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, val); } + /** + * Constructs a new DataLossProtect given each field + */ public static DataLossProtect constructor_new(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg) { long ret = bindings.DataLossProtect_new(your_last_per_commitment_secret_arg, my_current_per_commitment_point_arg); DataLossProtect ret_hu_conv = new DataLossProtect(null, ret); @@ -39,6 +63,9 @@ public class DataLossProtect extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the DataLossProtect + */ public DataLossProtect clone() { long ret = bindings.DataLossProtect_clone(this.ptr); DataLossProtect ret_hu_conv = new DataLossProtect(null, ret); diff --git a/src/main/java/org/ldk/structs/DecodeError.java b/src/main/java/org/ldk/structs/DecodeError.java index d39265af..5a7703fc 100644 --- a/src/main/java/org/ldk/structs/DecodeError.java +++ b/src/main/java/org/ldk/structs/DecodeError.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An error in decoding a message or struct. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DecodeError extends CommonBase { DecodeError(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,9 @@ public class DecodeError extends CommonBase { if (ptr != 0) { bindings.DecodeError_free(ptr); } } + /** + * Creates a copy of the DecodeError + */ public DecodeError clone() { long ret = bindings.DecodeError_clone(this.ptr); DecodeError ret_hu_conv = new DecodeError(null, ret); diff --git a/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java b/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java index fd70cb97..87aaedf9 100644 --- a/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Information about a spendable output to a P2WSH script. See + * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DelayedPaymentOutputDescriptor extends CommonBase { DelayedPaymentOutputDescriptor(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +19,9 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { if (ptr != 0) { bindings.DelayedPaymentOutputDescriptor_free(ptr); } } + /** + * The outpoint which is spendable + */ public OutPoint get_outpoint() { long ret = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr); OutPoint ret_hu_conv = new OutPoint(null, ret); @@ -21,60 +29,107 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * The outpoint which is spendable + */ public void set_outpoint(OutPoint val) { bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Per commitment point to derive delayed_payment_key by key holder + */ public byte[] get_per_commitment_point() { byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_per_commitment_point(this.ptr); return ret; } + /** + * Per commitment point to derive delayed_payment_key by key holder + */ public void set_per_commitment_point(byte[] val) { bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, val); } + /** + * The nSequence value which must be set in the spending input to satisfy the OP_CSV in + * the witness_script. + */ public short get_to_self_delay() { short ret = bindings.DelayedPaymentOutputDescriptor_get_to_self_delay(this.ptr); return ret; } + /** + * The nSequence value which must be set in the spending input to satisfy the OP_CSV in + * the witness_script. + */ public void set_to_self_delay(short val) { bindings.DelayedPaymentOutputDescriptor_set_to_self_delay(this.ptr, val); } + /** + * The output which is referenced by the given outpoint + */ public void set_output(TxOut val) { bindings.DelayedPaymentOutputDescriptor_set_output(this.ptr, val.ptr); } + /** + * The revocation point specific to the commitment transaction which was broadcast. Used to + * derive the witnessScript for this output. + */ public byte[] get_revocation_pubkey() { byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_revocation_pubkey(this.ptr); return ret; } + /** + * The revocation point specific to the commitment transaction which was broadcast. Used to + * derive the witnessScript for this output. + */ public void set_revocation_pubkey(byte[] val) { bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val); } + /** + * Arbitrary identification information returned by a call to + * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in + * the channel to spend the output. + */ public byte[] get_channel_keys_id() { byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_channel_keys_id(this.ptr); return ret; } + /** + * Arbitrary identification information returned by a call to + * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in + * the channel to spend the output. + */ public void set_channel_keys_id(byte[] val) { bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val); } + /** + * The value of the channel which this output originated from, possibly indirectly. + */ public long get_channel_value_satoshis() { long ret = bindings.DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr); return ret; } + /** + * The value of the channel which this output originated from, possibly indirectly. + */ public void set_channel_value_satoshis(long val) { bindings.DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val); } + /** + * Constructs a new DelayedPaymentOutputDescriptor given each field + */ public static DelayedPaymentOutputDescriptor constructor_new(OutPoint outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, TxOut output_arg, byte[] revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) { long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, per_commitment_point_arg, to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg, channel_keys_id_arg, channel_value_satoshis_arg); DelayedPaymentOutputDescriptor ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret); @@ -83,6 +138,9 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the DelayedPaymentOutputDescriptor + */ public DelayedPaymentOutputDescriptor clone() { long ret = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr); DelayedPaymentOutputDescriptor ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret); diff --git a/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java b/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java index 2358c615..17b9ab0b 100644 --- a/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java @@ -5,6 +5,14 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Static channel fields used to build transactions given per-commitment fields, organized by + * broadcaster/countersignatory. + * + * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the + * as_holder_broadcastable and as_counterparty_broadcastable functions. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DirectedChannelTransactionParameters extends CommonBase { DirectedChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +22,9 @@ public class DirectedChannelTransactionParameters extends CommonBase { if (ptr != 0) { bindings.DirectedChannelTransactionParameters_free(ptr); } } + /** + * Get the channel pubkeys for the broadcaster + */ public ChannelPublicKeys broadcaster_pubkeys() { long ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr); ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); @@ -21,6 +32,9 @@ public class DirectedChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Get the channel pubkeys for the countersignatory + */ public ChannelPublicKeys countersignatory_pubkeys() { long ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr); ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); @@ -28,16 +42,29 @@ public class DirectedChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Get the contest delay applicable to the transactions. + * Note that the contest delay was selected by the countersignatory. + */ public short contest_delay() { short ret = bindings.DirectedChannelTransactionParameters_contest_delay(this.ptr); return ret; } + /** + * Whether the channel is outbound from the broadcaster. + * + * The boolean representing the side that initiated the channel is + * an input to the commitment number obscure factor computation. + */ public boolean is_outbound() { boolean ret = bindings.DirectedChannelTransactionParameters_is_outbound(this.ptr); return ret; } + /** + * The funding outpoint + */ public OutPoint funding_outpoint() { long ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr); OutPoint ret_hu_conv = new OutPoint(null, ret); diff --git a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java index 8e51c3f2..5610a704 100644 --- a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java +++ b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Details about one direction of a channel. Received + * within a channel update. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DirectionalChannelInfo extends CommonBase { DirectionalChannelInfo(Object _dummy, long ptr) { super(ptr); } @@ -14,42 +19,71 @@ public class DirectionalChannelInfo extends CommonBase { if (ptr != 0) { bindings.DirectionalChannelInfo_free(ptr); } } + /** + * When the last update to the channel direction was issued. + * Value is opaque, as set in the announcement. + */ public int get_last_update() { int ret = bindings.DirectionalChannelInfo_get_last_update(this.ptr); return ret; } + /** + * When the last update to the channel direction was issued. + * Value is opaque, as set in the announcement. + */ public void set_last_update(int val) { bindings.DirectionalChannelInfo_set_last_update(this.ptr, val); } + /** + * Whether the channel can be currently used for payments (in this one direction). + */ public boolean get_enabled() { boolean ret = bindings.DirectionalChannelInfo_get_enabled(this.ptr); return ret; } + /** + * Whether the channel can be currently used for payments (in this one direction). + */ public void set_enabled(boolean val) { bindings.DirectionalChannelInfo_set_enabled(this.ptr, val); } + /** + * The difference in CLTV values that you must have when routing through this channel. + */ public short get_cltv_expiry_delta() { short ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this.ptr); return ret; } + /** + * The difference in CLTV values that you must have when routing through this channel. + */ public void set_cltv_expiry_delta(short val) { bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this.ptr, val); } + /** + * The minimum value, which must be relayed to the next hop via the channel + */ public long get_htlc_minimum_msat() { long ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this.ptr); return ret; } + /** + * The minimum value, which must be relayed to the next hop via the channel + */ public void set_htlc_minimum_msat(long val) { bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val); } + /** + * Fees charged when the channel is used for routing + */ public RoutingFees get_fees() { long ret = bindings.DirectionalChannelInfo_get_fees(this.ptr); RoutingFees ret_hu_conv = new RoutingFees(null, ret); @@ -57,11 +91,20 @@ public class DirectionalChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Fees charged when the channel is used for routing + */ public void set_fees(RoutingFees val) { bindings.DirectionalChannelInfo_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Most recent update for the channel received from the network + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + */ public ChannelUpdate get_last_update_message() { long ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr); ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret); @@ -69,11 +112,20 @@ public class DirectionalChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Most recent update for the channel received from the network + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + */ public void set_last_update_message(ChannelUpdate val) { bindings.DirectionalChannelInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Creates a copy of the DirectionalChannelInfo + */ public DirectionalChannelInfo clone() { long ret = bindings.DirectionalChannelInfo_clone(this.ptr); DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret); @@ -81,11 +133,17 @@ public class DirectionalChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read + */ public byte[] write() { byte[] ret = bindings.DirectionalChannelInfo_write(this.ptr); return ret; } + /** + * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write + */ public static Result_DirectionalChannelInfoDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.DirectionalChannelInfo_read(ser); Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ErrorAction.java b/src/main/java/org/ldk/structs/ErrorAction.java index f5d1f0fb..08f79d46 100644 --- a/src/main/java/org/ldk/structs/ErrorAction.java +++ b/src/main/java/org/ldk/structs/ErrorAction.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Used to put an error message in a LightningError + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ErrorAction extends CommonBase { private ErrorAction(Object _dummy, long ptr) { super(ptr); } diff --git a/src/main/java/org/ldk/structs/ErrorMessage.java b/src/main/java/org/ldk/structs/ErrorMessage.java index 8e1f30dd..bf512b9a 100644 --- a/src/main/java/org/ldk/structs/ErrorMessage.java +++ b/src/main/java/org/ldk/structs/ErrorMessage.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An error message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ErrorMessage extends CommonBase { ErrorMessage(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,45 @@ public class ErrorMessage extends CommonBase { if (ptr != 0) { bindings.ErrorMessage_free(ptr); } } + /** + * The channel ID involved in the error + */ public byte[] get_channel_id() { byte[] ret = bindings.ErrorMessage_get_channel_id(this.ptr); return ret; } + /** + * The channel ID involved in the error + */ public void set_channel_id(byte[] val) { bindings.ErrorMessage_set_channel_id(this.ptr, val); } + /** + * A possibly human-readable error description. + * The string should be sanitized before it is used (e.g. emitted to logs + * or printed to stdout). Otherwise, a well crafted error message may trigger a security + * vulnerability in the terminal emulator or the logging subsystem. + */ public String get_data() { String ret = bindings.ErrorMessage_get_data(this.ptr); return ret; } + /** + * A possibly human-readable error description. + * The string should be sanitized before it is used (e.g. emitted to logs + * or printed to stdout). Otherwise, a well crafted error message may trigger a security + * vulnerability in the terminal emulator or the logging subsystem. + */ public void set_data(byte[] val) { bindings.ErrorMessage_set_data(this.ptr, val); } + /** + * Constructs a new ErrorMessage given each field + */ public static ErrorMessage constructor_new(byte[] channel_id_arg, byte[] data_arg) { long ret = bindings.ErrorMessage_new(channel_id_arg, data_arg); ErrorMessage ret_hu_conv = new ErrorMessage(null, ret); @@ -39,6 +64,9 @@ public class ErrorMessage extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ErrorMessage + */ public ErrorMessage clone() { long ret = bindings.ErrorMessage_clone(this.ptr); ErrorMessage ret_hu_conv = new ErrorMessage(null, ret); @@ -46,11 +74,17 @@ public class ErrorMessage extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read + */ public byte[] write() { byte[] ret = bindings.ErrorMessage_write(this.ptr); return ret; } + /** + * Read a ErrorMessage from a byte array, created by ErrorMessage_write + */ public static Result_ErrorMessageDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ErrorMessage_read(ser); Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/ErroringMessageHandler.java b/src/main/java/org/ldk/structs/ErroringMessageHandler.java index 3b8ce070..2bb111f4 100644 --- a/src/main/java/org/ldk/structs/ErroringMessageHandler.java +++ b/src/main/java/org/ldk/structs/ErroringMessageHandler.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A dummy struct which implements `ChannelMessageHandler` without having any channels. + * You can provide one of these as the route_handler in a MessageHandler. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ErroringMessageHandler extends CommonBase { ErroringMessageHandler(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +19,9 @@ public class ErroringMessageHandler extends CommonBase { if (ptr != 0) { bindings.ErroringMessageHandler_free(ptr); } } + /** + * Constructs a new ErroringMessageHandler + */ public static ErroringMessageHandler constructor_new() { long ret = bindings.ErroringMessageHandler_new(); ErroringMessageHandler ret_hu_conv = new ErroringMessageHandler(null, ret); @@ -21,6 +29,10 @@ public class ErroringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is + */ public MessageSendEventsProvider as_MessageSendEventsProvider() { long ret = bindings.ErroringMessageHandler_as_MessageSendEventsProvider(this.ptr); MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret); @@ -28,6 +40,10 @@ public class ErroringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is + */ public ChannelMessageHandler as_ChannelMessageHandler() { long ret = bindings.ErroringMessageHandler_as_ChannelMessageHandler(this.ptr); ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret); diff --git a/src/main/java/org/ldk/structs/Event.java b/src/main/java/org/ldk/structs/Event.java index abc24cec..163c7a97 100644 --- a/src/main/java/org/ldk/structs/Event.java +++ b/src/main/java/org/ldk/structs/Event.java @@ -5,6 +5,14 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An Event which you should probably take some action in response to. + * + * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use + * them directly as they don't round-trip exactly (for example FundingGenerationReady is never + * written as it makes no sense to respond to it after reconnecting to peers). + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Event extends CommonBase { private Event(Object _dummy, long ptr) { super(ptr); } diff --git a/src/main/java/org/ldk/structs/EventsProvider.java b/src/main/java/org/ldk/structs/EventsProvider.java index 7bcb3367..83714020 100644 --- a/src/main/java/org/ldk/structs/EventsProvider.java +++ b/src/main/java/org/ldk/structs/EventsProvider.java @@ -5,6 +5,9 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * A trait indicating an object may generate events + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class EventsProvider extends CommonBase { final bindings.LDKEventsProvider bindings_instance; @@ -20,6 +23,10 @@ public class EventsProvider extends CommonBase { } public static interface EventsProviderInterface { + /** + * Gets the list of pending events which were generated by previous actions, clearing the list + * in the process. + */ Event[] get_and_clear_pending_events(); } private static class LDKEventsProviderHolder { EventsProvider held; } @@ -35,6 +42,10 @@ public class EventsProvider extends CommonBase { }); return impl_holder.held; } + /** + * Gets the list of pending events which were generated by previous actions, clearing the list + * in the process. + */ public Event[] get_and_clear_pending_events() { long[] ret = bindings.EventsProvider_get_and_clear_pending_events(this.ptr); Event[] ret_conv_7_arr = new Event[ret.length]; diff --git a/src/main/java/org/ldk/structs/FeeEstimator.java b/src/main/java/org/ldk/structs/FeeEstimator.java index 910edae7..3e247df2 100644 --- a/src/main/java/org/ldk/structs/FeeEstimator.java +++ b/src/main/java/org/ldk/structs/FeeEstimator.java @@ -5,6 +5,13 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * A trait which should be implemented to provide feerate information on a number of time + * horizons. + * + * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're + * called from inside the library in response to chain events, P2P events, or timer events). + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class FeeEstimator extends CommonBase { final bindings.LDKFeeEstimator bindings_instance; @@ -20,6 +27,16 @@ public class FeeEstimator extends CommonBase { } public static interface FeeEstimatorInterface { + /** + * Gets estimated satoshis of fee required per 1000 Weight-Units. + * + * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs + * don't put us below 1 satoshi-per-byte). + * + * This translates to: + * satoshis-per-byte * 250 + * ceil(satoshis-per-kbyte / 4) + */ int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target); } private static class LDKFeeEstimatorHolder { FeeEstimator held; } @@ -33,6 +50,16 @@ public class FeeEstimator extends CommonBase { }); return impl_holder.held; } + /** + * Gets estimated satoshis of fee required per 1000 Weight-Units. + * + * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs + * don't put us below 1 satoshi-per-byte). + * + * This translates to: + * satoshis-per-byte * 250 + * ceil(satoshis-per-kbyte / 4) + */ public int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target) { int ret = bindings.FeeEstimator_get_est_sat_per_1000_weight(this.ptr, confirmation_target); return ret; diff --git a/src/main/java/org/ldk/structs/Filter.java b/src/main/java/org/ldk/structs/Filter.java index 64882310..092c6561 100644 --- a/src/main/java/org/ldk/structs/Filter.java +++ b/src/main/java/org/ldk/structs/Filter.java @@ -5,6 +5,29 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to + * channels. + * + * This is useful in order to have a [`Watch`] implementation convey to a chain source which + * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in + * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If + * receiving full blocks from a chain source, any further filtering is unnecessary. + * + * After an output has been registered, subsequent block retrievals from the chain source must not + * exclude any transactions matching the new criteria nor any in-block descendants of such + * transactions. + * + * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter` + * should not block on I/O. Implementations should instead queue the newly monitored data to be + * processed later. Then, in order to block until the data has been processed, any `Watch` + * invocation that has called the `Filter` must return [`TemporaryFailure`]. + * + * [`Watch`]: trait.Watch.html + * [`TemporaryFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.TemporaryFailure + * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki + * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Filter extends CommonBase { final bindings.LDKFilter bindings_instance; @@ -20,7 +43,15 @@ public class Filter extends CommonBase { } public static interface FilterInterface { + /** + * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as + * a spending condition. + */ void register_tx(byte[] txid, byte[] script_pubkey); + /** + * Registers interest in spends of a transaction output identified by `outpoint` having + * `script_pubkey` as the spending condition. + */ void register_output(OutPoint outpoint, byte[] script_pubkey); } private static class LDKFilterHolder { Filter held; } @@ -37,10 +68,18 @@ public class Filter extends CommonBase { }); return impl_holder.held; } + /** + * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as + * a spending condition. + */ public void register_tx(byte[] txid, byte[] script_pubkey) { bindings.Filter_register_tx(this.ptr, txid, script_pubkey); } + /** + * Registers interest in spends of a transaction output identified by `outpoint` having + * `script_pubkey` as the spending condition. + */ public void register_output(OutPoint outpoint, byte[] script_pubkey) { bindings.Filter_register_output(this.ptr, outpoint == null ? 0 : outpoint.ptr & ~1, script_pubkey); this.ptrs_to.add(outpoint); diff --git a/src/main/java/org/ldk/structs/FundingCreated.java b/src/main/java/org/ldk/structs/FundingCreated.java index c6388db5..6faf150f 100644 --- a/src/main/java/org/ldk/structs/FundingCreated.java +++ b/src/main/java/org/ldk/structs/FundingCreated.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A funding_created message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class FundingCreated extends CommonBase { FundingCreated(Object _dummy, long ptr) { super(ptr); } @@ -14,42 +18,69 @@ public class FundingCreated extends CommonBase { if (ptr != 0) { bindings.FundingCreated_free(ptr); } } + /** + * A temporary channel ID, until the funding is established + */ public byte[] get_temporary_channel_id() { byte[] ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr); return ret; } + /** + * A temporary channel ID, until the funding is established + */ public void set_temporary_channel_id(byte[] val) { bindings.FundingCreated_set_temporary_channel_id(this.ptr, val); } + /** + * The funding transaction ID + */ public byte[] get_funding_txid() { byte[] ret = bindings.FundingCreated_get_funding_txid(this.ptr); return ret; } + /** + * The funding transaction ID + */ public void set_funding_txid(byte[] val) { bindings.FundingCreated_set_funding_txid(this.ptr, val); } + /** + * The specific output index funding this channel + */ public short get_funding_output_index() { short ret = bindings.FundingCreated_get_funding_output_index(this.ptr); return ret; } + /** + * The specific output index funding this channel + */ public void set_funding_output_index(short val) { bindings.FundingCreated_set_funding_output_index(this.ptr, val); } + /** + * The signature of the channel initiator (funder) on the funding transaction + */ public byte[] get_signature() { byte[] ret = bindings.FundingCreated_get_signature(this.ptr); return ret; } + /** + * The signature of the channel initiator (funder) on the funding transaction + */ public void set_signature(byte[] val) { bindings.FundingCreated_set_signature(this.ptr, val); } + /** + * Constructs a new FundingCreated given each field + */ public static FundingCreated constructor_new(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) { long ret = bindings.FundingCreated_new(temporary_channel_id_arg, funding_txid_arg, funding_output_index_arg, signature_arg); FundingCreated ret_hu_conv = new FundingCreated(null, ret); @@ -57,6 +88,9 @@ public class FundingCreated extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the FundingCreated + */ public FundingCreated clone() { long ret = bindings.FundingCreated_clone(this.ptr); FundingCreated ret_hu_conv = new FundingCreated(null, ret); @@ -64,11 +98,17 @@ public class FundingCreated extends CommonBase { return ret_hu_conv; } + /** + * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read + */ public byte[] write() { byte[] ret = bindings.FundingCreated_write(this.ptr); return ret; } + /** + * Read a FundingCreated from a byte array, created by FundingCreated_write + */ public static Result_FundingCreatedDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.FundingCreated_read(ser); Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/FundingLocked.java b/src/main/java/org/ldk/structs/FundingLocked.java index 0462f1a0..0b8188c1 100644 --- a/src/main/java/org/ldk/structs/FundingLocked.java +++ b/src/main/java/org/ldk/structs/FundingLocked.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A funding_locked message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class FundingLocked extends CommonBase { FundingLocked(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,39 @@ public class FundingLocked extends CommonBase { if (ptr != 0) { bindings.FundingLocked_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.FundingLocked_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.FundingLocked_set_channel_id(this.ptr, val); } + /** + * The per-commitment point of the second commitment transaction + */ public byte[] get_next_per_commitment_point() { byte[] ret = bindings.FundingLocked_get_next_per_commitment_point(this.ptr); return ret; } + /** + * The per-commitment point of the second commitment transaction + */ public void set_next_per_commitment_point(byte[] val) { bindings.FundingLocked_set_next_per_commitment_point(this.ptr, val); } + /** + * Constructs a new FundingLocked given each field + */ public static FundingLocked constructor_new(byte[] channel_id_arg, byte[] next_per_commitment_point_arg) { long ret = bindings.FundingLocked_new(channel_id_arg, next_per_commitment_point_arg); FundingLocked ret_hu_conv = new FundingLocked(null, ret); @@ -39,6 +58,9 @@ public class FundingLocked extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the FundingLocked + */ public FundingLocked clone() { long ret = bindings.FundingLocked_clone(this.ptr); FundingLocked ret_hu_conv = new FundingLocked(null, ret); @@ -46,11 +68,17 @@ public class FundingLocked extends CommonBase { return ret_hu_conv; } + /** + * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read + */ public byte[] write() { byte[] ret = bindings.FundingLocked_write(this.ptr); return ret; } + /** + * Read a FundingLocked from a byte array, created by FundingLocked_write + */ public static Result_FundingLockedDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.FundingLocked_read(ser); Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/FundingSigned.java b/src/main/java/org/ldk/structs/FundingSigned.java index e4241d92..037a9c17 100644 --- a/src/main/java/org/ldk/structs/FundingSigned.java +++ b/src/main/java/org/ldk/structs/FundingSigned.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A funding_signed message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class FundingSigned extends CommonBase { FundingSigned(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,39 @@ public class FundingSigned extends CommonBase { if (ptr != 0) { bindings.FundingSigned_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.FundingSigned_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.FundingSigned_set_channel_id(this.ptr, val); } + /** + * The signature of the channel acceptor (fundee) on the funding transaction + */ public byte[] get_signature() { byte[] ret = bindings.FundingSigned_get_signature(this.ptr); return ret; } + /** + * The signature of the channel acceptor (fundee) on the funding transaction + */ public void set_signature(byte[] val) { bindings.FundingSigned_set_signature(this.ptr, val); } + /** + * Constructs a new FundingSigned given each field + */ public static FundingSigned constructor_new(byte[] channel_id_arg, byte[] signature_arg) { long ret = bindings.FundingSigned_new(channel_id_arg, signature_arg); FundingSigned ret_hu_conv = new FundingSigned(null, ret); @@ -39,6 +58,9 @@ public class FundingSigned extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the FundingSigned + */ public FundingSigned clone() { long ret = bindings.FundingSigned_clone(this.ptr); FundingSigned ret_hu_conv = new FundingSigned(null, ret); @@ -46,11 +68,17 @@ public class FundingSigned extends CommonBase { return ret_hu_conv; } + /** + * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read + */ public byte[] write() { byte[] ret = bindings.FundingSigned_write(this.ptr); return ret; } + /** + * Read a FundingSigned from a byte array, created by FundingSigned_write + */ public static Result_FundingSignedDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.FundingSigned_read(ser); Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/GossipTimestampFilter.java b/src/main/java/org/ldk/structs/GossipTimestampFilter.java index 7f935692..f63dbdd3 100644 --- a/src/main/java/org/ldk/structs/GossipTimestampFilter.java +++ b/src/main/java/org/ldk/structs/GossipTimestampFilter.java @@ -5,6 +5,12 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A gossip_timestamp_filter message is used by a node to request + * gossip relay for messages in the requested time range when the + * gossip_queries feature has been negotiated. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class GossipTimestampFilter extends CommonBase { GossipTimestampFilter(Object _dummy, long ptr) { super(ptr); } @@ -14,33 +20,54 @@ public class GossipTimestampFilter extends CommonBase { if (ptr != 0) { bindings.GossipTimestampFilter_free(ptr); } } + /** + * The genesis hash of the blockchain for channel and node information + */ public byte[] get_chain_hash() { byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this.ptr); return ret; } + /** + * The genesis hash of the blockchain for channel and node information + */ public void set_chain_hash(byte[] val) { bindings.GossipTimestampFilter_set_chain_hash(this.ptr, val); } + /** + * The starting unix timestamp + */ public int get_first_timestamp() { int ret = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr); return ret; } + /** + * The starting unix timestamp + */ public void set_first_timestamp(int val) { bindings.GossipTimestampFilter_set_first_timestamp(this.ptr, val); } + /** + * The range of information in seconds + */ public int get_timestamp_range() { int ret = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr); return ret; } + /** + * The range of information in seconds + */ public void set_timestamp_range(int val) { bindings.GossipTimestampFilter_set_timestamp_range(this.ptr, val); } + /** + * Constructs a new GossipTimestampFilter given each field + */ public static GossipTimestampFilter constructor_new(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) { long ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg); GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); @@ -48,6 +75,9 @@ public class GossipTimestampFilter extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the GossipTimestampFilter + */ public GossipTimestampFilter clone() { long ret = bindings.GossipTimestampFilter_clone(this.ptr); GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); @@ -55,12 +85,18 @@ public class GossipTimestampFilter extends CommonBase { return ret_hu_conv; } + /** + * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write + */ public static Result_GossipTimestampFilterDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.GossipTimestampFilter_read(ser); Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read + */ public byte[] write() { byte[] ret = bindings.GossipTimestampFilter_write(this.ptr); return ret; diff --git a/src/main/java/org/ldk/structs/HTLCFailChannelUpdate.java b/src/main/java/org/ldk/structs/HTLCFailChannelUpdate.java index a9352937..86388930 100644 --- a/src/main/java/org/ldk/structs/HTLCFailChannelUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCFailChannelUpdate.java @@ -5,6 +5,12 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * The information we received from a peer along the route of a payment we originated. This is + * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into + * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class HTLCFailChannelUpdate extends CommonBase { private HTLCFailChannelUpdate(Object _dummy, long ptr) { super(ptr); } diff --git a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java index ea8dd2cb..0f47affa 100644 --- a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java +++ b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Information about an HTLC as it appears in a commitment transaction + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class HTLCOutputInCommitment extends CommonBase { HTLCOutputInCommitment(Object _dummy, long ptr) { super(ptr); } @@ -14,42 +18,77 @@ public class HTLCOutputInCommitment extends CommonBase { if (ptr != 0) { bindings.HTLCOutputInCommitment_free(ptr); } } + /** + * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction). + * Note that this is not the same as whether it is ountbound *from us*. To determine that you + * need to compare this value to whether the commitment transaction in question is that of + * the counterparty or our own. + */ public boolean get_offered() { boolean ret = bindings.HTLCOutputInCommitment_get_offered(this.ptr); return ret; } + /** + * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction). + * Note that this is not the same as whether it is ountbound *from us*. To determine that you + * need to compare this value to whether the commitment transaction in question is that of + * the counterparty or our own. + */ public void set_offered(boolean val) { bindings.HTLCOutputInCommitment_set_offered(this.ptr, val); } + /** + * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is + * this divided by 1000. + */ public long get_amount_msat() { long ret = bindings.HTLCOutputInCommitment_get_amount_msat(this.ptr); return ret; } + /** + * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is + * this divided by 1000. + */ public void set_amount_msat(long val) { bindings.HTLCOutputInCommitment_set_amount_msat(this.ptr, val); } + /** + * The CLTV lock-time at which this HTLC expires. + */ public int get_cltv_expiry() { int ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this.ptr); return ret; } + /** + * The CLTV lock-time at which this HTLC expires. + */ public void set_cltv_expiry(int val) { bindings.HTLCOutputInCommitment_set_cltv_expiry(this.ptr, val); } + /** + * The hash of the preimage which unlocks this HTLC. + */ public byte[] get_payment_hash() { byte[] ret = bindings.HTLCOutputInCommitment_get_payment_hash(this.ptr); return ret; } + /** + * The hash of the preimage which unlocks this HTLC. + */ public void set_payment_hash(byte[] val) { bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val); } + /** + * Creates a copy of the HTLCOutputInCommitment + */ public HTLCOutputInCommitment clone() { long ret = bindings.HTLCOutputInCommitment_clone(this.ptr); HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret); @@ -57,11 +96,17 @@ public class HTLCOutputInCommitment extends CommonBase { return ret_hu_conv; } + /** + * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read + */ public byte[] write() { byte[] ret = bindings.HTLCOutputInCommitment_write(this.ptr); return ret; } + /** + * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write + */ public static Result_HTLCOutputInCommitmentDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.HTLCOutputInCommitment_read(ser); Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/HTLCUpdate.java b/src/main/java/org/ldk/structs/HTLCUpdate.java index 57f94ec2..5951ab2e 100644 --- a/src/main/java/org/ldk/structs/HTLCUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCUpdate.java @@ -5,6 +5,14 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on + * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the + * preimage claim backward will lead to loss of funds. + * + * [`chain::Watch`]: ../trait.Watch.html + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class HTLCUpdate extends CommonBase { HTLCUpdate(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +22,9 @@ public class HTLCUpdate extends CommonBase { if (ptr != 0) { bindings.HTLCUpdate_free(ptr); } } + /** + * Creates a copy of the HTLCUpdate + */ public HTLCUpdate clone() { long ret = bindings.HTLCUpdate_clone(this.ptr); HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); @@ -21,11 +32,17 @@ public class HTLCUpdate extends CommonBase { return ret_hu_conv; } + /** + * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read + */ public byte[] write() { byte[] ret = bindings.HTLCUpdate_write(this.ptr); return ret; } + /** + * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write + */ public static Result_HTLCUpdateDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.HTLCUpdate_read(ser); Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java index 2ca98f51..455c1ed2 100644 --- a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java @@ -5,6 +5,12 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Information needed to build and sign a holder's commitment transaction. + * + * The transaction is only signed once we are ready to broadcast. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class HolderCommitmentTransaction extends CommonBase { HolderCommitmentTransaction(Object _dummy, long ptr) { super(ptr); } @@ -14,19 +20,31 @@ public class HolderCommitmentTransaction extends CommonBase { if (ptr != 0) { bindings.HolderCommitmentTransaction_free(ptr); } } + /** + * Our counterparty's signature for the transaction + */ public byte[] get_counterparty_sig() { byte[] ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr); return ret; } + /** + * Our counterparty's signature for the transaction + */ public void set_counterparty_sig(byte[] val) { bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, val); } + /** + * All non-dust counterparty HTLC signatures, in the order they appear in the transaction + */ public void set_counterparty_htlc_sigs(byte[][] val) { bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val); } + /** + * Creates a copy of the HolderCommitmentTransaction + */ public HolderCommitmentTransaction clone() { long ret = bindings.HolderCommitmentTransaction_clone(this.ptr); HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret); @@ -34,17 +52,27 @@ public class HolderCommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read + */ public byte[] write() { byte[] ret = bindings.HolderCommitmentTransaction_write(this.ptr); return ret; } + /** + * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write + */ public static Result_HolderCommitmentTransactionDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.HolderCommitmentTransaction_read(ser); Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Create a new holder transaction with the given counterparty signatures. + * The funding keys are used to figure out which signature should go first when building the transaction for broadcast. + */ 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); diff --git a/src/main/java/org/ldk/structs/IgnoringMessageHandler.java b/src/main/java/org/ldk/structs/IgnoringMessageHandler.java index 65ca6c6f..d1cc45a0 100644 --- a/src/main/java/org/ldk/structs/IgnoringMessageHandler.java +++ b/src/main/java/org/ldk/structs/IgnoringMessageHandler.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A dummy struct which implements `RoutingMessageHandler` without storing any routing information + * or doing any processing. You can provide one of these as the route_handler in a MessageHandler. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class IgnoringMessageHandler extends CommonBase { IgnoringMessageHandler(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +19,9 @@ public class IgnoringMessageHandler extends CommonBase { if (ptr != 0) { bindings.IgnoringMessageHandler_free(ptr); } } + /** + * Constructs a new IgnoringMessageHandler given each field + */ public static IgnoringMessageHandler constructor_new() { long ret = bindings.IgnoringMessageHandler_new(); IgnoringMessageHandler ret_hu_conv = new IgnoringMessageHandler(null, ret); @@ -21,6 +29,10 @@ public class IgnoringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is + */ public MessageSendEventsProvider as_MessageSendEventsProvider() { long ret = bindings.IgnoringMessageHandler_as_MessageSendEventsProvider(this.ptr); MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret); @@ -28,6 +40,10 @@ public class IgnoringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is + */ public RoutingMessageHandler as_RoutingMessageHandler() { long ret = bindings.IgnoringMessageHandler_as_RoutingMessageHandler(this.ptr); RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret); diff --git a/src/main/java/org/ldk/structs/InMemorySigner.java b/src/main/java/org/ldk/structs/InMemorySigner.java index 5bf7ca9b..d3bf409e 100644 --- a/src/main/java/org/ldk/structs/InMemorySigner.java +++ b/src/main/java/org/ldk/structs/InMemorySigner.java @@ -5,6 +5,13 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A simple implementation of Sign that just keeps the private keys in memory. + * + * This implementation performs no policy checks and is insufficient by itself as + * a secure external signer. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class InMemorySigner extends CommonBase { InMemorySigner(Object _dummy, long ptr) { super(ptr); } @@ -14,60 +21,99 @@ public class InMemorySigner extends CommonBase { if (ptr != 0) { bindings.InMemorySigner_free(ptr); } } + /** + * Private key of anchor tx + */ public byte[] get_funding_key() { byte[] ret = bindings.InMemorySigner_get_funding_key(this.ptr); return ret; } + /** + * Private key of anchor tx + */ public void set_funding_key(byte[] val) { bindings.InMemorySigner_set_funding_key(this.ptr, val); } + /** + * Holder secret key for blinded revocation pubkey + */ public byte[] get_revocation_base_key() { byte[] ret = bindings.InMemorySigner_get_revocation_base_key(this.ptr); return ret; } + /** + * Holder secret key for blinded revocation pubkey + */ public void set_revocation_base_key(byte[] val) { bindings.InMemorySigner_set_revocation_base_key(this.ptr, val); } + /** + * Holder secret key used for our balance in counterparty-broadcasted commitment transactions + */ public byte[] get_payment_key() { byte[] ret = bindings.InMemorySigner_get_payment_key(this.ptr); return ret; } + /** + * Holder secret key used for our balance in counterparty-broadcasted commitment transactions + */ public void set_payment_key(byte[] val) { bindings.InMemorySigner_set_payment_key(this.ptr, val); } + /** + * Holder secret key used in HTLC tx + */ public byte[] get_delayed_payment_base_key() { byte[] ret = bindings.InMemorySigner_get_delayed_payment_base_key(this.ptr); return ret; } + /** + * Holder secret key used in HTLC tx + */ public void set_delayed_payment_base_key(byte[] val) { bindings.InMemorySigner_set_delayed_payment_base_key(this.ptr, val); } + /** + * Holder htlc secret key used in commitment tx htlc outputs + */ public byte[] get_htlc_base_key() { byte[] ret = bindings.InMemorySigner_get_htlc_base_key(this.ptr); return ret; } + /** + * Holder htlc secret key used in commitment tx htlc outputs + */ public void set_htlc_base_key(byte[] val) { bindings.InMemorySigner_set_htlc_base_key(this.ptr, val); } + /** + * Commitment seed + */ public byte[] get_commitment_seed() { byte[] ret = bindings.InMemorySigner_get_commitment_seed(this.ptr); return ret; } + /** + * Commitment seed + */ public void set_commitment_seed(byte[] val) { bindings.InMemorySigner_set_commitment_seed(this.ptr, val); } + /** + * Creates a copy of the InMemorySigner + */ public InMemorySigner clone() { long ret = bindings.InMemorySigner_clone(this.ptr); InMemorySigner ret_hu_conv = new InMemorySigner(null, ret); @@ -75,6 +121,9 @@ public class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Create a new InMemorySigner + */ public static InMemorySigner constructor_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, byte[] channel_keys_id) { long ret = bindings.InMemorySigner_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, channel_keys_id); InMemorySigner ret_hu_conv = new InMemorySigner(null, ret); @@ -82,6 +131,10 @@ public class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Counterparty pubkeys. + * Will panic if ready_channel wasn't called. + */ public ChannelPublicKeys counterparty_pubkeys() { long ret = bindings.InMemorySigner_counterparty_pubkeys(this.ptr); ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); @@ -89,21 +142,41 @@ public class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * The contest_delay value specified by our counterparty and applied on holder-broadcastable + * transactions, ie the amount of time that we have to wait to recover our funds if we + * broadcast a transaction. + * Will panic if ready_channel wasn't called. + */ public short counterparty_selected_contest_delay() { short ret = bindings.InMemorySigner_counterparty_selected_contest_delay(this.ptr); return ret; } + /** + * The contest_delay value specified by us and applied on transactions broadcastable + * by our counterparty, ie the amount of time that they have to wait to recover their funds + * if they broadcast a transaction. + * Will panic if ready_channel wasn't called. + */ public short holder_selected_contest_delay() { short ret = bindings.InMemorySigner_holder_selected_contest_delay(this.ptr); return ret; } + /** + * Whether the holder is the initiator + * Will panic if ready_channel wasn't called. + */ public boolean is_outbound() { boolean ret = bindings.InMemorySigner_is_outbound(this.ptr); return ret; } + /** + * Funding outpoint + * Will panic if ready_channel wasn't called. + */ public OutPoint funding_outpoint() { long ret = bindings.InMemorySigner_funding_outpoint(this.ptr); OutPoint ret_hu_conv = new OutPoint(null, ret); @@ -111,6 +184,12 @@ public class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or + * building transactions. + * + * Will panic if ready_channel wasn't called. + */ public ChannelTransactionParameters get_channel_parameters() { long ret = bindings.InMemorySigner_get_channel_parameters(this.ptr); ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); @@ -118,6 +197,13 @@ public class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Sign the single input of spend_tx at index `input_idx` which spends the output + * described by descriptor, returning the witness stack for the input. + * + * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig, + * or is not spending the outpoint described by `descriptor.outpoint`. + */ public Result_CVec_CVec_u8ZZNoneZ sign_counterparty_payment_input(byte[] spend_tx, long input_idx, StaticPaymentOutputDescriptor descriptor) { long ret = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1); Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); @@ -125,6 +211,14 @@ public class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Sign the single input of spend_tx at index `input_idx` which spends the output + * described by descriptor, returning the witness stack for the input. + * + * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig, + * is not spending the outpoint described by `descriptor.outpoint`, or does not have a + * sequence set to `descriptor.to_self_delay`. + */ public Result_CVec_CVec_u8ZZNoneZ sign_dynamic_p2wsh_input(byte[] spend_tx, long input_idx, DelayedPaymentOutputDescriptor descriptor) { long ret = bindings.InMemorySigner_sign_dynamic_p2wsh_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1); Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); @@ -132,6 +226,10 @@ public class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new Sign which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is + */ public Sign as_Sign() { long ret = bindings.InMemorySigner_as_Sign(this.ptr); Sign ret_hu_conv = new Sign(null, ret); @@ -139,11 +237,17 @@ public class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read + */ public byte[] write() { byte[] ret = bindings.InMemorySigner_write(this.ptr); return ret; } + /** + * Read a InMemorySigner from a byte array, created by InMemorySigner_write + */ public static Result_InMemorySignerDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.InMemorySigner_read(ser); Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/Init.java b/src/main/java/org/ldk/structs/Init.java index 867b1ab9..78b0c502 100644 --- a/src/main/java/org/ldk/structs/Init.java +++ b/src/main/java/org/ldk/structs/Init.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An init message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Init extends CommonBase { Init(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,9 @@ public class Init extends CommonBase { if (ptr != 0) { bindings.Init_free(ptr); } } + /** + * The relevant features which the sender supports + */ public InitFeatures get_features() { long ret = bindings.Init_get_features(this.ptr); InitFeatures ret_hu_conv = new InitFeatures(null, ret); @@ -21,11 +28,17 @@ public class Init extends CommonBase { return ret_hu_conv; } + /** + * The relevant features which the sender supports + */ public void set_features(InitFeatures val) { bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Constructs a new Init given each field + */ public static Init constructor_new(InitFeatures features_arg) { long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr & ~1); Init ret_hu_conv = new Init(null, ret); @@ -34,6 +47,9 @@ public class Init extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the Init + */ public Init clone() { long ret = bindings.Init_clone(this.ptr); Init ret_hu_conv = new Init(null, ret); @@ -41,11 +57,17 @@ public class Init extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Init object into a byte array which can be read by Init_read + */ public byte[] write() { byte[] ret = bindings.Init_write(this.ptr); return ret; } + /** + * Read a Init from a byte array, created by Init_write + */ public static Result_InitDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.Init_read(ser); Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/InitFeatures.java b/src/main/java/org/ldk/structs/InitFeatures.java index 2ab513ac..38195c91 100644 --- a/src/main/java/org/ldk/structs/InitFeatures.java +++ b/src/main/java/org/ldk/structs/InitFeatures.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Features used within an `init` message. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class InitFeatures extends CommonBase { InitFeatures(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,9 @@ public class InitFeatures extends CommonBase { if (ptr != 0) { bindings.InitFeatures_free(ptr); } } + /** + * Creates a copy of the InitFeatures + */ public InitFeatures clone() { long ret = bindings.InitFeatures_clone(this.ptr); InitFeatures ret_hu_conv = new InitFeatures(null, ret); @@ -21,6 +28,9 @@ public class InitFeatures extends CommonBase { return ret_hu_conv; } + /** + * Create a blank Features with no features set + */ public static InitFeatures constructor_empty() { long ret = bindings.InitFeatures_empty(); InitFeatures ret_hu_conv = new InitFeatures(null, ret); @@ -28,6 +38,11 @@ public class InitFeatures extends CommonBase { return ret_hu_conv; } + /** + * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. + * + * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS + */ public static InitFeatures constructor_known() { long ret = bindings.InitFeatures_known(); InitFeatures ret_hu_conv = new InitFeatures(null, ret); @@ -35,11 +50,17 @@ public class InitFeatures extends CommonBase { return ret_hu_conv; } + /** + * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read + */ public byte[] write() { byte[] ret = bindings.InitFeatures_write(this.ptr); return ret; } + /** + * Read a InitFeatures from a byte array, created by InitFeatures_write + */ public static Result_InitFeaturesDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.InitFeatures_read(ser); Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/KeysInterface.java b/src/main/java/org/ldk/structs/KeysInterface.java index d3463631..bbb5df98 100644 --- a/src/main/java/org/ldk/structs/KeysInterface.java +++ b/src/main/java/org/ldk/structs/KeysInterface.java @@ -5,6 +5,9 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * A trait to describe an object which can get user secrets and key material. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class KeysInterface extends CommonBase { final bindings.LDKKeysInterface bindings_instance; @@ -20,11 +23,50 @@ public class KeysInterface extends CommonBase { } public static interface KeysInterfaceInterface { + /** + * Get node secret key (aka node_id or network_key). + * + * This method must return the same value each time it is called. + */ byte[] get_node_secret(); + /** + * Get a script pubkey which we send funds to when claiming on-chain contestable outputs. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ byte[] get_destination_script(); + /** + * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing + * a channel. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ byte[] get_shutdown_pubkey(); + /** + * Get a new set of Sign for per-channel secrets. These MUST be unique even if you + * restarted with some stale data! + * + * This method must return a different value each time it is called. + */ Sign get_channel_signer(boolean inbound, long channel_value_satoshis); + /** + * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting + * onion packets and for temporary channel IDs. There is no requirement that these be + * persisted anywhere, though they must be unique across restarts. + * + * This method must return a different value each time it is called. + */ byte[] get_secure_random_bytes(); + /** + * Reads a `Signer` for this `KeysInterface` from the given input stream. + * This is only called during deserialization of other objects which contain + * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s). + * The bytes are exactly those which `::write()` writes, and + * contain no versioning scheme. You may wish to include your own version prefix and ensure + * you've read all of the provided bytes to ensure no corruption occurred. + */ Result_SignDecodeErrorZ read_chan_signer(byte[] reader); } private static class LDKKeysInterfaceHolder { KeysInterface held; } @@ -61,21 +103,45 @@ public class KeysInterface extends CommonBase { }); return impl_holder.held; } + /** + * Get node secret key (aka node_id or network_key). + * + * This method must return the same value each time it is called. + */ public byte[] get_node_secret() { byte[] ret = bindings.KeysInterface_get_node_secret(this.ptr); return ret; } + /** + * Get a script pubkey which we send funds to when claiming on-chain contestable outputs. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ public byte[] get_destination_script() { byte[] ret = bindings.KeysInterface_get_destination_script(this.ptr); return ret; } + /** + * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing + * a channel. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ public byte[] get_shutdown_pubkey() { byte[] ret = bindings.KeysInterface_get_shutdown_pubkey(this.ptr); return ret; } + /** + * Get a new set of Sign for per-channel secrets. These MUST be unique even if you + * restarted with some stale data! + * + * This method must return a different value each time it is called. + */ public Sign get_channel_signer(boolean inbound, long channel_value_satoshis) { long ret = bindings.KeysInterface_get_channel_signer(this.ptr, inbound, channel_value_satoshis); Sign ret_hu_conv = new Sign(null, ret); @@ -83,11 +149,26 @@ public class KeysInterface extends CommonBase { return ret_hu_conv; } + /** + * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting + * onion packets and for temporary channel IDs. There is no requirement that these be + * persisted anywhere, though they must be unique across restarts. + * + * This method must return a different value each time it is called. + */ public byte[] get_secure_random_bytes() { byte[] ret = bindings.KeysInterface_get_secure_random_bytes(this.ptr); return ret; } + /** + * Reads a `Signer` for this `KeysInterface` from the given input stream. + * This is only called during deserialization of other objects which contain + * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s). + * The bytes are exactly those which `::write()` writes, and + * contain no versioning scheme. You may wish to include your own version prefix and ensure + * you've read all of the provided bytes to ensure no corruption occurred. + */ public Result_SignDecodeErrorZ read_chan_signer(byte[] reader) { long ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader); Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/KeysManager.java b/src/main/java/org/ldk/structs/KeysManager.java index c0c4cfe6..d9dfdf14 100644 --- a/src/main/java/org/ldk/structs/KeysManager.java +++ b/src/main/java/org/ldk/structs/KeysManager.java @@ -5,6 +5,16 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key + * and derives keys from that. + * + * Your node_id is seed/0' + * ChannelMonitor closes may use seed/1' + * Cooperative closes may use seed/2' + * The two close keys may be needed to claim on-chain funds! + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class KeysManager extends CommonBase { KeysManager(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +24,27 @@ public class KeysManager extends CommonBase { if (ptr != 0) { bindings.KeysManager_free(ptr); } } + /** + * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your + * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds). + * starting_time isn't strictly required to actually be a time, but it must absolutely, + * without a doubt, be unique to this instance. ie if you start multiple times with the same + * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to + * simply use the current time (with very high precision). + * + * The seed MUST be backed up safely prior to use so that the keys can be re-created, however, + * obviously, starting_time should be unique every time you reload the library - it is only + * used to generate new ephemeral key data (which will be stored by the individual channel if + * necessary). + * + * Note that the seed is required to recover certain on-chain funds independent of + * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any + * channel, and some on-chain during-closing funds. + * + * Note that until the 0.1 release there is no guarantee of backward compatibility between + * versions. Once the library is more fully supported, the docs will be updated to include a + * detailed description of the guarantee. + */ public static KeysManager constructor_new(byte[] seed, long starting_time_secs, int starting_time_nanos) { long ret = bindings.KeysManager_new(seed, starting_time_secs, starting_time_nanos); KeysManager ret_hu_conv = new KeysManager(null, ret); @@ -21,6 +52,13 @@ public class KeysManager extends CommonBase { return ret_hu_conv; } + /** + * Derive an old Sign containing per-channel secrets based on a key derivation parameters. + * + * Key derivation parameters are accessible through a per-channel secrets + * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of + * onchain output detection for which a corresponding delayed_payment_key must be derived. + */ public InMemorySigner derive_channel_keys(long channel_value_satoshis, byte[] params) { long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params); InMemorySigner ret_hu_conv = new InMemorySigner(null, ret); @@ -28,6 +66,19 @@ public class KeysManager extends CommonBase { return ret_hu_conv; } + /** + * Creates a Transaction which spends the given descriptors to the given outputs, plus an + * output to the given change destination (if sufficient change value remains). The + * transaction will have a feerate, at least, of the given value. + * + * Returns `Err(())` if the output value is greater than the input value minus required fee or + * if a descriptor was duplicated. + * + * We do not enforce that outputs meet the dust limit or that any output scripts are standard. + * + * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used + * this KeysManager or one of the `InMemorySigner` created by this KeysManager. + */ public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight) { long ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, Arrays.stream(descriptors).mapToLong(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray(), Arrays.stream(outputs).mapToLong(outputs_conv_7 -> outputs_conv_7.ptr).toArray(), change_destination_script, feerate_sat_per_1000_weight); Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); @@ -36,6 +87,10 @@ public class KeysManager extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new KeysInterface which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is + */ public KeysInterface as_KeysInterface() { long ret = bindings.KeysManager_as_KeysInterface(this.ptr); KeysInterface ret_hu_conv = new KeysInterface(null, ret); diff --git a/src/main/java/org/ldk/structs/LightningError.java b/src/main/java/org/ldk/structs/LightningError.java index d4138bf4..9c82673d 100644 --- a/src/main/java/org/ldk/structs/LightningError.java +++ b/src/main/java/org/ldk/structs/LightningError.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An Err type for failure to process messages. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class LightningError extends CommonBase { LightningError(Object _dummy, long ptr) { super(ptr); } @@ -14,15 +18,24 @@ public class LightningError extends CommonBase { if (ptr != 0) { bindings.LightningError_free(ptr); } } + /** + * A human-readable message describing the error + */ public String get_err() { String ret = bindings.LightningError_get_err(this.ptr); return ret; } + /** + * A human-readable message describing the error + */ public void set_err(byte[] val) { bindings.LightningError_set_err(this.ptr, val); } + /** + * The action which should be taken against the offending peer. + */ public ErrorAction get_action() { long ret = bindings.LightningError_get_action(this.ptr); ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret); @@ -30,10 +43,16 @@ public class LightningError extends CommonBase { return ret_hu_conv; } + /** + * The action which should be taken against the offending peer. + */ public void set_action(ErrorAction val) { bindings.LightningError_set_action(this.ptr, val.ptr); } + /** + * Constructs a new LightningError given each field + */ public static LightningError constructor_new(byte[] err_arg, ErrorAction action_arg) { long ret = bindings.LightningError_new(err_arg, action_arg.ptr); LightningError ret_hu_conv = new LightningError(null, ret); @@ -41,6 +60,9 @@ public class LightningError extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the LightningError + */ public LightningError clone() { long ret = bindings.LightningError_clone(this.ptr); LightningError ret_hu_conv = new LightningError(null, ret); diff --git a/src/main/java/org/ldk/structs/Listen.java b/src/main/java/org/ldk/structs/Listen.java index 075137cb..456b44f8 100644 --- a/src/main/java/org/ldk/structs/Listen.java +++ b/src/main/java/org/ldk/structs/Listen.java @@ -5,6 +5,12 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * The `Listen` trait is used to be notified of when blocks have been connected or disconnected + * from the chain. + * + * Useful when needing to replay chain data upon startup or as new chain events occur. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Listen extends CommonBase { final bindings.LDKListen bindings_instance; @@ -20,7 +26,13 @@ public class Listen extends CommonBase { } public static interface ListenInterface { + /** + * Notifies the listener that a block was added at the given height. + */ void block_connected(byte[] block, int height); + /** + * Notifies the listener that a block was removed at the given height. + */ void block_disconnected(byte[] header, int height); } private static class LDKListenHolder { Listen held; } @@ -36,10 +48,16 @@ public class Listen extends CommonBase { }); return impl_holder.held; } + /** + * Notifies the listener that a block was added at the given height. + */ public void block_connected(byte[] block, int height) { bindings.Listen_block_connected(this.ptr, block, height); } + /** + * Notifies the listener that a block was removed at the given height. + */ public void block_disconnected(byte[] header, int height) { bindings.Listen_block_disconnected(this.ptr, header, height); } diff --git a/src/main/java/org/ldk/structs/LockedNetworkGraph.java b/src/main/java/org/ldk/structs/LockedNetworkGraph.java index 62647c26..c77af379 100644 --- a/src/main/java/org/ldk/structs/LockedNetworkGraph.java +++ b/src/main/java/org/ldk/structs/LockedNetworkGraph.java @@ -5,6 +5,12 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A simple newtype for RwLockReadGuard<'a, NetworkGraph>. + * This exists only to make accessing a RwLock possible from + * the C bindings, as it can be done directly in Rust code. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class LockedNetworkGraph extends CommonBase implements AutoCloseable { LockedNetworkGraph(Object _dummy, long ptr) { super(ptr); } @@ -12,6 +18,9 @@ public class LockedNetworkGraph extends CommonBase implements AutoCloseable { if (ptr != 0) { bindings.LockedNetworkGraph_free(ptr); } } + /** + * Get a reference to the NetworkGraph which this read-lock contains. + */ public NetworkGraph graph() { long ret = bindings.LockedNetworkGraph_graph(this.ptr); NetworkGraph ret_hu_conv = new NetworkGraph(null, ret); diff --git a/src/main/java/org/ldk/structs/Logger.java b/src/main/java/org/ldk/structs/Logger.java index 02b5075a..4edaa8af 100644 --- a/src/main/java/org/ldk/structs/Logger.java +++ b/src/main/java/org/ldk/structs/Logger.java @@ -5,6 +5,9 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * A trait encapsulating the operations required of a logger + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Logger extends CommonBase { final bindings.LDKLogger bindings_instance; @@ -20,6 +23,9 @@ public class Logger extends CommonBase { } public static interface LoggerInterface { + /** + * Logs the `Record` + */ void log(String record); } private static class LDKLoggerHolder { Logger held; } diff --git a/src/main/java/org/ldk/structs/MessageHandler.java b/src/main/java/org/ldk/structs/MessageHandler.java index 389e2a88..9a233224 100644 --- a/src/main/java/org/ldk/structs/MessageHandler.java +++ b/src/main/java/org/ldk/structs/MessageHandler.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Provides references to trait impls which handle different types of messages. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class MessageHandler extends CommonBase { MessageHandler(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,10 @@ public class MessageHandler extends CommonBase { if (ptr != 0) { bindings.MessageHandler_free(ptr); } } + /** + * A message handler which handles messages specific to channels. Usually this is just a + * ChannelManager object or a ErroringMessageHandler. + */ public ChannelMessageHandler get_chan_handler() { long ret = bindings.MessageHandler_get_chan_handler(this.ptr); ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret); @@ -21,11 +29,19 @@ public class MessageHandler extends CommonBase { return ret_hu_conv; } + /** + * A message handler which handles messages specific to channels. Usually this is just a + * ChannelManager object or a ErroringMessageHandler. + */ public void set_chan_handler(ChannelMessageHandler val) { bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0 : val.ptr); this.ptrs_to.add(val); } + /** + * A message handler which handles messages updating our knowledge of the network channel + * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler. + */ public RoutingMessageHandler get_route_handler() { long ret = bindings.MessageHandler_get_route_handler(this.ptr); RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret); @@ -33,11 +49,18 @@ public class MessageHandler extends CommonBase { return ret_hu_conv; } + /** + * A message handler which handles messages updating our knowledge of the network channel + * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler. + */ public void set_route_handler(RoutingMessageHandler val) { bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : val.ptr); this.ptrs_to.add(val); } + /** + * Constructs a new MessageHandler given each field + */ public static MessageHandler constructor_new(ChannelMessageHandler chan_handler_arg, RoutingMessageHandler route_handler_arg) { long ret = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr); MessageHandler ret_hu_conv = new MessageHandler(null, ret); diff --git a/src/main/java/org/ldk/structs/MessageSendEvent.java b/src/main/java/org/ldk/structs/MessageSendEvent.java index 32be00ea..8327eae7 100644 --- a/src/main/java/org/ldk/structs/MessageSendEvent.java +++ b/src/main/java/org/ldk/structs/MessageSendEvent.java @@ -5,6 +5,12 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An event generated by ChannelManager which indicates a message should be sent to a peer (or + * broadcast to most peers). + * These events are handled by PeerManager::process_events if you are using a PeerManager. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class MessageSendEvent extends CommonBase { private MessageSendEvent(Object _dummy, long ptr) { super(ptr); } diff --git a/src/main/java/org/ldk/structs/MessageSendEventsProvider.java b/src/main/java/org/ldk/structs/MessageSendEventsProvider.java index c8bc2387..c548e4e4 100644 --- a/src/main/java/org/ldk/structs/MessageSendEventsProvider.java +++ b/src/main/java/org/ldk/structs/MessageSendEventsProvider.java @@ -5,6 +5,9 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * A trait indicating an object may generate message send events + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class MessageSendEventsProvider extends CommonBase { final bindings.LDKMessageSendEventsProvider bindings_instance; @@ -20,6 +23,10 @@ public class MessageSendEventsProvider extends CommonBase { } public static interface MessageSendEventsProviderInterface { + /** + * Gets the list of pending events which were generated by previous actions, clearing the list + * in the process. + */ MessageSendEvent[] get_and_clear_pending_msg_events(); } private static class LDKMessageSendEventsProviderHolder { MessageSendEventsProvider held; } @@ -35,6 +42,10 @@ public class MessageSendEventsProvider extends CommonBase { }); return impl_holder.held; } + /** + * Gets the list of pending events which were generated by previous actions, clearing the list + * in the process. + */ public MessageSendEvent[] get_and_clear_pending_msg_events() { long[] ret = bindings.MessageSendEventsProvider_get_and_clear_pending_msg_events(this.ptr); MessageSendEvent[] ret_conv_18_arr = new MessageSendEvent[ret.length]; diff --git a/src/main/java/org/ldk/structs/MonitorEvent.java b/src/main/java/org/ldk/structs/MonitorEvent.java index c6500e64..e3af020d 100644 --- a/src/main/java/org/ldk/structs/MonitorEvent.java +++ b/src/main/java/org/ldk/structs/MonitorEvent.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An event to be processed by the ChannelManager. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class MonitorEvent extends CommonBase { private MonitorEvent(Object _dummy, long ptr) { super(ptr); } diff --git a/src/main/java/org/ldk/structs/MonitorUpdateError.java b/src/main/java/org/ldk/structs/MonitorUpdateError.java index 419e0160..6c6c2783 100644 --- a/src/main/java/org/ldk/structs/MonitorUpdateError.java +++ b/src/main/java/org/ldk/structs/MonitorUpdateError.java @@ -5,6 +5,14 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is + * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this + * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was + * corrupted. + * Contains a developer-readable error message. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class MonitorUpdateError extends CommonBase { MonitorUpdateError(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +22,9 @@ public class MonitorUpdateError extends CommonBase { if (ptr != 0) { bindings.MonitorUpdateError_free(ptr); } } + /** + * Creates a copy of the MonitorUpdateError + */ public MonitorUpdateError clone() { long ret = bindings.MonitorUpdateError_clone(this.ptr); MonitorUpdateError ret_hu_conv = new MonitorUpdateError(null, ret); diff --git a/src/main/java/org/ldk/structs/NetAddress.java b/src/main/java/org/ldk/structs/NetAddress.java index 6dd3708a..2cde093a 100644 --- a/src/main/java/org/ldk/structs/NetAddress.java +++ b/src/main/java/org/ldk/structs/NetAddress.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An address which can be used to connect to a remote peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class NetAddress extends CommonBase { private NetAddress(Object _dummy, long ptr) { super(ptr); } diff --git a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java b/src/main/java/org/ldk/structs/NetGraphMsgHandler.java index c3e2d406..26ece016 100644 --- a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java +++ b/src/main/java/org/ldk/structs/NetGraphMsgHandler.java @@ -5,6 +5,14 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Receives and validates network updates from peers, + * stores authentic and relevant data as a network graph. + * This network graph is then used for routing payments. + * Provides interface to help with initial routing sync by + * serving historical announcements. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class NetGraphMsgHandler extends CommonBase { NetGraphMsgHandler(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +22,13 @@ public class NetGraphMsgHandler extends CommonBase { if (ptr != 0) { bindings.NetGraphMsgHandler_free(ptr); } } + /** + * Creates a new tracker of the actual state of the network of channels and nodes, + * assuming a fresh network graph. + * Chain monitor is used to make sure announced channels exist on-chain, + * channel data is correct, and that the announcement is signed with + * channel owners' keys. + */ 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); @@ -23,6 +38,10 @@ public class NetGraphMsgHandler extends CommonBase { return ret_hu_conv; } + /** + * Creates a new tracker of the actual state of the network of channels and nodes, + * assuming an existing Network Graph. + */ public static NetGraphMsgHandler constructor_from_net_graph(Access chain_access, Logger logger, NetworkGraph network_graph) { long ret = bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, network_graph == null ? 0 : network_graph.ptr & ~1); NetGraphMsgHandler ret_hu_conv = new NetGraphMsgHandler(null, ret); @@ -33,11 +52,22 @@ public class NetGraphMsgHandler extends CommonBase { return ret_hu_conv; } + /** + * Adds a provider used to check new announcements. Does not affect + * existing announcements unless they are updated. + * Add, update or remove the provider would replace the current one. + */ public void add_chain_access(Access chain_access) { bindings.NetGraphMsgHandler_add_chain_access(this.ptr, chain_access == null ? 0 : chain_access.ptr); this.ptrs_to.add(chain_access); } + /** + * Take a read lock on the network_graph and return it in the C-bindings + * newtype helper. This is likely only useful when called via the C + * bindings as you can call `self.network_graph.read().unwrap()` in Rust + * yourself. + */ public LockedNetworkGraph read_locked_graph() { long ret = bindings.NetGraphMsgHandler_read_locked_graph(this.ptr); LockedNetworkGraph ret_hu_conv = new LockedNetworkGraph(null, ret); @@ -45,6 +75,10 @@ public class NetGraphMsgHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is + */ public RoutingMessageHandler as_RoutingMessageHandler() { long ret = bindings.NetGraphMsgHandler_as_RoutingMessageHandler(this.ptr); RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret); @@ -52,6 +86,10 @@ public class NetGraphMsgHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is + */ public MessageSendEventsProvider as_MessageSendEventsProvider() { long ret = bindings.NetGraphMsgHandler_as_MessageSendEventsProvider(this.ptr); MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret); diff --git a/src/main/java/org/ldk/structs/NetworkGraph.java b/src/main/java/org/ldk/structs/NetworkGraph.java index b8badcc5..b397b47a 100644 --- a/src/main/java/org/ldk/structs/NetworkGraph.java +++ b/src/main/java/org/ldk/structs/NetworkGraph.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Represents the network as nodes and channels between them + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class NetworkGraph extends CommonBase { NetworkGraph(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,9 @@ public class NetworkGraph extends CommonBase { if (ptr != 0) { bindings.NetworkGraph_free(ptr); } } + /** + * Creates a copy of the NetworkGraph + */ public NetworkGraph clone() { long ret = bindings.NetworkGraph_clone(this.ptr); NetworkGraph ret_hu_conv = new NetworkGraph(null, ret); @@ -21,17 +28,26 @@ public class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read + */ public byte[] write() { byte[] ret = bindings.NetworkGraph_write(this.ptr); return ret; } + /** + * Read a NetworkGraph from a byte array, created by NetworkGraph_write + */ public static Result_NetworkGraphDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.NetworkGraph_read(ser); Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new, empty, network graph. + */ public static NetworkGraph constructor_new(byte[] genesis_hash) { long ret = bindings.NetworkGraph_new(genesis_hash); NetworkGraph ret_hu_conv = new NetworkGraph(null, ret); @@ -39,6 +55,14 @@ public class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * For an already known node (from channel announcements), update its stored properties from a + * given node announcement. + * + * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's + * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept + * routing messages from a source using a protocol other than the lightning P2P protocol. + */ 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); @@ -46,6 +70,12 @@ public class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * For an already known node (from channel announcements), update its stored properties from a + * given node announcement without verifying the associated signatures. Because we aren't + * given the associated signatures here we cannot relay the node announcement to any of our + * peers. + */ 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); @@ -53,6 +83,16 @@ public class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * Store or update channel info from a channel announcement. + * + * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's + * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept + * routing messages from a source using a protocol other than the lightning P2P protocol. + * + * If a `chain::Access` object is provided via `chain_access`, it will be called to verify + * the corresponding UTXO exists on chain and is correctly-formatted. + */ 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); @@ -61,6 +101,14 @@ public class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * Store or update channel info from a channel announcement without verifying the associated + * signatures. Because we aren't given the associated signatures here we cannot relay the + * channel announcement to any of our peers. + * + * If a `chain::Access` object is provided via `chain_access`, it will be called to verify + * the corresponding UTXO exists on chain and is correctly-formatted. + */ 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); @@ -69,10 +117,24 @@ public class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * Close a channel if a corresponding HTLC fail was sent. + * If permanent, removes a channel from the local storage. + * May cause the removal of nodes too, if this was their last channel. + * If not permanent, makes channels unavailable for routing. + */ 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); } + /** + * For an already known (from announcement) channel, update info about one of the directions + * of the channel. + * + * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's + * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept + * routing messages from a source using a protocol other than the lightning P2P protocol. + */ 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); @@ -80,6 +142,11 @@ public class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * For an already known (from announcement) channel, update info about one of the directions + * of the channel without verifying the associated signatures. Because we aren't given the + * associated signatures here we cannot relay the channel update to any of our peers. + */ 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); diff --git a/src/main/java/org/ldk/structs/NodeAnnouncement.java b/src/main/java/org/ldk/structs/NodeAnnouncement.java index 2b83385c..70a912c3 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncement.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A node_announcement message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class NodeAnnouncement extends CommonBase { NodeAnnouncement(Object _dummy, long ptr) { super(ptr); } @@ -14,15 +18,24 @@ public class NodeAnnouncement extends CommonBase { if (ptr != 0) { bindings.NodeAnnouncement_free(ptr); } } + /** + * The signature by the node key + */ public byte[] get_signature() { byte[] ret = bindings.NodeAnnouncement_get_signature(this.ptr); return ret; } + /** + * The signature by the node key + */ public void set_signature(byte[] val) { bindings.NodeAnnouncement_set_signature(this.ptr, val); } + /** + * The actual content of the announcement + */ public UnsignedNodeAnnouncement get_contents() { long ret = bindings.NodeAnnouncement_get_contents(this.ptr); UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); @@ -30,11 +43,17 @@ public class NodeAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * The actual content of the announcement + */ public void set_contents(UnsignedNodeAnnouncement val) { bindings.NodeAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Constructs a new NodeAnnouncement given each field + */ public static NodeAnnouncement constructor_new(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) { long ret = bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret); @@ -43,6 +62,9 @@ public class NodeAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the NodeAnnouncement + */ public NodeAnnouncement clone() { long ret = bindings.NodeAnnouncement_clone(this.ptr); NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret); @@ -50,11 +72,17 @@ public class NodeAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read + */ public byte[] write() { byte[] ret = bindings.NodeAnnouncement_write(this.ptr); return ret; } + /** + * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write + */ public static Result_NodeAnnouncementDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.NodeAnnouncement_read(ser); Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java index 561b4dd3..3c3b5739 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Information received in the latest node_announcement from this node. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class NodeAnnouncementInfo extends CommonBase { NodeAnnouncementInfo(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,9 @@ public class NodeAnnouncementInfo extends CommonBase { if (ptr != 0) { bindings.NodeAnnouncementInfo_free(ptr); } } + /** + * Protocol features the node announced support for + */ public NodeFeatures get_features() { long ret = bindings.NodeAnnouncementInfo_get_features(this.ptr); NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); @@ -21,43 +28,79 @@ public class NodeAnnouncementInfo extends CommonBase { return ret_hu_conv; } + /** + * Protocol features the node announced support for + */ public void set_features(NodeFeatures val) { bindings.NodeAnnouncementInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * When the last known update to the node state was issued. + * Value is opaque, as set in the announcement. + */ public int get_last_update() { int ret = bindings.NodeAnnouncementInfo_get_last_update(this.ptr); return ret; } + /** + * When the last known update to the node state was issued. + * Value is opaque, as set in the announcement. + */ public void set_last_update(int val) { bindings.NodeAnnouncementInfo_set_last_update(this.ptr, val); } + /** + * Color assigned to the node + */ public byte[] get_rgb() { byte[] ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr); return ret; } + /** + * Color assigned to the node + */ public void set_rgb(byte[] val) { bindings.NodeAnnouncementInfo_set_rgb(this.ptr, val); } + /** + * Moniker assigned to the node. + * May be invalid or malicious (eg control chars), + * should not be exposed to the user. + */ public byte[] get_alias() { byte[] ret = bindings.NodeAnnouncementInfo_get_alias(this.ptr); return ret; } + /** + * Moniker assigned to the node. + * May be invalid or malicious (eg control chars), + * should not be exposed to the user. + */ public void set_alias(byte[] val) { bindings.NodeAnnouncementInfo_set_alias(this.ptr, val); } + /** + * Internet-level addresses via which one can connect to the node + */ public void set_addresses(NetAddress[] val) { bindings.NodeAnnouncementInfo_set_addresses(this.ptr, Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray()); /* TODO 2 NetAddress */; } + /** + * An initial announcement of the node + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + */ public NodeAnnouncement get_announcement_message() { long ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr); NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret); @@ -65,11 +108,20 @@ public class NodeAnnouncementInfo extends CommonBase { return ret_hu_conv; } + /** + * An initial announcement of the node + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + */ public void set_announcement_message(NodeAnnouncement val) { bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Constructs a new NodeAnnouncementInfo given each field + */ public static NodeAnnouncementInfo constructor_new(NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) { long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray(), announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1); NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret); @@ -80,6 +132,9 @@ public class NodeAnnouncementInfo extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the NodeAnnouncementInfo + */ public NodeAnnouncementInfo clone() { long ret = bindings.NodeAnnouncementInfo_clone(this.ptr); NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret); @@ -87,11 +142,17 @@ public class NodeAnnouncementInfo extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read + */ public byte[] write() { byte[] ret = bindings.NodeAnnouncementInfo_write(this.ptr); return ret; } + /** + * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write + */ public static Result_NodeAnnouncementInfoDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.NodeAnnouncementInfo_read(ser); Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/NodeFeatures.java b/src/main/java/org/ldk/structs/NodeFeatures.java index a32f9680..b4d09e71 100644 --- a/src/main/java/org/ldk/structs/NodeFeatures.java +++ b/src/main/java/org/ldk/structs/NodeFeatures.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Features used within a `node_announcement` message. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class NodeFeatures extends CommonBase { NodeFeatures(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,9 @@ public class NodeFeatures extends CommonBase { if (ptr != 0) { bindings.NodeFeatures_free(ptr); } } + /** + * Creates a copy of the NodeFeatures + */ public NodeFeatures clone() { long ret = bindings.NodeFeatures_clone(this.ptr); NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); @@ -21,6 +28,9 @@ public class NodeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Create a blank Features with no features set + */ public static NodeFeatures constructor_empty() { long ret = bindings.NodeFeatures_empty(); NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); @@ -28,6 +38,11 @@ public class NodeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. + * + * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS + */ public static NodeFeatures constructor_known() { long ret = bindings.NodeFeatures_known(); NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); @@ -35,11 +50,17 @@ public class NodeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read + */ public byte[] write() { byte[] ret = bindings.NodeFeatures_write(this.ptr); return ret; } + /** + * Read a NodeFeatures from a byte array, created by NodeFeatures_write + */ public static Result_NodeFeaturesDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.NodeFeatures_read(ser); Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/NodeInfo.java b/src/main/java/org/ldk/structs/NodeInfo.java index 8b983739..42032374 100644 --- a/src/main/java/org/ldk/structs/NodeInfo.java +++ b/src/main/java/org/ldk/structs/NodeInfo.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Details about a node in the network, known from the network announcement. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class NodeInfo extends CommonBase { NodeInfo(Object _dummy, long ptr) { super(ptr); } @@ -14,10 +18,18 @@ public class NodeInfo extends CommonBase { if (ptr != 0) { bindings.NodeInfo_free(ptr); } } + /** + * All valid channels a node has announced + */ public void set_channels(long[] val) { bindings.NodeInfo_set_channels(this.ptr, val); } + /** + * Lowest fees enabling routing via any of the enabled, known channels to a node. + * The two fields (flat and proportional fee) are independent, + * meaning they don't have to refer to the same channel. + */ public RoutingFees get_lowest_inbound_channel_fees() { long ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr); RoutingFees ret_hu_conv = new RoutingFees(null, ret); @@ -25,11 +37,21 @@ public class NodeInfo extends CommonBase { return ret_hu_conv; } + /** + * Lowest fees enabling routing via any of the enabled, known channels to a node. + * The two fields (flat and proportional fee) are independent, + * meaning they don't have to refer to the same channel. + */ public void set_lowest_inbound_channel_fees(RoutingFees val) { bindings.NodeInfo_set_lowest_inbound_channel_fees(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * More information about a node from node_announcement. + * Optional because we store a Node entry after learning about it from + * a channel announcement, but before receiving a node announcement. + */ public NodeAnnouncementInfo get_announcement_info() { long ret = bindings.NodeInfo_get_announcement_info(this.ptr); NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret); @@ -37,11 +59,19 @@ public class NodeInfo extends CommonBase { return ret_hu_conv; } + /** + * More information about a node from node_announcement. + * Optional because we store a Node entry after learning about it from + * a channel announcement, but before receiving a node announcement. + */ public void set_announcement_info(NodeAnnouncementInfo val) { bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Constructs a new NodeInfo given each field + */ public static NodeInfo constructor_new(long[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeAnnouncementInfo announcement_info_arg) { long ret = bindings.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg == null ? 0 : lowest_inbound_channel_fees_arg.ptr & ~1, announcement_info_arg == null ? 0 : announcement_info_arg.ptr & ~1); NodeInfo ret_hu_conv = new NodeInfo(null, ret); @@ -51,6 +81,9 @@ public class NodeInfo extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the NodeInfo + */ public NodeInfo clone() { long ret = bindings.NodeInfo_clone(this.ptr); NodeInfo ret_hu_conv = new NodeInfo(null, ret); @@ -58,11 +91,17 @@ public class NodeInfo extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read + */ public byte[] write() { byte[] ret = bindings.NodeInfo_write(this.ptr); return ret; } + /** + * Read a NodeInfo from a byte array, created by NodeInfo_write + */ public static Result_NodeInfoDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.NodeInfo_read(ser); Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/OpenChannel.java b/src/main/java/org/ldk/structs/OpenChannel.java index 3f2c4190..ce1dd35b 100644 --- a/src/main/java/org/ldk/structs/OpenChannel.java +++ b/src/main/java/org/ldk/structs/OpenChannel.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An open_channel message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class OpenChannel extends CommonBase { OpenChannel(Object _dummy, long ptr) { super(ptr); } @@ -14,168 +18,279 @@ public class OpenChannel extends CommonBase { if (ptr != 0) { bindings.OpenChannel_free(ptr); } } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public byte[] get_chain_hash() { byte[] ret = bindings.OpenChannel_get_chain_hash(this.ptr); return ret; } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public void set_chain_hash(byte[] val) { bindings.OpenChannel_set_chain_hash(this.ptr, val); } + /** + * A temporary channel ID, until the funding outpoint is announced + */ public byte[] get_temporary_channel_id() { byte[] ret = bindings.OpenChannel_get_temporary_channel_id(this.ptr); return ret; } + /** + * A temporary channel ID, until the funding outpoint is announced + */ public void set_temporary_channel_id(byte[] val) { bindings.OpenChannel_set_temporary_channel_id(this.ptr, val); } + /** + * The channel value + */ public long get_funding_satoshis() { long ret = bindings.OpenChannel_get_funding_satoshis(this.ptr); return ret; } + /** + * The channel value + */ public void set_funding_satoshis(long val) { bindings.OpenChannel_set_funding_satoshis(this.ptr, val); } + /** + * The amount to push to the counterparty as part of the open, in milli-satoshi + */ public long get_push_msat() { long ret = bindings.OpenChannel_get_push_msat(this.ptr); return ret; } + /** + * The amount to push to the counterparty as part of the open, in milli-satoshi + */ public void set_push_msat(long val) { bindings.OpenChannel_set_push_msat(this.ptr, val); } + /** + * The threshold below which outputs on transactions broadcast by sender will be omitted + */ public long get_dust_limit_satoshis() { long ret = bindings.OpenChannel_get_dust_limit_satoshis(this.ptr); return ret; } + /** + * The threshold below which outputs on transactions broadcast by sender will be omitted + */ public void set_dust_limit_satoshis(long val) { bindings.OpenChannel_set_dust_limit_satoshis(this.ptr, val); } + /** + * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + */ public long get_max_htlc_value_in_flight_msat() { long ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this.ptr); return ret; } + /** + * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + */ public void set_max_htlc_value_in_flight_msat(long val) { bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this.ptr, val); } + /** + * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel + */ public long get_channel_reserve_satoshis() { long ret = bindings.OpenChannel_get_channel_reserve_satoshis(this.ptr); return ret; } + /** + * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel + */ public void set_channel_reserve_satoshis(long val) { bindings.OpenChannel_set_channel_reserve_satoshis(this.ptr, val); } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public long get_htlc_minimum_msat() { long ret = bindings.OpenChannel_get_htlc_minimum_msat(this.ptr); return ret; } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public void set_htlc_minimum_msat(long val) { bindings.OpenChannel_set_htlc_minimum_msat(this.ptr, val); } + /** + * The feerate per 1000-weight of sender generated transactions, until updated by update_fee + */ public int get_feerate_per_kw() { int ret = bindings.OpenChannel_get_feerate_per_kw(this.ptr); return ret; } + /** + * The feerate per 1000-weight of sender generated transactions, until updated by update_fee + */ public void set_feerate_per_kw(int val) { bindings.OpenChannel_set_feerate_per_kw(this.ptr, val); } + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction + */ public short get_to_self_delay() { short ret = bindings.OpenChannel_get_to_self_delay(this.ptr); return ret; } + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction + */ public void set_to_self_delay(short val) { bindings.OpenChannel_set_to_self_delay(this.ptr, val); } + /** + * The maximum number of inbound HTLCs towards sender + */ public short get_max_accepted_htlcs() { short ret = bindings.OpenChannel_get_max_accepted_htlcs(this.ptr); return ret; } + /** + * The maximum number of inbound HTLCs towards sender + */ public void set_max_accepted_htlcs(short val) { bindings.OpenChannel_set_max_accepted_htlcs(this.ptr, val); } + /** + * The sender's key controlling the funding transaction + */ public byte[] get_funding_pubkey() { byte[] ret = bindings.OpenChannel_get_funding_pubkey(this.ptr); return ret; } + /** + * The sender's key controlling the funding transaction + */ public void set_funding_pubkey(byte[] val) { bindings.OpenChannel_set_funding_pubkey(this.ptr, val); } + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ public byte[] get_revocation_basepoint() { byte[] ret = bindings.OpenChannel_get_revocation_basepoint(this.ptr); return ret; } + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ public void set_revocation_basepoint(byte[] val) { bindings.OpenChannel_set_revocation_basepoint(this.ptr, val); } + /** + * A payment key to sender for transactions broadcast by counterparty + */ public byte[] get_payment_point() { byte[] ret = bindings.OpenChannel_get_payment_point(this.ptr); return ret; } + /** + * A payment key to sender for transactions broadcast by counterparty + */ public void set_payment_point(byte[] val) { bindings.OpenChannel_set_payment_point(this.ptr, val); } + /** + * Used to derive a payment key to sender for transactions broadcast by sender + */ public byte[] get_delayed_payment_basepoint() { byte[] ret = bindings.OpenChannel_get_delayed_payment_basepoint(this.ptr); return ret; } + /** + * Used to derive a payment key to sender for transactions broadcast by sender + */ public void set_delayed_payment_basepoint(byte[] val) { bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, val); } + /** + * Used to derive an HTLC payment key to sender + */ public byte[] get_htlc_basepoint() { byte[] ret = bindings.OpenChannel_get_htlc_basepoint(this.ptr); return ret; } + /** + * Used to derive an HTLC payment key to sender + */ public void set_htlc_basepoint(byte[] val) { bindings.OpenChannel_set_htlc_basepoint(this.ptr, val); } + /** + * The first to-be-broadcast-by-sender transaction's per commitment point + */ public byte[] get_first_per_commitment_point() { byte[] ret = bindings.OpenChannel_get_first_per_commitment_point(this.ptr); return ret; } + /** + * The first to-be-broadcast-by-sender transaction's per commitment point + */ public void set_first_per_commitment_point(byte[] val) { bindings.OpenChannel_set_first_per_commitment_point(this.ptr, val); } + /** + * Channel flags + */ public byte get_channel_flags() { byte ret = bindings.OpenChannel_get_channel_flags(this.ptr); return ret; } + /** + * Channel flags + */ public void set_channel_flags(byte val) { bindings.OpenChannel_set_channel_flags(this.ptr, val); } + /** + * Creates a copy of the OpenChannel + */ public OpenChannel clone() { long ret = bindings.OpenChannel_clone(this.ptr); OpenChannel ret_hu_conv = new OpenChannel(null, ret); @@ -183,11 +298,17 @@ public class OpenChannel extends CommonBase { return ret_hu_conv; } + /** + * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read + */ public byte[] write() { byte[] ret = bindings.OpenChannel_write(this.ptr); return ret; } + /** + * Read a OpenChannel from a byte array, created by OpenChannel_write + */ public static Result_OpenChannelDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.OpenChannel_read(ser); Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/OutPoint.java b/src/main/java/org/ldk/structs/OutPoint.java index d0c7edba..42a79f04 100644 --- a/src/main/java/org/ldk/structs/OutPoint.java +++ b/src/main/java/org/ldk/structs/OutPoint.java @@ -5,6 +5,13 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A reference to a transaction output. + * + * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32 + * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class OutPoint extends CommonBase { OutPoint(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +21,39 @@ public class OutPoint extends CommonBase { if (ptr != 0) { bindings.OutPoint_free(ptr); } } + /** + * The referenced transaction's txid. + */ public byte[] get_txid() { byte[] ret = bindings.OutPoint_get_txid(this.ptr); return ret; } + /** + * The referenced transaction's txid. + */ public void set_txid(byte[] val) { bindings.OutPoint_set_txid(this.ptr, val); } + /** + * The index of the referenced output in its transaction's vout. + */ public short get_index() { short ret = bindings.OutPoint_get_index(this.ptr); return ret; } + /** + * The index of the referenced output in its transaction's vout. + */ public void set_index(short val) { bindings.OutPoint_set_index(this.ptr, val); } + /** + * Constructs a new OutPoint given each field + */ public static OutPoint constructor_new(byte[] txid_arg, short index_arg) { long ret = bindings.OutPoint_new(txid_arg, index_arg); OutPoint ret_hu_conv = new OutPoint(null, ret); @@ -39,6 +61,9 @@ public class OutPoint extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the OutPoint + */ public OutPoint clone() { long ret = bindings.OutPoint_clone(this.ptr); OutPoint ret_hu_conv = new OutPoint(null, ret); @@ -46,16 +71,25 @@ public class OutPoint extends CommonBase { return ret_hu_conv; } + /** + * Convert an `OutPoint` to a lightning channel id. + */ public byte[] to_channel_id() { byte[] ret = bindings.OutPoint_to_channel_id(this.ptr); return ret; } + /** + * Serialize the OutPoint object into a byte array which can be read by OutPoint_read + */ public byte[] write() { byte[] ret = bindings.OutPoint_write(this.ptr); return ret; } + /** + * Read a OutPoint from a byte array, created by OutPoint_write + */ public static Result_OutPointDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.OutPoint_read(ser); Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/PaymentSendFailure.java b/src/main/java/org/ldk/structs/PaymentSendFailure.java index af08d8cc..b329a413 100644 --- a/src/main/java/org/ldk/structs/PaymentSendFailure.java +++ b/src/main/java/org/ldk/structs/PaymentSendFailure.java @@ -5,6 +5,12 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * If a payment fails to send, it can be in one of several states. This enum is returned as the + * Err() type describing which state the payment is in, see the description of individual enum + * states for more. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class PaymentSendFailure extends CommonBase { private PaymentSendFailure(Object _dummy, long ptr) { super(ptr); } diff --git a/src/main/java/org/ldk/structs/PeerHandleError.java b/src/main/java/org/ldk/structs/PeerHandleError.java index 0bd7604d..429f44aa 100644 --- a/src/main/java/org/ldk/structs/PeerHandleError.java +++ b/src/main/java/org/ldk/structs/PeerHandleError.java @@ -5,6 +5,12 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Error for PeerManager errors. If you get one of these, you must disconnect the socket and + * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the + * descriptor. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class PeerHandleError extends CommonBase { PeerHandleError(Object _dummy, long ptr) { super(ptr); } @@ -14,15 +20,26 @@ public class PeerHandleError extends CommonBase { if (ptr != 0) { bindings.PeerHandleError_free(ptr); } } + /** + * Used to indicate that we probably can't make any future connections to this peer, implying + * we should go ahead and force-close any channels we have with it. + */ public boolean get_no_connection_possible() { boolean ret = bindings.PeerHandleError_get_no_connection_possible(this.ptr); return ret; } + /** + * Used to indicate that we probably can't make any future connections to this peer, implying + * we should go ahead and force-close any channels we have with it. + */ public void set_no_connection_possible(boolean val) { bindings.PeerHandleError_set_no_connection_possible(this.ptr, val); } + /** + * Constructs a new PeerHandleError given each field + */ public static PeerHandleError constructor_new(boolean no_connection_possible_arg) { long ret = bindings.PeerHandleError_new(no_connection_possible_arg); PeerHandleError ret_hu_conv = new PeerHandleError(null, ret); @@ -30,6 +47,9 @@ public class PeerHandleError extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the PeerHandleError + */ public PeerHandleError clone() { long ret = bindings.PeerHandleError_clone(this.ptr); PeerHandleError ret_hu_conv = new PeerHandleError(null, ret); diff --git a/src/main/java/org/ldk/structs/PeerManager.java b/src/main/java/org/ldk/structs/PeerManager.java index 3c8a441a..4a73a3a6 100644 --- a/src/main/java/org/ldk/structs/PeerManager.java +++ b/src/main/java/org/ldk/structs/PeerManager.java @@ -5,6 +5,17 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket + * events into messages which it passes on to its MessageHandlers. + * + * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager + * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but + * essentially you should default to using a SimpleRefPeerManager, and use a + * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when + * you're using lightning-net-tokio. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class PeerManager extends CommonBase { PeerManager(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +25,11 @@ public class PeerManager extends CommonBase { if (ptr != 0) { bindings.PeerManager_free(ptr); } } + /** + * Constructs a new PeerManager with the given message handlers and node_id secret key + * ephemeral_random_data is used to derive per-connection ephemeral keys and must be + * cryptographically secure random bytes. + */ public static PeerManager constructor_new(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, byte[] our_node_secret, byte[] ephemeral_random_data, Logger logger) { long ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0 : message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg == null ? 0 : message_handler_route_handler_arg.ptr), our_node_secret, ephemeral_random_data, logger == null ? 0 : logger.ptr); PeerManager ret_hu_conv = new PeerManager(null, ret); @@ -24,11 +40,28 @@ public class PeerManager extends CommonBase { return ret_hu_conv; } + /** + * Get the list of node ids for peers which have completed the initial handshake. + * + * For outbound connections, this will be the same as the their_node_id parameter passed in to + * new_outbound_connection, however entries will only appear once the initial handshake has + * completed and we are sure the remote peer has the private key for the given node_id. + */ public byte[][] get_peer_node_ids() { byte[][] ret = bindings.PeerManager_get_peer_node_ids(this.ptr); return ret; } + /** + * Indicates a new outbound connection has been established to a node with the given node_id. + * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new + * descriptor but must disconnect the connection immediately. + * + * Returns a small number of bytes to send to the remote node (currently always 50). + * + * Panics if descriptor is duplicative with some other descriptor which has not yet had a + * socket_disconnected(). + */ 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); @@ -36,6 +69,17 @@ public class PeerManager extends CommonBase { return ret_hu_conv; } + /** + * Indicates a new inbound connection has been established. + * + * May refuse the connection by returning an Err, but will never write bytes to the remote end + * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT + * call socket_disconnected for the new descriptor but must disconnect the connection + * immediately. + * + * Panics if descriptor is duplicative with some other descriptor which has not yet had + * socket_disconnected called. + */ 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); @@ -43,6 +87,18 @@ public class PeerManager extends CommonBase { return ret_hu_conv; } + /** + * Indicates that there is room to write data to the given socket descriptor. + * + * May return an Err to indicate that the connection should be closed. + * + * Will most likely call send_data on the descriptor passed in (or the descriptor handed into + * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The + * invariants around calling write_buffer_space_avail in case a write did not fully complete + * must still hold - be ready to call write_buffer_space_avail again if a write call generated + * here isn't sufficient! Panics if the descriptor was not previously registered in a + * new_\\*_connection event. + */ 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); @@ -50,6 +106,20 @@ public class PeerManager extends CommonBase { return ret_hu_conv; } + /** + * Indicates that data was read from the given socket descriptor. + * + * May return an Err to indicate that the connection should be closed. + * + * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity. + * Thus, however, you almost certainly want to call process_events() after any read_event to + * generate send_data calls to handle responses. + * + * If Ok(true) is returned, further read_events should not be triggered until a send_data call + * on this file descriptor has resume_read set (preventing DoS issues in the send buffer). + * + * Panics if the descriptor was not previously registered in a new_*_connection event. + */ 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); @@ -57,19 +127,48 @@ public class PeerManager extends CommonBase { return ret_hu_conv; } + /** + * Checks for any events generated by our handlers and processes them. Includes sending most + * response messages as well as messages generated by calls to handler functions directly (eg + * functions like ChannelManager::process_pending_htlc_forward or send_payment). + */ public void process_events() { bindings.PeerManager_process_events(this.ptr); } + /** + * Indicates that the given socket descriptor's connection is now closed. + * + * This must only be called if the socket has been disconnected by the peer or your own + * decision to disconnect it and must NOT be called in any case where other parts of this + * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect + * the peer. + * + * Panics if the descriptor was not previously registered in a successful new_*_connection event. + */ public void socket_disconnected(SocketDescriptor descriptor) { bindings.PeerManager_socket_disconnected(this.ptr, descriptor == null ? 0 : descriptor.ptr); this.ptrs_to.add(descriptor); } + /** + * Disconnect a peer given its node id. + * + * Set no_connection_possible to true to prevent any further connection with this peer, + * force-closing any channels we have with it. + * + * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer, + * so be careful about reentrancy issues. + */ public void disconnect_by_node_id(byte[] node_id, boolean no_connection_possible) { bindings.PeerManager_disconnect_by_node_id(this.ptr, node_id, no_connection_possible); } + /** + * This function should be called roughly once every 30 seconds. + * It will send pings to each peer and disconnect those which did not respond to the last round of pings. + * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues! + */ public void timer_tick_occured() { bindings.PeerManager_timer_tick_occured(this.ptr); } diff --git a/src/main/java/org/ldk/structs/Persist.java b/src/main/java/org/ldk/structs/Persist.java index 3e318d81..ebb48ed9 100644 --- a/src/main/java/org/ldk/structs/Persist.java +++ b/src/main/java/org/ldk/structs/Persist.java @@ -5,6 +5,19 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * `Persist` defines behavior for persisting channel monitors: this could mean + * writing once to disk, and/or uploading to one or more backup services. + * + * Note that for every new monitor, you **must** persist the new `ChannelMonitor` + * to disk/backups. And, on every update, you **must** persist either the + * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk + * of situations such as revoking a transaction, then crashing before this + * revocation can be persisted, then unintentionally broadcasting a revoked + * transaction and losing money. This is a risk because previous channel states + * are toxic, so it's important that whatever channel state is persisted is + * kept up-to-date. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Persist extends CommonBase { final bindings.LDKPersist bindings_instance; @@ -20,7 +33,49 @@ public class Persist extends CommonBase { } public static interface PersistInterface { + /** + * Persist a new channel's data. The data can be stored any way you want, but + * the identifier provided by Rust-Lightning is the channel's outpoint (and + * it is up to you to maintain a correct mapping between the outpoint and the + * stored channel data). Note that you **must** persist every new monitor to + * disk. See the `Persist` trait documentation for more details. + * + * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`, + * and [`ChannelMonitorUpdateErr`] for requirements when returning errors. + * + * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk + * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html + */ Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data); + /** + * Update one channel's data. The provided `ChannelMonitor` has already + * applied the given update. + * + * Note that on every update, you **must** persist either the + * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See + * the `Persist` trait documentation for more details. + * + * If an implementer chooses to persist the updates only, they need to make + * sure that all the updates are applied to the `ChannelMonitors` *before + * the set of channel monitors is given to the `ChannelManager` + * deserialization routine. See [`ChannelMonitor::update_monitor`] for + * applying a monitor update to a monitor. If full `ChannelMonitors` are + * persisted, then there is no need to persist individual updates. + * + * Note that there could be a performance tradeoff between persisting complete + * channel monitors on every update vs. persisting only updates and applying + * them in batches. The size of each monitor grows `O(number of state updates)` + * whereas updates are small and `O(1)`. + * + * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`, + * [`ChannelMonitorUpdate::write`] for writing out an update, and + * [`ChannelMonitorUpdateErr`] for requirements when returning errors. + * + * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1 + * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk + * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write + * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html + */ Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data); } private static class LDKPersistHolder { Persist held; } @@ -47,6 +102,19 @@ public class Persist extends CommonBase { }); return impl_holder.held; } + /** + * Persist a new channel's data. The data can be stored any way you want, but + * the identifier provided by Rust-Lightning is the channel's outpoint (and + * it is up to you to maintain a correct mapping between the outpoint and the + * stored channel data). Note that you **must** persist every new monitor to + * disk. See the `Persist` trait documentation for more details. + * + * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`, + * and [`ChannelMonitorUpdateErr`] for requirements when returning errors. + * + * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk + * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html + */ 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); @@ -55,6 +123,35 @@ public class Persist extends CommonBase { return ret_hu_conv; } + /** + * Update one channel's data. The provided `ChannelMonitor` has already + * applied the given update. + * + * Note that on every update, you **must** persist either the + * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See + * the `Persist` trait documentation for more details. + * + * If an implementer chooses to persist the updates only, they need to make + * sure that all the updates are applied to the `ChannelMonitors` *before + * the set of channel monitors is given to the `ChannelManager` + * deserialization routine. See [`ChannelMonitor::update_monitor`] for + * applying a monitor update to a monitor. If full `ChannelMonitors` are + * persisted, then there is no need to persist individual updates. + * + * Note that there could be a performance tradeoff between persisting complete + * channel monitors on every update vs. persisting only updates and applying + * them in batches. The size of each monitor grows `O(number of state updates)` + * whereas updates are small and `O(1)`. + * + * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`, + * [`ChannelMonitorUpdate::write`] for writing out an update, and + * [`ChannelMonitorUpdateErr`] for requirements when returning errors. + * + * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1 + * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk + * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write + * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html + */ 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); diff --git a/src/main/java/org/ldk/structs/Ping.java b/src/main/java/org/ldk/structs/Ping.java index 0f466fa9..b852fbaf 100644 --- a/src/main/java/org/ldk/structs/Ping.java +++ b/src/main/java/org/ldk/structs/Ping.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A ping message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Ping extends CommonBase { Ping(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,41 @@ public class Ping extends CommonBase { if (ptr != 0) { bindings.Ping_free(ptr); } } + /** + * The desired response length + */ public short get_ponglen() { short ret = bindings.Ping_get_ponglen(this.ptr); return ret; } + /** + * The desired response length + */ public void set_ponglen(short val) { bindings.Ping_set_ponglen(this.ptr, val); } + /** + * The ping packet size. + * This field is not sent on the wire. byteslen zeros are sent. + */ public short get_byteslen() { short ret = bindings.Ping_get_byteslen(this.ptr); return ret; } + /** + * The ping packet size. + * This field is not sent on the wire. byteslen zeros are sent. + */ public void set_byteslen(short val) { bindings.Ping_set_byteslen(this.ptr, val); } + /** + * Constructs a new Ping given each field + */ public static Ping constructor_new(short ponglen_arg, short byteslen_arg) { long ret = bindings.Ping_new(ponglen_arg, byteslen_arg); Ping ret_hu_conv = new Ping(null, ret); @@ -39,6 +60,9 @@ public class Ping extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the Ping + */ public Ping clone() { long ret = bindings.Ping_clone(this.ptr); Ping ret_hu_conv = new Ping(null, ret); @@ -46,11 +70,17 @@ public class Ping extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Ping object into a byte array which can be read by Ping_read + */ public byte[] write() { byte[] ret = bindings.Ping_write(this.ptr); return ret; } + /** + * Read a Ping from a byte array, created by Ping_write + */ public static Result_PingDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.Ping_read(ser); Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/Pong.java b/src/main/java/org/ldk/structs/Pong.java index 80530aa7..5e296ab6 100644 --- a/src/main/java/org/ldk/structs/Pong.java +++ b/src/main/java/org/ldk/structs/Pong.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A pong message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Pong extends CommonBase { Pong(Object _dummy, long ptr) { super(ptr); } @@ -14,15 +18,26 @@ public class Pong extends CommonBase { if (ptr != 0) { bindings.Pong_free(ptr); } } + /** + * The pong packet size. + * This field is not sent on the wire. byteslen zeros are sent. + */ public short get_byteslen() { short ret = bindings.Pong_get_byteslen(this.ptr); return ret; } + /** + * The pong packet size. + * This field is not sent on the wire. byteslen zeros are sent. + */ public void set_byteslen(short val) { bindings.Pong_set_byteslen(this.ptr, val); } + /** + * Constructs a new Pong given each field + */ public static Pong constructor_new(short byteslen_arg) { long ret = bindings.Pong_new(byteslen_arg); Pong ret_hu_conv = new Pong(null, ret); @@ -30,6 +45,9 @@ public class Pong extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the Pong + */ public Pong clone() { long ret = bindings.Pong_clone(this.ptr); Pong ret_hu_conv = new Pong(null, ret); @@ -37,11 +55,17 @@ public class Pong extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Pong object into a byte array which can be read by Pong_read + */ public byte[] write() { byte[] ret = bindings.Pong_write(this.ptr); return ret; } + /** + * Read a Pong from a byte array, created by Pong_write + */ public static Result_PongDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.Pong_read(ser); Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/QueryChannelRange.java b/src/main/java/org/ldk/structs/QueryChannelRange.java index 2f6f3a12..97d856ea 100644 --- a/src/main/java/org/ldk/structs/QueryChannelRange.java +++ b/src/main/java/org/ldk/structs/QueryChannelRange.java @@ -5,6 +5,13 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A query_channel_range message is used to query a peer for channel + * UTXOs in a range of blocks. The recipient of a query makes a best + * effort to reply to the query using one or more reply_channel_range + * messages. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class QueryChannelRange extends CommonBase { QueryChannelRange(Object _dummy, long ptr) { super(ptr); } @@ -14,33 +21,54 @@ public class QueryChannelRange extends CommonBase { if (ptr != 0) { bindings.QueryChannelRange_free(ptr); } } + /** + * The genesis hash of the blockchain being queried + */ public byte[] get_chain_hash() { byte[] ret = bindings.QueryChannelRange_get_chain_hash(this.ptr); return ret; } + /** + * The genesis hash of the blockchain being queried + */ public void set_chain_hash(byte[] val) { bindings.QueryChannelRange_set_chain_hash(this.ptr, val); } + /** + * The height of the first block for the channel UTXOs being queried + */ public int get_first_blocknum() { int ret = bindings.QueryChannelRange_get_first_blocknum(this.ptr); return ret; } + /** + * The height of the first block for the channel UTXOs being queried + */ public void set_first_blocknum(int val) { bindings.QueryChannelRange_set_first_blocknum(this.ptr, val); } + /** + * The number of blocks to include in the query results + */ public int get_number_of_blocks() { int ret = bindings.QueryChannelRange_get_number_of_blocks(this.ptr); return ret; } + /** + * The number of blocks to include in the query results + */ public void set_number_of_blocks(int val) { bindings.QueryChannelRange_set_number_of_blocks(this.ptr, val); } + /** + * Constructs a new QueryChannelRange given each field + */ public static QueryChannelRange constructor_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg) { long ret = bindings.QueryChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg); QueryChannelRange ret_hu_conv = new QueryChannelRange(null, ret); @@ -48,6 +76,9 @@ public class QueryChannelRange extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the QueryChannelRange + */ public QueryChannelRange clone() { long ret = bindings.QueryChannelRange_clone(this.ptr); QueryChannelRange ret_hu_conv = new QueryChannelRange(null, ret); @@ -55,12 +86,18 @@ public class QueryChannelRange extends CommonBase { return ret_hu_conv; } + /** + * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write + */ public static Result_QueryChannelRangeDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.QueryChannelRange_read(ser); Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read + */ public byte[] write() { byte[] ret = bindings.QueryChannelRange_write(this.ptr); return ret; diff --git a/src/main/java/org/ldk/structs/QueryShortChannelIds.java b/src/main/java/org/ldk/structs/QueryShortChannelIds.java index 069bc72d..a451d753 100644 --- a/src/main/java/org/ldk/structs/QueryShortChannelIds.java +++ b/src/main/java/org/ldk/structs/QueryShortChannelIds.java @@ -5,6 +5,17 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A query_short_channel_ids message is used to query a peer for + * routing gossip messages related to one or more short_channel_ids. + * The query recipient will reply with the latest, if available, + * channel_announcement, channel_update and node_announcement messages + * it maintains for the requested short_channel_ids followed by a + * reply_short_channel_ids_end message. The short_channel_ids sent in + * this query are encoded. We only support encoding_type=0 uncompressed + * serialization and do not support encoding_type=1 zlib serialization. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class QueryShortChannelIds extends CommonBase { QueryShortChannelIds(Object _dummy, long ptr) { super(ptr); } @@ -14,19 +25,31 @@ public class QueryShortChannelIds extends CommonBase { if (ptr != 0) { bindings.QueryShortChannelIds_free(ptr); } } + /** + * The genesis hash of the blockchain being queried + */ public byte[] get_chain_hash() { byte[] ret = bindings.QueryShortChannelIds_get_chain_hash(this.ptr); return ret; } + /** + * The genesis hash of the blockchain being queried + */ public void set_chain_hash(byte[] val) { bindings.QueryShortChannelIds_set_chain_hash(this.ptr, val); } + /** + * The short_channel_ids that are being queried + */ public void set_short_channel_ids(long[] val) { bindings.QueryShortChannelIds_set_short_channel_ids(this.ptr, val); } + /** + * Constructs a new QueryShortChannelIds given each field + */ public static QueryShortChannelIds constructor_new(byte[] chain_hash_arg, long[] short_channel_ids_arg) { long ret = bindings.QueryShortChannelIds_new(chain_hash_arg, short_channel_ids_arg); QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret); @@ -34,6 +57,9 @@ public class QueryShortChannelIds extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the QueryShortChannelIds + */ public QueryShortChannelIds clone() { long ret = bindings.QueryShortChannelIds_clone(this.ptr); QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret); @@ -41,12 +67,18 @@ public class QueryShortChannelIds extends CommonBase { return ret_hu_conv; } + /** + * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write + */ public static Result_QueryShortChannelIdsDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.QueryShortChannelIds_read(ser); Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read + */ public byte[] write() { byte[] ret = bindings.QueryShortChannelIds_write(this.ptr); return ret; diff --git a/src/main/java/org/ldk/structs/ReplyChannelRange.java b/src/main/java/org/ldk/structs/ReplyChannelRange.java index 21934785..ba8ab368 100644 --- a/src/main/java/org/ldk/structs/ReplyChannelRange.java +++ b/src/main/java/org/ldk/structs/ReplyChannelRange.java @@ -5,6 +5,16 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A reply_channel_range message is a reply to a query_channel_range + * message. Multiple reply_channel_range messages can be sent in reply + * to a single query_channel_range message. The query recipient makes a + * best effort to respond based on their local network view which may + * not be a perfect view of the network. The short_channel_ids in the + * reply are encoded. We only support encoding_type=0 uncompressed + * serialization and do not support encoding_type=1 zlib serialization. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ReplyChannelRange extends CommonBase { ReplyChannelRange(Object _dummy, long ptr) { super(ptr); } @@ -14,46 +24,76 @@ public class ReplyChannelRange extends CommonBase { if (ptr != 0) { bindings.ReplyChannelRange_free(ptr); } } + /** + * The genesis hash of the blockchain being queried + */ public byte[] get_chain_hash() { byte[] ret = bindings.ReplyChannelRange_get_chain_hash(this.ptr); return ret; } + /** + * The genesis hash of the blockchain being queried + */ public void set_chain_hash(byte[] val) { bindings.ReplyChannelRange_set_chain_hash(this.ptr, val); } + /** + * The height of the first block in the range of the reply + */ public int get_first_blocknum() { int ret = bindings.ReplyChannelRange_get_first_blocknum(this.ptr); return ret; } + /** + * The height of the first block in the range of the reply + */ public void set_first_blocknum(int val) { bindings.ReplyChannelRange_set_first_blocknum(this.ptr, val); } + /** + * The number of blocks included in the range of the reply + */ public int get_number_of_blocks() { int ret = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr); return ret; } + /** + * The number of blocks included in the range of the reply + */ public void set_number_of_blocks(int val) { bindings.ReplyChannelRange_set_number_of_blocks(this.ptr, val); } + /** + * True when this is the final reply for a query + */ public boolean get_sync_complete() { boolean ret = bindings.ReplyChannelRange_get_sync_complete(this.ptr); return ret; } + /** + * True when this is the final reply for a query + */ public void set_sync_complete(boolean val) { bindings.ReplyChannelRange_set_sync_complete(this.ptr, val); } + /** + * The short_channel_ids in the channel range + */ public void set_short_channel_ids(long[] val) { bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, val); } + /** + * Constructs a new ReplyChannelRange given each field + */ public static ReplyChannelRange constructor_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean sync_complete_arg, long[] short_channel_ids_arg) { long ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg); ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret); @@ -61,6 +101,9 @@ public class ReplyChannelRange extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ReplyChannelRange + */ public ReplyChannelRange clone() { long ret = bindings.ReplyChannelRange_clone(this.ptr); ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret); @@ -68,12 +111,18 @@ public class ReplyChannelRange extends CommonBase { return ret_hu_conv; } + /** + * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write + */ public static Result_ReplyChannelRangeDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ReplyChannelRange_read(ser); Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read + */ public byte[] write() { byte[] ret = bindings.ReplyChannelRange_write(this.ptr); return ret; diff --git a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java index 26098810..dbc3f181 100644 --- a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java +++ b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java @@ -5,6 +5,13 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A reply_short_channel_ids_end message is sent as a reply to a + * query_short_channel_ids message. The query recipient makes a best + * effort to respond based on their local network view which may not be + * a perfect view of the network. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ReplyShortChannelIdsEnd extends CommonBase { ReplyShortChannelIdsEnd(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +21,41 @@ public class ReplyShortChannelIdsEnd extends CommonBase { if (ptr != 0) { bindings.ReplyShortChannelIdsEnd_free(ptr); } } + /** + * The genesis hash of the blockchain that was queried + */ public byte[] get_chain_hash() { byte[] ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr); return ret; } + /** + * The genesis hash of the blockchain that was queried + */ public void set_chain_hash(byte[] val) { bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, val); } + /** + * Indicates if the query recipient maintains up-to-date channel + * information for the chain_hash + */ public boolean get_full_information() { boolean ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this.ptr); return ret; } + /** + * Indicates if the query recipient maintains up-to-date channel + * information for the chain_hash + */ public void set_full_information(boolean val) { bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val); } + /** + * Constructs a new ReplyShortChannelIdsEnd given each field + */ public static ReplyShortChannelIdsEnd constructor_new(byte[] chain_hash_arg, boolean full_information_arg) { long ret = bindings.ReplyShortChannelIdsEnd_new(chain_hash_arg, full_information_arg); ReplyShortChannelIdsEnd ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); @@ -39,6 +63,9 @@ public class ReplyShortChannelIdsEnd extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the ReplyShortChannelIdsEnd + */ public ReplyShortChannelIdsEnd clone() { long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr); ReplyShortChannelIdsEnd ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); @@ -46,12 +73,18 @@ public class ReplyShortChannelIdsEnd extends CommonBase { return ret_hu_conv; } + /** + * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write + */ public static Result_ReplyShortChannelIdsEndDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ReplyShortChannelIdsEnd_read(ser); Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read + */ public byte[] write() { byte[] ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr); return ret; diff --git a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java index b1ade8ba..88b43652 100644 --- a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_AcceptChannelDecodeErrorZ extends CommonBase { private Result_AcceptChannelDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java index 4eb9142f..ade276c5 100644 --- a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { private Result_AnnouncementSignaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java index ad631f5e..67492b6e 100644 --- a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { private Result_BuiltCommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java index dc57ee07..7f680d63 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java index 5daf871c..957c031f 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { 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 1a610732..36b1f356 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 @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { private Result_C2Tuple_SignatureCVec_SignatureZZNoneZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java index 3bc546ff..8d9cee24 100644 --- a/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java b/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java index 8667abc4..768260be 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase { private Result_CVec_CVec_u8ZZNoneZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { 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 c70e7844..b0b5b5b2 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_CVec_SignatureZNoneZ extends CommonBase { private Result_CVec_SignatureZNoneZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java index e47dcd46..f63dc357 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { private Result_CVec_u8ZPeerHandleErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java index d0dd49e1..696d2ab9 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { private Result_ChannelAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java index f58e2d12..d60374a9 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_ChannelConfigDecodeErrorZ extends CommonBase { private Result_ChannelConfigDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java index e8042219..27c90ecb 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { private Result_ChannelFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java index ca7a8b3d..ad262d11 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_ChannelInfoDecodeErrorZ extends CommonBase { private Result_ChannelInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java index 9e2211fb..3b7b6799 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java index 3093a787..09020f0d 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { private Result_ChannelPublicKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java index d13f6583..3b3101da 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java index 49ba747a..c37b5862 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase { private Result_ChannelTransactionParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java index 7609ceac..1a793687 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { private Result_ChannelUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java index b02b6924..1487c9f1 100644 --- a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_ClosingSignedDecodeErrorZ extends CommonBase { private Result_ClosingSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java index da17497b..1bb9e9dd 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { private Result_CommitmentSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java index 43d4745b..7243885f 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { private Result_CommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java index aa3bc8e4..02c8d680 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends CommonBase { private Result_CounterpartyChannelTransactionParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java index ae050e88..72ec37c7 100644 --- a/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { private Result_DirectionalChannelInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java index cd2383b4..71efe0fc 100644 --- a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java index 026c7f18..9c39d4cc 100644 --- a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_FundingCreatedDecodeErrorZ extends CommonBase { private Result_FundingCreatedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java index c43294ab..7db0a540 100644 --- a/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_FundingLockedDecodeErrorZ extends CommonBase { private Result_FundingLockedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java index aaa7de2d..ec53a85c 100644 --- a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_FundingSignedDecodeErrorZ extends CommonBase { private Result_FundingSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java index 85b872b0..0e59d061 100644 --- a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java index b9a23fb4..4e64e1f7 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { private Result_HTLCOutputInCommitmentDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java index 73b3d202..05b4f2a3 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { private Result_HTLCUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java index 1aefd3d2..7794fb95 100644 --- a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { private Result_HolderCommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java index 997fd164..98246464 100644 --- a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_InMemorySignerDecodeErrorZ extends CommonBase { private Result_InMemorySignerDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java index d492d9a5..77275658 100644 --- a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java index fd401383..cee609a3 100644 --- a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_InitFeaturesDecodeErrorZ extends CommonBase { private Result_InitFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java b/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java index a2aa53da..1149eb98 100644 --- a/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java +++ b/src/main/java/org/ldk/structs/Result_NetAddressu8Z.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java index 5d626453..da4e3b6d 100644 --- a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java index 5c10a66e..9fb06a72 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { private Result_NodeAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java index ef954886..611d7056 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java index bc6d6682..ed1d3a27 100644 --- a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { private Result_NodeFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java index 11e99111..a6f8fcb9 100644 --- a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java index 2eaacd34..a296d091 100644 --- a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_NoneAPIErrorZ extends CommonBase { private Result_NoneAPIErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java b/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java index 5d8da12c..3e9f075b 100644 --- a/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { private Result_NoneChannelMonitorUpdateErrZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java index 436be322..292df093 100644 --- a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java index 9ab9611c..89dce235 100644 --- a/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_NoneMonitorUpdateErrorZ extends CommonBase { private Result_NoneMonitorUpdateErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java index d0ed47a4..8f9e933d 100644 --- a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_NonePaymentSendFailureZ extends CommonBase { private Result_NonePaymentSendFailureZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java index 6c934091..3377e161 100644 --- a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_NonePeerHandleErrorZ extends CommonBase { private Result_NonePeerHandleErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java index e8915617..5c602126 100644 --- a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_OpenChannelDecodeErrorZ extends CommonBase { private Result_OpenChannelDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java index 8f59f086..5eb6d70c 100644 --- a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_OutPointDecodeErrorZ extends CommonBase { private Result_OutPointDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java index 90c10d26..df3b1456 100644 --- a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java index c89904e9..2d33ea87 100644 --- a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java b/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java index f941cd25..3a9df4d2 100644 --- a/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_PublicKeyErrorZ extends CommonBase { private Result_PublicKeyErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java index 1bfd4620..ee14d952 100644 --- a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java index b903ae3d..4219737f 100644 --- a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java index 3b3fb958..1130bb0d 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java index 397f04ad..baf5aab7 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java index 207f5b7c..fd9181c1 100644 --- a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { private Result_RevokeAndACKDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java index 601e81e1..d716f532 100644 --- a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java index 73c74bbc..fa9ab976 100644 --- a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_RouteLightningErrorZ extends CommonBase { private Result_RouteLightningErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java index 1f190465..f58be065 100644 --- a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java b/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java index 1d323536..f643ad9a 100644 --- a/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_SecretKeyErrorZ extends CommonBase { private Result_SecretKeyErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java index c696120f..c71735d6 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_ShutdownDecodeErrorZ extends CommonBase { private Result_ShutdownDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java index b5b33d5a..652daf48 100644 --- a/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_SignDecodeErrorZ extends CommonBase { private Result_SignDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java b/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java index 304cbd86..8e7bb2e0 100644 --- a/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_SignatureNoneZ extends CommonBase { private Result_SignatureNoneZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java index c5f99935..3fd3ca6f 100644 --- a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java index d03b5284..c70799b2 100644 --- a/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_TransactionNoneZ extends CommonBase { private Result_TransactionNoneZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java index 46172256..54375f1a 100644 --- a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java index f1f5d238..5f181b45 100644 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { private Result_TxCreationKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java index 3d951aa9..3c33cd42 100644 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_TxCreationKeysErrorZ extends CommonBase { private Result_TxCreationKeysErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java b/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java index e4851630..84965342 100644 --- a/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_TxOutAccessErrorZ extends CommonBase { private Result_TxOutAccessErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java index 325541d2..a8b2d9f8 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java index 7dbeefc4..23a6f102 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java index 0e981e5b..9512afc7 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java @@ -5,7 +5,6 @@ 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 { diff --git a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java index 83251e55..8fb56e96 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { private Result_UpdateAddHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java index 77ebe7ed..42d39389 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { private Result_UpdateFailHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java index 0cedc44c..b1194604 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { private Result_UpdateFailMalformedHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java index 05d4a28a..c023933b 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_UpdateFeeDecodeErrorZ extends CommonBase { private Result_UpdateFeeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java index fb60f5e0..364d732e 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { private Result_UpdateFulfillHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java index 4519dd15..c3aab0c6 100644 --- a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_boolLightningErrorZ extends CommonBase { private Result_boolLightningErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java index 014c611c..461cbad7 100644 --- a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Result_boolPeerHandleErrorZ extends CommonBase { private Result_boolPeerHandleErrorZ(Object _dummy, long ptr) { super(ptr); } protected void finalize() throws Throwable { diff --git a/src/main/java/org/ldk/structs/RevokeAndACK.java b/src/main/java/org/ldk/structs/RevokeAndACK.java index 80fe9b59..8737d5f2 100644 --- a/src/main/java/org/ldk/structs/RevokeAndACK.java +++ b/src/main/java/org/ldk/structs/RevokeAndACK.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A revoke_and_ack message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class RevokeAndACK extends CommonBase { RevokeAndACK(Object _dummy, long ptr) { super(ptr); } @@ -14,33 +18,54 @@ public class RevokeAndACK extends CommonBase { if (ptr != 0) { bindings.RevokeAndACK_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.RevokeAndACK_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.RevokeAndACK_set_channel_id(this.ptr, val); } + /** + * The secret corresponding to the per-commitment point + */ public byte[] get_per_commitment_secret() { byte[] ret = bindings.RevokeAndACK_get_per_commitment_secret(this.ptr); return ret; } + /** + * The secret corresponding to the per-commitment point + */ public void set_per_commitment_secret(byte[] val) { bindings.RevokeAndACK_set_per_commitment_secret(this.ptr, val); } + /** + * The next sender-broadcast commitment transaction's per-commitment point + */ public byte[] get_next_per_commitment_point() { byte[] ret = bindings.RevokeAndACK_get_next_per_commitment_point(this.ptr); return ret; } + /** + * The next sender-broadcast commitment transaction's per-commitment point + */ public void set_next_per_commitment_point(byte[] val) { bindings.RevokeAndACK_set_next_per_commitment_point(this.ptr, val); } + /** + * Constructs a new RevokeAndACK given each field + */ public static RevokeAndACK constructor_new(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg) { long ret = bindings.RevokeAndACK_new(channel_id_arg, per_commitment_secret_arg, next_per_commitment_point_arg); RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret); @@ -48,6 +73,9 @@ public class RevokeAndACK extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the RevokeAndACK + */ public RevokeAndACK clone() { long ret = bindings.RevokeAndACK_clone(this.ptr); RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret); @@ -55,11 +83,17 @@ public class RevokeAndACK extends CommonBase { return ret_hu_conv; } + /** + * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read + */ public byte[] write() { byte[] ret = bindings.RevokeAndACK_write(this.ptr); return ret; } + /** + * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write + */ public static Result_RevokeAndACKDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.RevokeAndACK_read(ser); Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/Route.java b/src/main/java/org/ldk/structs/Route.java index a05f15b6..c4d4d81f 100644 --- a/src/main/java/org/ldk/structs/Route.java +++ b/src/main/java/org/ldk/structs/Route.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP, + * it can take multiple paths. Each path is composed of one or more hops through the network. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Route extends CommonBase { Route(Object _dummy, long ptr) { super(ptr); } @@ -14,11 +19,22 @@ public class Route extends CommonBase { if (ptr != 0) { bindings.Route_free(ptr); } } + /** + * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the + * last RouteHop in each path must be the same. + * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the + * destination. Thus, this must always be at least length one. While the maximum length of any + * given path is variable, keeping the length of any path to less than 20 should currently + * ensure it is viable. + */ public void set_paths(RouteHop[][] val) { bindings.Route_set_paths(this.ptr, Arrays.stream(val).map(val_conv_12 -> Arrays.stream(val_conv_12).mapToLong(val_conv_12_conv_10 -> val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr & ~1).toArray()).toArray(long[][]::new)); /* TODO 2 RouteHop[] */; } + /** + * Constructs a new Route given each field + */ public static Route constructor_new(RouteHop[][] paths_arg) { long ret = bindings.Route_new(Arrays.stream(paths_arg).map(paths_arg_conv_12 -> Arrays.stream(paths_arg_conv_12).mapToLong(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr & ~1).toArray()).toArray(long[][]::new)); Route ret_hu_conv = new Route(null, ret); @@ -27,6 +43,9 @@ public class Route extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the Route + */ public Route clone() { long ret = bindings.Route_clone(this.ptr); Route ret_hu_conv = new Route(null, ret); @@ -34,11 +53,17 @@ public class Route extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Route object into a byte array which can be read by Route_read + */ public byte[] write() { byte[] ret = bindings.Route_write(this.ptr); return ret; } + /** + * Read a Route from a byte array, created by Route_write + */ public static Result_RouteDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.Route_read(ser); Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/RouteHint.java b/src/main/java/org/ldk/structs/RouteHint.java index fc1e4249..d2bc2616 100644 --- a/src/main/java/org/ldk/structs/RouteHint.java +++ b/src/main/java/org/ldk/structs/RouteHint.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A channel descriptor which provides a last-hop route to get_route + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class RouteHint extends CommonBase { RouteHint(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,39 @@ public class RouteHint extends CommonBase { if (ptr != 0) { bindings.RouteHint_free(ptr); } } + /** + * The node_id of the non-target end of the route + */ public byte[] get_src_node_id() { byte[] ret = bindings.RouteHint_get_src_node_id(this.ptr); return ret; } + /** + * The node_id of the non-target end of the route + */ public void set_src_node_id(byte[] val) { bindings.RouteHint_set_src_node_id(this.ptr, val); } + /** + * The short_channel_id of this channel + */ public long get_short_channel_id() { long ret = bindings.RouteHint_get_short_channel_id(this.ptr); return ret; } + /** + * The short_channel_id of this channel + */ public void set_short_channel_id(long val) { bindings.RouteHint_set_short_channel_id(this.ptr, val); } + /** + * The fees which must be paid to use this channel + */ public RoutingFees get_fees() { long ret = bindings.RouteHint_get_fees(this.ptr); RoutingFees ret_hu_conv = new RoutingFees(null, ret); @@ -39,20 +58,32 @@ public class RouteHint extends CommonBase { return ret_hu_conv; } + /** + * The fees which must be paid to use this channel + */ public void set_fees(RoutingFees val) { bindings.RouteHint_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * The difference in CLTV values between this node and the next node. + */ public short get_cltv_expiry_delta() { short ret = bindings.RouteHint_get_cltv_expiry_delta(this.ptr); return ret; } + /** + * The difference in CLTV values between this node and the next node. + */ public void set_cltv_expiry_delta(short val) { bindings.RouteHint_set_cltv_expiry_delta(this.ptr, val); } + /** + * Creates a copy of the RouteHint + */ public RouteHint clone() { long ret = bindings.RouteHint_clone(this.ptr); RouteHint ret_hu_conv = new RouteHint(null, ret); diff --git a/src/main/java/org/ldk/structs/RouteHop.java b/src/main/java/org/ldk/structs/RouteHop.java index 1e36ed59..2c301f7d 100644 --- a/src/main/java/org/ldk/structs/RouteHop.java +++ b/src/main/java/org/ldk/structs/RouteHop.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A hop in a route + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class RouteHop extends CommonBase { RouteHop(Object _dummy, long ptr) { super(ptr); } @@ -14,15 +18,25 @@ public class RouteHop extends CommonBase { if (ptr != 0) { bindings.RouteHop_free(ptr); } } + /** + * The node_id of the node at this hop. + */ public byte[] get_pubkey() { byte[] ret = bindings.RouteHop_get_pubkey(this.ptr); return ret; } + /** + * The node_id of the node at this hop. + */ public void set_pubkey(byte[] val) { bindings.RouteHop_set_pubkey(this.ptr, val); } + /** + * The node_announcement features of the node at this hop. For the last hop, these may be + * amended to match the features present in the invoice this node generated. + */ public NodeFeatures get_node_features() { long ret = bindings.RouteHop_get_node_features(this.ptr); NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); @@ -30,20 +44,34 @@ public class RouteHop extends CommonBase { return ret_hu_conv; } + /** + * The node_announcement features of the node at this hop. For the last hop, these may be + * amended to match the features present in the invoice this node generated. + */ 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); } + /** + * The channel that should be used from the previous hop to reach this node. + */ public long get_short_channel_id() { long ret = bindings.RouteHop_get_short_channel_id(this.ptr); return ret; } + /** + * The channel that should be used from the previous hop to reach this node. + */ public void set_short_channel_id(long val) { bindings.RouteHop_set_short_channel_id(this.ptr, val); } + /** + * The channel_announcement features of the channel that should be used from the previous hop + * to reach this node. + */ public ChannelFeatures get_channel_features() { long ret = bindings.RouteHop_get_channel_features(this.ptr); ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret); @@ -51,29 +79,54 @@ public class RouteHop extends CommonBase { return ret_hu_conv; } + /** + * The channel_announcement features of the channel that should be used from the previous hop + * to reach this node. + */ 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); } + /** + * The fee taken on this hop (for paying for the use of the *next* channel in the path). + * For the last hop, this should be the full value of the payment (might be more than + * requested if we had to match htlc_minimum_msat). + */ public long get_fee_msat() { long ret = bindings.RouteHop_get_fee_msat(this.ptr); return ret; } + /** + * The fee taken on this hop (for paying for the use of the *next* channel in the path). + * For the last hop, this should be the full value of the payment (might be more than + * requested if we had to match htlc_minimum_msat). + */ public void set_fee_msat(long val) { bindings.RouteHop_set_fee_msat(this.ptr, val); } + /** + * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value + * expected at the destination, in excess of the current block height. + */ public int get_cltv_expiry_delta() { int ret = bindings.RouteHop_get_cltv_expiry_delta(this.ptr); return ret; } + /** + * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value + * expected at the destination, in excess of the current block height. + */ public void set_cltv_expiry_delta(int val) { bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val); } + /** + * Constructs a new RouteHop given each field + */ 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); @@ -83,6 +136,9 @@ public class RouteHop extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the RouteHop + */ public RouteHop clone() { long ret = bindings.RouteHop_clone(this.ptr); RouteHop ret_hu_conv = new RouteHop(null, ret); diff --git a/src/main/java/org/ldk/structs/RoutingFees.java b/src/main/java/org/ldk/structs/RoutingFees.java index da1c5c48..eee3ca20 100644 --- a/src/main/java/org/ldk/structs/RoutingFees.java +++ b/src/main/java/org/ldk/structs/RoutingFees.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Fees for routing via a given channel or a node + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class RoutingFees extends CommonBase { RoutingFees(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,41 @@ public class RoutingFees extends CommonBase { if (ptr != 0) { bindings.RoutingFees_free(ptr); } } + /** + * Flat routing fee in satoshis + */ public int get_base_msat() { int ret = bindings.RoutingFees_get_base_msat(this.ptr); return ret; } + /** + * Flat routing fee in satoshis + */ public void set_base_msat(int val) { bindings.RoutingFees_set_base_msat(this.ptr, val); } + /** + * Liquidity-based routing fee in millionths of a routed amount. + * In other words, 10000 is 1%. + */ public int get_proportional_millionths() { int ret = bindings.RoutingFees_get_proportional_millionths(this.ptr); return ret; } + /** + * Liquidity-based routing fee in millionths of a routed amount. + * In other words, 10000 is 1%. + */ public void set_proportional_millionths(int val) { bindings.RoutingFees_set_proportional_millionths(this.ptr, val); } + /** + * Constructs a new RoutingFees given each field + */ public static RoutingFees constructor_new(int base_msat_arg, int proportional_millionths_arg) { long ret = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg); RoutingFees ret_hu_conv = new RoutingFees(null, ret); @@ -39,6 +60,9 @@ public class RoutingFees extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the RoutingFees + */ public RoutingFees clone() { long ret = bindings.RoutingFees_clone(this.ptr); RoutingFees ret_hu_conv = new RoutingFees(null, ret); @@ -46,12 +70,18 @@ public class RoutingFees extends CommonBase { return ret_hu_conv; } + /** + * Read a RoutingFees from a byte array, created by RoutingFees_write + */ public static Result_RoutingFeesDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.RoutingFees_read(ser); Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read + */ public byte[] write() { byte[] ret = bindings.RoutingFees_write(this.ptr); return ret; diff --git a/src/main/java/org/ldk/structs/RoutingMessageHandler.java b/src/main/java/org/ldk/structs/RoutingMessageHandler.java index 4efd6b24..2ca68de1 100644 --- a/src/main/java/org/ldk/structs/RoutingMessageHandler.java +++ b/src/main/java/org/ldk/structs/RoutingMessageHandler.java @@ -5,6 +5,15 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * A trait to describe an object which can receive routing messages. + * + * # Implementor DoS Warnings + * + * For `gossip_queries` messages there are potential DoS vectors when handling + * inbound queries. Implementors using an on-disk network graph should be aware of + * repeated disk I/O for queries accessing different parts of the network graph. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class RoutingMessageHandler extends CommonBase { final bindings.LDKRoutingMessageHandler bindings_instance; @@ -21,16 +30,66 @@ public class RoutingMessageHandler extends CommonBase { } public static interface RoutingMessageHandlerInterface { + /** + * Handle an incoming node_announcement message, returning true if it should be forwarded on, + * false or returning an Err otherwise. + */ Result_boolLightningErrorZ handle_node_announcement(NodeAnnouncement msg); + /** + * Handle a channel_announcement message, returning true if it should be forwarded on, false + * or returning an Err otherwise. + */ Result_boolLightningErrorZ handle_channel_announcement(ChannelAnnouncement msg); + /** + * Handle an incoming channel_update message, returning true if it should be forwarded on, + * false or returning an Err otherwise. + */ Result_boolLightningErrorZ handle_channel_update(ChannelUpdate msg); + /** + * Handle some updates to the route graph that we learned due to an outbound failed payment. + */ void handle_htlc_fail_channel_update(HTLCFailChannelUpdate update); + /** + * Gets a subset of the channel announcements and updates required to dump our routing table + * to a remote node, starting at the short_channel_id indicated by starting_point and + * including the batch_amount entries immediately higher in numerical value than starting_point. + */ ThreeTuple[] get_next_channel_announcements(long starting_point, byte batch_amount); + /** + * Gets a subset of the node announcements required to dump our routing table to a remote node, + * starting at the node *after* the provided publickey and including batch_amount entries + * immediately higher (as defined by ::cmp) than starting_point. + * If None is provided for starting_point, we start at the first node. + */ NodeAnnouncement[] get_next_node_announcements(byte[] starting_point, byte batch_amount); + /** + * Called when a connection is established with a peer. This can be used to + * perform routing table synchronization using a strategy defined by the + * implementor. + */ void sync_routing_table(byte[] their_node_id, Init init); + /** + * Handles the reply of a query we initiated to learn about channels + * for a given range of blocks. We can expect to receive one or more + * replies to a single query. + */ Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, ReplyChannelRange msg); + /** + * Handles the reply of a query we initiated asking for routing gossip + * messages for a list of channels. We should receive this message when + * a node has completed its best effort to send us the pertaining routing + * gossip messages. + */ Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, ReplyShortChannelIdsEnd msg); + /** + * Handles when a peer asks us to send a list of short_channel_ids + * for the requested range of blocks. + */ Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, QueryChannelRange msg); + /** + * Handles when a peer asks us to send routing gossip messages for a + * list of short_channel_ids. + */ Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, QueryShortChannelIds msg); } private static class LDKRoutingMessageHandlerHolder { RoutingMessageHandler held; } @@ -106,6 +165,10 @@ public class RoutingMessageHandler extends CommonBase { }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance); return impl_holder.held; } + /** + * Handle an incoming node_announcement message, returning true if it should be forwarded on, + * false or returning an Err otherwise. + */ 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); @@ -113,6 +176,10 @@ public class RoutingMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Handle a channel_announcement message, returning true if it should be forwarded on, false + * or returning an Err otherwise. + */ 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); @@ -120,6 +187,10 @@ public class RoutingMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Handle an incoming channel_update message, returning true if it should be forwarded on, + * false or returning an Err otherwise. + */ 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); @@ -127,11 +198,19 @@ public class RoutingMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Handle some updates to the route graph that we learned due to an outbound failed payment. + */ public void handle_htlc_fail_channel_update(HTLCFailChannelUpdate update) { bindings.RoutingMessageHandler_handle_htlc_fail_channel_update(this.ptr, update == null ? 0 : update.ptr & ~1); this.ptrs_to.add(update); } + /** + * Gets a subset of the channel announcements and updates required to dump our routing table + * to a remote node, starting at the short_channel_id indicated by starting_point and + * including the batch_amount entries immediately higher in numerical value than starting_point. + */ public ThreeTuple[] get_next_channel_announcements(long starting_point, byte batch_amount) { long[] ret = bindings.RoutingMessageHandler_get_next_channel_announcements(this.ptr, starting_point, batch_amount); ThreeTuple[] ret_conv_63_arr = new ThreeTuple[ret.length]; @@ -157,6 +236,12 @@ public class RoutingMessageHandler extends CommonBase { return ret_conv_63_arr; } + /** + * Gets a subset of the node announcements required to dump our routing table to a remote node, + * starting at the node *after* the provided publickey and including batch_amount entries + * immediately higher (as defined by ::cmp) than starting_point. + * If None is provided for starting_point, we start at the first node. + */ public NodeAnnouncement[] get_next_node_announcements(byte[] starting_point, byte batch_amount) { long[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, starting_point, batch_amount); NodeAnnouncement[] ret_conv_18_arr = new NodeAnnouncement[ret.length]; @@ -169,11 +254,21 @@ public class RoutingMessageHandler extends CommonBase { return ret_conv_18_arr; } + /** + * Called when a connection is established with a peer. This can be used to + * perform routing table synchronization using a strategy defined by the + * implementor. + */ 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); } + /** + * Handles the reply of a query we initiated to learn about channels + * for a given range of blocks. We can expect to receive one or more + * replies to a single query. + */ 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); @@ -181,6 +276,12 @@ public class RoutingMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Handles the reply of a query we initiated asking for routing gossip + * messages for a list of channels. We should receive this message when + * a node has completed its best effort to send us the pertaining routing + * gossip messages. + */ 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); @@ -188,6 +289,10 @@ public class RoutingMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Handles when a peer asks us to send a list of short_channel_ids + * for the requested range of blocks. + */ 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); @@ -195,6 +300,10 @@ public class RoutingMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Handles when a peer asks us to send routing gossip messages for a + * list of short_channel_ids. + */ 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); diff --git a/src/main/java/org/ldk/structs/Shutdown.java b/src/main/java/org/ldk/structs/Shutdown.java index ec11fcc0..b5758973 100644 --- a/src/main/java/org/ldk/structs/Shutdown.java +++ b/src/main/java/org/ldk/structs/Shutdown.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A shutdown message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Shutdown extends CommonBase { Shutdown(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,41 @@ public class Shutdown extends CommonBase { if (ptr != 0) { bindings.Shutdown_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.Shutdown_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.Shutdown_set_channel_id(this.ptr, val); } + /** + * The destination of this peer's funds on closing. + * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh. + */ public byte[] get_scriptpubkey() { byte[] ret = bindings.Shutdown_get_scriptpubkey(this.ptr); return ret; } + /** + * The destination of this peer's funds on closing. + * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh. + */ public void set_scriptpubkey(byte[] val) { bindings.Shutdown_set_scriptpubkey(this.ptr, val); } + /** + * Constructs a new Shutdown given each field + */ public static Shutdown constructor_new(byte[] channel_id_arg, byte[] scriptpubkey_arg) { long ret = bindings.Shutdown_new(channel_id_arg, scriptpubkey_arg); Shutdown ret_hu_conv = new Shutdown(null, ret); @@ -39,6 +60,9 @@ public class Shutdown extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the Shutdown + */ public Shutdown clone() { long ret = bindings.Shutdown_clone(this.ptr); Shutdown ret_hu_conv = new Shutdown(null, ret); @@ -46,11 +70,17 @@ public class Shutdown extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Shutdown object into a byte array which can be read by Shutdown_read + */ public byte[] write() { byte[] ret = bindings.Shutdown_write(this.ptr); return ret; } + /** + * Read a Shutdown from a byte array, created by Shutdown_write + */ public static Result_ShutdownDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.Shutdown_read(ser); Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/Sign.java b/src/main/java/org/ldk/structs/Sign.java index 1ab9848a..0e9edf7c 100644 --- a/src/main/java/org/ldk/structs/Sign.java +++ b/src/main/java/org/ldk/structs/Sign.java @@ -5,6 +5,25 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * A trait to sign lightning channel transactions as described in BOLT 3. + * + * Signing services could be implemented on a hardware wallet. In this case, + * the current Sign would be a front-end on top of a communication + * channel connected to your secure device and lightning key material wouldn't + * reside on a hot server. Nevertheless, a this deployment would still need + * to trust the ChannelManager to avoid loss of funds as this latest component + * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys. + * + * A more secure iteration would be to use hashlock (or payment points) to pair + * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager + * at the price of more state and computation on the hardware wallet side. In the future, + * we are looking forward to design such interface. + * + * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted + * to act, as liveness and breach reply correctness are always going to be hard requirements + * of LN security model, orthogonal of key management issues. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Sign extends CommonBase { final bindings.LDKSign bindings_instance; @@ -21,16 +40,122 @@ public class Sign extends CommonBase { } public static interface SignInterface { + /** + * Gets the per-commitment point for a specific commitment number + * + * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + */ byte[] get_per_commitment_point(long idx); + /** + * Gets the commitment secret for a specific commitment number as part of the revocation process + * + * An external signer implementation should error here if the commitment was already signed + * and should refuse to sign it in the future. + * + * May be called more than once for the same index. + * + * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + */ byte[] release_commitment_secret(long idx); + /** + * Gets an arbitrary identifier describing the set of keys which are provided back to you in + * some SpendableOutputDescriptor types. This should be sufficient to identify this + * Sign object uniquely and lookup or re-derive its keys. + */ byte[] channel_keys_id(); + /** + * Create a signature for a counterparty's commitment transaction and associated HTLC transactions. + * + * Note that if signing fails or is rejected, the channel will be force-closed. + */ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx); + /** + * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions. + * This will only ever be called with a non-revoked commitment_tx. This will be called with the + * latest commitment_tx when we initiate a force-close. + * This will be called with the previous latest, just to get claiming HTLC signatures, if we are + * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to + * the latest. + * This may be called multiple times for the same transaction. + * + * An external signer implementation should check that the commitment has not been revoked. + * + * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case. + */ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx); + /** + * Create a signature for the given input in a transaction spending an HTLC or commitment + * transaction output when our counterparty broadcasts an old state. + * + * A justice transaction may claim multiples outputs at the same time if timelocks are + * similar, but only a signature for the input at index `input` should be signed for here. + * It may be called multiples time for same output(s) if a fee-bump is needed with regards + * to an upcoming timelock expiration. + * + * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * + * per_commitment_key is revocation secret which was provided by our counterparty when they + * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does + * not allow the spending of any funds by itself (you need our holder revocation_secret to do + * so). + * + * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus + * changing the format of the witness script (which is committed to in the BIP 143 + * signatures). + */ Result_SignatureNoneZ sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc); + /** + * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment + * transaction, either offered or received. + * + * Such a transaction may claim multiples offered outputs at same time if we know the + * preimage for each when we create it, but only the input at index `input` should be + * signed for here. It may be called multiple times for same output(s) if a fee-bump is + * needed with regards to an upcoming timelock expiration. + * + * Witness_script is either a offered or received script as defined in BOLT3 for HTLC + * outputs. + * + * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * + * Per_commitment_point is the dynamic point corresponding to the channel state + * detected onchain. It has been generated by our counterparty and is used to derive + * channel state keys, which are then included in the witness script and committed to in the + * BIP 143 signature. + */ Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc); + /** + * Create a signature for a (proposed) closing transaction. + * + * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have + * chosen to forgo their output as dust. + */ Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx); + /** + * Signs a channel announcement message with our funding key, proving it comes from one + * of the channel participants. + * + * Note that if this fails or is rejected, the channel will not be publicly announced and + * our counterparty may (though likely will not) close the channel on us for violating the + * protocol. + */ Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg); + /** + * Set the counterparty static channel data, including basepoints, + * counterparty_selected/holder_selected_contest_delay and funding outpoint. + * This is done as soon as the funding outpoint is known. Since these are static channel data, + * they MUST NOT be allowed to change to different values once set. + * + * channel_parameters.is_populated() MUST be true. + * + * We bind holder_selected_contest_delay late here for API convenience. + * + * Will be called before any signatures are applied. + */ void ready_channel(ChannelTransactionParameters channel_parameters); + /** + * Serialize the object into a byte array + */ byte[] write(); } private static class LDKSignHolder { Sign held; } @@ -95,21 +220,46 @@ public class Sign extends CommonBase { }, pubkeys); return impl_holder.held; } + /** + * Gets the per-commitment point for a specific commitment number + * + * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + */ public byte[] get_per_commitment_point(long idx) { byte[] ret = bindings.Sign_get_per_commitment_point(this.ptr, idx); return ret; } + /** + * Gets the commitment secret for a specific commitment number as part of the revocation process + * + * An external signer implementation should error here if the commitment was already signed + * and should refuse to sign it in the future. + * + * May be called more than once for the same index. + * + * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + */ public byte[] release_commitment_secret(long idx) { byte[] ret = bindings.Sign_release_commitment_secret(this.ptr, idx); return ret; } + /** + * Gets an arbitrary identifier describing the set of keys which are provided back to you in + * some SpendableOutputDescriptor types. This should be sufficient to identify this + * Sign object uniquely and lookup or re-derive its keys. + */ public byte[] channel_keys_id() { byte[] ret = bindings.Sign_channel_keys_id(this.ptr); return ret; } + /** + * Create a signature for a counterparty's commitment transaction and associated HTLC transactions. + * + * Note that if signing fails or is rejected, the channel will be force-closed. + */ public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx) { long ret = bindings.Sign_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); @@ -117,6 +267,19 @@ public class Sign extends CommonBase { return ret_hu_conv; } + /** + * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions. + * This will only ever be called with a non-revoked commitment_tx. This will be called with the + * latest commitment_tx when we initiate a force-close. + * This will be called with the previous latest, just to get claiming HTLC signatures, if we are + * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to + * the latest. + * This may be called multiple times for the same transaction. + * + * An external signer implementation should check that the commitment has not been revoked. + * + * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case. + */ public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx) { long ret = bindings.Sign_sign_holder_commitment_and_htlcs(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); @@ -124,6 +287,26 @@ public class Sign extends CommonBase { return ret_hu_conv; } + /** + * Create a signature for the given input in a transaction spending an HTLC or commitment + * transaction output when our counterparty broadcasts an old state. + * + * A justice transaction may claim multiples outputs at the same time if timelocks are + * similar, but only a signature for the input at index `input` should be signed for here. + * It may be called multiples time for same output(s) if a fee-bump is needed with regards + * to an upcoming timelock expiration. + * + * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * + * per_commitment_key is revocation secret which was provided by our counterparty when they + * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does + * not allow the spending of any funds by itself (you need our holder revocation_secret to do + * so). + * + * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus + * changing the format of the witness script (which is committed to in the BIP 143 + * signatures). + */ public Result_SignatureNoneZ sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc) { long ret = bindings.Sign_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); @@ -131,6 +314,25 @@ public class Sign extends CommonBase { return ret_hu_conv; } + /** + * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment + * transaction, either offered or received. + * + * Such a transaction may claim multiples offered outputs at same time if we know the + * preimage for each when we create it, but only the input at index `input` should be + * signed for here. It may be called multiple times for same output(s) if a fee-bump is + * needed with regards to an upcoming timelock expiration. + * + * Witness_script is either a offered or received script as defined in BOLT3 for HTLC + * outputs. + * + * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * + * Per_commitment_point is the dynamic point corresponding to the channel state + * detected onchain. It has been generated by our counterparty and is used to derive + * channel state keys, which are then included in the witness script and committed to in the + * BIP 143 signature. + */ public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc) { long ret = bindings.Sign_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); @@ -138,12 +340,26 @@ public class Sign extends CommonBase { return ret_hu_conv; } + /** + * Create a signature for a (proposed) closing transaction. + * + * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have + * chosen to forgo their output as dust. + */ public Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx) { long ret = bindings.Sign_sign_closing_transaction(this.ptr, closing_tx); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Signs a channel announcement message with our funding key, proving it comes from one + * of the channel participants. + * + * Note that if this fails or is rejected, the channel will not be publicly announced and + * our counterparty may (though likely will not) close the channel on us for violating the + * protocol. + */ public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) { long ret = bindings.Sign_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); @@ -151,16 +367,35 @@ public class Sign extends CommonBase { return ret_hu_conv; } + /** + * Set the counterparty static channel data, including basepoints, + * counterparty_selected/holder_selected_contest_delay and funding outpoint. + * This is done as soon as the funding outpoint is known. Since these are static channel data, + * they MUST NOT be allowed to change to different values once set. + * + * channel_parameters.is_populated() MUST be true. + * + * We bind holder_selected_contest_delay late here for API convenience. + * + * Will be called before any signatures are applied. + */ public void ready_channel(ChannelTransactionParameters channel_parameters) { bindings.Sign_ready_channel(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr & ~1); this.ptrs_to.add(channel_parameters); } + /** + * Serialize the object into a byte array + */ public byte[] write() { byte[] ret = bindings.Sign_write(this.ptr); return ret; } + /** + * Frees any resources associated with this object given its this_arg pointer. + * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + */ public ChannelPublicKeys get_pubkeys() { long ret = bindings.Sign_get_pubkeys(this.ptr); ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); @@ -168,6 +403,9 @@ public class Sign extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of a Sign + */ public Sign clone() { long ret = bindings.Sign_clone(this.ptr); Sign ret_hu_conv = new Sign(null, ret); diff --git a/src/main/java/org/ldk/structs/SocketDescriptor.java b/src/main/java/org/ldk/structs/SocketDescriptor.java index 40dfc014..7c993305 100644 --- a/src/main/java/org/ldk/structs/SocketDescriptor.java +++ b/src/main/java/org/ldk/structs/SocketDescriptor.java @@ -5,6 +5,19 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * Provides an object which can be used to send data to and which uniquely identifies a connection + * to a remote host. You will need to be able to generate multiple of these which meet Eq and + * implement Hash to meet the PeerManager API. + * + * For efficiency, Clone should be relatively cheap for this type. + * + * You probably want to just extend an int and put a file descriptor in a struct and implement + * send_data. Note that if you are using a higher-level net library that may call close() itself, + * be careful to ensure you don't have races whereby you might register a new connection with an + * fd which is the same as a previous one which has yet to be removed via + * PeerManager::socket_disconnected(). + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class SocketDescriptor extends CommonBase { final bindings.LDKSocketDescriptor bindings_instance; @@ -20,9 +33,39 @@ public class SocketDescriptor extends CommonBase { } public static interface SocketDescriptorInterface { + /** + * Attempts to send some data from the given slice to the peer. + * + * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected. + * Note that in the disconnected case, socket_disconnected must still fire and further write + * attempts may occur until that time. + * + * If the returned size is smaller than data.len(), a write_available event must + * trigger the next time more data can be written. Additionally, until the a send_data event + * completes fully, no further read_events should trigger on the same peer! + * + * If a read_event on this descriptor had previously returned true (indicating that read + * events should be paused to prevent DoS in the send buffer), resume_read may be set + * indicating that read events on this descriptor should resume. A resume_read of false does + * not* imply that further read events should be paused. + */ long send_data(byte[] data, boolean resume_read); + /** + * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no + * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with + * this descriptor. No socket_disconnected call should be generated as a result of this call, + * though races may occur whereby disconnect_socket is called after a call to + * socket_disconnected but prior to socket_disconnected returning. + */ void disconnect_socket(); + /** + * Checks if two objects are equal given this object's this_arg pointer and another object. + */ boolean eq(SocketDescriptor other_arg); + /** + * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer. + * This is used, for example, for inclusion of this object in a hash map. + */ long hash(); } private static class LDKSocketDescriptorHolder { SocketDescriptor held; } @@ -49,20 +92,50 @@ public class SocketDescriptor extends CommonBase { }); return impl_holder.held; } + /** + * Attempts to send some data from the given slice to the peer. + * + * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected. + * Note that in the disconnected case, socket_disconnected must still fire and further write + * attempts may occur until that time. + * + * If the returned size is smaller than data.len(), a write_available event must + * trigger the next time more data can be written. Additionally, until the a send_data event + * completes fully, no further read_events should trigger on the same peer! + * + * If a read_event on this descriptor had previously returned true (indicating that read + * events should be paused to prevent DoS in the send buffer), resume_read may be set + * indicating that read events on this descriptor should resume. A resume_read of false does + * not* imply that further read events should be paused. + */ public long send_data(byte[] data, boolean resume_read) { long ret = bindings.SocketDescriptor_send_data(this.ptr, data, resume_read); return ret; } + /** + * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no + * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with + * this descriptor. No socket_disconnected call should be generated as a result of this call, + * though races may occur whereby disconnect_socket is called after a call to + * socket_disconnected but prior to socket_disconnected returning. + */ public void disconnect_socket() { bindings.SocketDescriptor_disconnect_socket(this.ptr); } + /** + * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer. + * This is used, for example, for inclusion of this object in a hash map. + */ public long hash() { long ret = bindings.SocketDescriptor_hash(this.ptr); return ret; } + /** + * Creates a copy of a SocketDescriptor + */ public SocketDescriptor clone() { long ret = bindings.SocketDescriptor_clone(this.ptr); SocketDescriptor ret_hu_conv = new SocketDescriptor(null, ret); diff --git a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java index 3dabd15a..a02d2379 100644 --- a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java @@ -5,6 +5,14 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * When on-chain outputs are created by rust-lightning (which our counterparty is not able to + * claim at any point in the future) an event is generated which you must track and be able to + * spend on-chain. The information needed to do this is provided in this enum, including the + * outpoint describing which txid and output index is available, the full output which exists at + * that txid/index, and any keys or other information required to sign. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class SpendableOutputDescriptor extends CommonBase { private SpendableOutputDescriptor(Object _dummy, long ptr) { super(ptr); } diff --git a/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java b/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java index 6fd5fd7a..1ba6cec4 100644 --- a/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java @@ -5,6 +5,11 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Information about a spendable output to our \"payment key\". See + * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class StaticPaymentOutputDescriptor extends CommonBase { StaticPaymentOutputDescriptor(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +19,9 @@ public class StaticPaymentOutputDescriptor extends CommonBase { if (ptr != 0) { bindings.StaticPaymentOutputDescriptor_free(ptr); } } + /** + * The outpoint which is spendable + */ public OutPoint get_outpoint() { long ret = bindings.StaticPaymentOutputDescriptor_get_outpoint(this.ptr); OutPoint ret_hu_conv = new OutPoint(null, ret); @@ -21,33 +29,58 @@ public class StaticPaymentOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * The outpoint which is spendable + */ public void set_outpoint(OutPoint val) { bindings.StaticPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * The output which is referenced by the given outpoint + */ public void set_output(TxOut val) { bindings.StaticPaymentOutputDescriptor_set_output(this.ptr, val.ptr); } + /** + * Arbitrary identification information returned by a call to + * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in + * the channel to spend the output. + */ public byte[] get_channel_keys_id() { byte[] ret = bindings.StaticPaymentOutputDescriptor_get_channel_keys_id(this.ptr); return ret; } + /** + * Arbitrary identification information returned by a call to + * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in + * the channel to spend the output. + */ public void set_channel_keys_id(byte[] val) { bindings.StaticPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val); } + /** + * The value of the channel which this transactions spends. + */ public long get_channel_value_satoshis() { long ret = bindings.StaticPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr); return ret; } + /** + * The value of the channel which this transactions spends. + */ public void set_channel_value_satoshis(long val) { bindings.StaticPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val); } + /** + * Constructs a new StaticPaymentOutputDescriptor given each field + */ public static StaticPaymentOutputDescriptor constructor_new(OutPoint outpoint_arg, TxOut output_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) { long ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, output_arg.ptr, channel_keys_id_arg, channel_value_satoshis_arg); StaticPaymentOutputDescriptor ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret); @@ -56,6 +89,9 @@ public class StaticPaymentOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the StaticPaymentOutputDescriptor + */ public StaticPaymentOutputDescriptor clone() { long ret = bindings.StaticPaymentOutputDescriptor_clone(this.ptr); StaticPaymentOutputDescriptor ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret); diff --git a/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java b/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java index 9d7c1320..87d691ce 100644 --- a/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java @@ -5,6 +5,15 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin + * transaction and the transaction creation keys) are trusted. + * + * See trust() and verify() functions on CommitmentTransaction. + * + * This structure implements Deref. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TrustedCommitmentTransaction extends CommonBase { TrustedCommitmentTransaction(Object _dummy, long ptr) { super(ptr); } @@ -14,11 +23,17 @@ public class TrustedCommitmentTransaction extends CommonBase { if (ptr != 0) { bindings.TrustedCommitmentTransaction_free(ptr); } } + /** + * The transaction ID of the built Bitcoin transaction + */ public byte[] txid() { byte[] ret = bindings.TrustedCommitmentTransaction_txid(this.ptr); return ret; } + /** + * The pre-built Bitcoin commitment transaction + */ public BuiltCommitmentTransaction built_transaction() { long ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr); BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret); @@ -26,6 +41,9 @@ public class TrustedCommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * The pre-calculated transaction creation public keys. + */ public TxCreationKeys keys() { long ret = bindings.TrustedCommitmentTransaction_keys(this.ptr); TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); @@ -33,6 +51,12 @@ public class TrustedCommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Get a signature for each HTLC which was included in the commitment transaction (ie for + * which HTLCOutputInCommitment::transaction_output_index.is_some()). + * + * The returned Vec has one entry for each HTLC, and in the same order. + */ 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); diff --git a/src/main/java/org/ldk/structs/TxCreationKeys.java b/src/main/java/org/ldk/structs/TxCreationKeys.java index f063faad..023d93ea 100644 --- a/src/main/java/org/ldk/structs/TxCreationKeys.java +++ b/src/main/java/org/ldk/structs/TxCreationKeys.java @@ -5,6 +5,20 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * The set of public keys which are used in the creation of one commitment transaction. + * These are derived from the channel base keys and per-commitment data. + * + * A broadcaster key is provided from potential broadcaster of the computed transaction. + * A countersignatory key is coming from a protocol participant unable to broadcast the + * transaction. + * + * These keys are assumed to be good, either because the code derived them from + * channel basepoints via the new function, or they were obtained via + * CommitmentTransaction.trust().keys() because we trusted the source of the + * pre-calculated keys. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxCreationKeys extends CommonBase { TxCreationKeys(Object _dummy, long ptr) { super(ptr); } @@ -14,51 +28,88 @@ public class TxCreationKeys extends CommonBase { if (ptr != 0) { bindings.TxCreationKeys_free(ptr); } } + /** + * The broadcaster's per-commitment public key which was used to derive the other keys. + */ public byte[] get_per_commitment_point() { byte[] ret = bindings.TxCreationKeys_get_per_commitment_point(this.ptr); return ret; } + /** + * The broadcaster's per-commitment public key which was used to derive the other keys. + */ public void set_per_commitment_point(byte[] val) { bindings.TxCreationKeys_set_per_commitment_point(this.ptr, val); } + /** + * The revocation key which is used to allow the broadcaster of the commitment + * transaction to provide their counterparty the ability to punish them if they broadcast + * an old state. + */ public byte[] get_revocation_key() { byte[] ret = bindings.TxCreationKeys_get_revocation_key(this.ptr); return ret; } + /** + * The revocation key which is used to allow the broadcaster of the commitment + * transaction to provide their counterparty the ability to punish them if they broadcast + * an old state. + */ public void set_revocation_key(byte[] val) { bindings.TxCreationKeys_set_revocation_key(this.ptr, val); } + /** + * Broadcaster's HTLC Key + */ public byte[] get_broadcaster_htlc_key() { byte[] ret = bindings.TxCreationKeys_get_broadcaster_htlc_key(this.ptr); return ret; } + /** + * Broadcaster's HTLC Key + */ public void set_broadcaster_htlc_key(byte[] val) { bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, val); } + /** + * Countersignatory's HTLC Key + */ public byte[] get_countersignatory_htlc_key() { byte[] ret = bindings.TxCreationKeys_get_countersignatory_htlc_key(this.ptr); return ret; } + /** + * Countersignatory's HTLC Key + */ public void set_countersignatory_htlc_key(byte[] val) { bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, val); } + /** + * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay) + */ public byte[] get_broadcaster_delayed_payment_key() { byte[] ret = bindings.TxCreationKeys_get_broadcaster_delayed_payment_key(this.ptr); return ret; } + /** + * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay) + */ public void set_broadcaster_delayed_payment_key(byte[] val) { bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, val); } + /** + * Constructs a new TxCreationKeys given each field + */ public static TxCreationKeys constructor_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) { long ret = bindings.TxCreationKeys_new(per_commitment_point_arg, revocation_key_arg, broadcaster_htlc_key_arg, countersignatory_htlc_key_arg, broadcaster_delayed_payment_key_arg); TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); @@ -66,6 +117,9 @@ public class TxCreationKeys extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the TxCreationKeys + */ public TxCreationKeys clone() { long ret = bindings.TxCreationKeys_clone(this.ptr); TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); @@ -73,23 +127,37 @@ public class TxCreationKeys extends CommonBase { return ret_hu_conv; } + /** + * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read + */ public byte[] write() { byte[] ret = bindings.TxCreationKeys_write(this.ptr); return ret; } + /** + * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write + */ public static Result_TxCreationKeysDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.TxCreationKeys_read(ser); Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Create per-state keys from channel base points and the per-commitment point. + * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. + */ public static Result_TxCreationKeysErrorZ 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_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Generate per-state keys from channel static keys. + * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. + */ public static Result_TxCreationKeysErrorZ 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_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/TxOut.java b/src/main/java/org/ldk/structs/TxOut.java index b98590de..c3d2259e 100644 --- a/src/main/java/org/ldk/structs/TxOut.java +++ b/src/main/java/org/ldk/structs/TxOut.java @@ -5,7 +5,6 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; -@SuppressWarnings("unchecked") // We correctly assign various generic arrays public class TxOut extends CommonBase{ TxOut(java.lang.Object _dummy, long ptr) { super(ptr); } long to_c_ptr() { return 0; } diff --git a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java index 3404e76f..ad0780c5 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * The unsigned part of a channel_announcement + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class UnsignedChannelAnnouncement extends CommonBase { UnsignedChannelAnnouncement(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,9 @@ public class UnsignedChannelAnnouncement extends CommonBase { if (ptr != 0) { bindings.UnsignedChannelAnnouncement_free(ptr); } } + /** + * The advertised channel features + */ public ChannelFeatures get_features() { long ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr); ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret); @@ -21,65 +28,107 @@ public class UnsignedChannelAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * The advertised channel features + */ public void set_features(ChannelFeatures val) { bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public byte[] get_chain_hash() { byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr); return ret; } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public void set_chain_hash(byte[] val) { bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, val); } + /** + * The short channel ID + */ public long get_short_channel_id() { long ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this.ptr); return ret; } + /** + * The short channel ID + */ public void set_short_channel_id(long val) { bindings.UnsignedChannelAnnouncement_set_short_channel_id(this.ptr, val); } + /** + * One of the two node_ids which are endpoints of this channel + */ public byte[] get_node_id_1() { byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr); return ret; } + /** + * One of the two node_ids which are endpoints of this channel + */ public void set_node_id_1(byte[] val) { bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val); } + /** + * The other of the two node_ids which are endpoints of this channel + */ public byte[] get_node_id_2() { byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr); return ret; } + /** + * The other of the two node_ids which are endpoints of this channel + */ public void set_node_id_2(byte[] val) { bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val); } + /** + * The funding key for the first node + */ public byte[] get_bitcoin_key_1() { byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr); return ret; } + /** + * The funding key for the first node + */ public void set_bitcoin_key_1(byte[] val) { bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val); } + /** + * The funding key for the second node + */ public byte[] get_bitcoin_key_2() { byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr); return ret; } + /** + * The funding key for the second node + */ public void set_bitcoin_key_2(byte[] val) { bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val); } + /** + * Creates a copy of the UnsignedChannelAnnouncement + */ public UnsignedChannelAnnouncement clone() { long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr); UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); @@ -87,11 +136,17 @@ public class UnsignedChannelAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read + */ public byte[] write() { byte[] ret = bindings.UnsignedChannelAnnouncement_write(this.ptr); return ret; } + /** + * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write + */ public static Result_UnsignedChannelAnnouncementDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UnsignedChannelAnnouncement_read(ser); Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java index 47a7687f..9f50b5c6 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * The unsigned part of a channel_update + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class UnsignedChannelUpdate extends CommonBase { UnsignedChannelUpdate(Object _dummy, long ptr) { super(ptr); } @@ -14,78 +18,129 @@ public class UnsignedChannelUpdate extends CommonBase { if (ptr != 0) { bindings.UnsignedChannelUpdate_free(ptr); } } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public byte[] get_chain_hash() { byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this.ptr); return ret; } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public void set_chain_hash(byte[] val) { bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, val); } + /** + * The short channel ID + */ public long get_short_channel_id() { long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this.ptr); return ret; } + /** + * The short channel ID + */ public void set_short_channel_id(long val) { bindings.UnsignedChannelUpdate_set_short_channel_id(this.ptr, val); } + /** + * A strictly monotonic announcement counter, with gaps allowed, specific to this channel + */ public int get_timestamp() { int ret = bindings.UnsignedChannelUpdate_get_timestamp(this.ptr); return ret; } + /** + * A strictly monotonic announcement counter, with gaps allowed, specific to this channel + */ public void set_timestamp(int val) { bindings.UnsignedChannelUpdate_set_timestamp(this.ptr, val); } + /** + * Channel flags + */ public byte get_flags() { byte ret = bindings.UnsignedChannelUpdate_get_flags(this.ptr); return ret; } + /** + * Channel flags + */ public void set_flags(byte val) { bindings.UnsignedChannelUpdate_set_flags(this.ptr, val); } + /** + * The number of blocks to subtract from incoming HTLC cltv_expiry values + */ public short get_cltv_expiry_delta() { short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this.ptr); return ret; } + /** + * The number of blocks to subtract from incoming HTLC cltv_expiry values + */ public void set_cltv_expiry_delta(short val) { bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this.ptr, val); } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public long get_htlc_minimum_msat() { long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this.ptr); return ret; } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public void set_htlc_minimum_msat(long val) { bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this.ptr, val); } + /** + * The base HTLC fee charged by sender, in milli-satoshi + */ public int get_fee_base_msat() { int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this.ptr); return ret; } + /** + * The base HTLC fee charged by sender, in milli-satoshi + */ public void set_fee_base_msat(int val) { bindings.UnsignedChannelUpdate_set_fee_base_msat(this.ptr, val); } + /** + * The amount to fee multiplier, in micro-satoshi + */ public int get_fee_proportional_millionths() { int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this.ptr); return ret; } + /** + * The amount to fee multiplier, in micro-satoshi + */ public void set_fee_proportional_millionths(int val) { bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val); } + /** + * Creates a copy of the UnsignedChannelUpdate + */ public UnsignedChannelUpdate clone() { long ret = bindings.UnsignedChannelUpdate_clone(this.ptr); UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret); @@ -93,11 +148,17 @@ public class UnsignedChannelUpdate extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read + */ public byte[] write() { byte[] ret = bindings.UnsignedChannelUpdate_write(this.ptr); return ret; } + /** + * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write + */ public static Result_UnsignedChannelUpdateDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UnsignedChannelUpdate_read(ser); Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java index 606b202d..27e4dac7 100644 --- a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * The unsigned part of a node_announcement + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class UnsignedNodeAnnouncement extends CommonBase { UnsignedNodeAnnouncement(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +18,9 @@ public class UnsignedNodeAnnouncement extends CommonBase { if (ptr != 0) { bindings.UnsignedNodeAnnouncement_free(ptr); } } + /** + * The advertised features + */ public NodeFeatures get_features() { long ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr); NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); @@ -21,52 +28,89 @@ public class UnsignedNodeAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * The advertised features + */ public void set_features(NodeFeatures val) { bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * A strictly monotonic announcement counter, with gaps allowed + */ public int get_timestamp() { int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr); return ret; } + /** + * A strictly monotonic announcement counter, with gaps allowed + */ public void set_timestamp(int val) { bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val); } + /** + * The node_id this announcement originated from (don't rebroadcast the node_announcement back + * to this node). + */ public byte[] get_node_id() { byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr); return ret; } + /** + * The node_id this announcement originated from (don't rebroadcast the node_announcement back + * to this node). + */ public void set_node_id(byte[] val) { bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val); } + /** + * An RGB color for UI purposes + */ public byte[] get_rgb() { byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr); return ret; } + /** + * An RGB color for UI purposes + */ public void set_rgb(byte[] val) { bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, val); } + /** + * An alias, for UI purposes. This should be sanitized before use. There is no guarantee + * of uniqueness. + */ public byte[] get_alias() { byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr); return ret; } + /** + * An alias, for UI purposes. This should be sanitized before use. There is no guarantee + * of uniqueness. + */ public void set_alias(byte[] val) { bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val); } + /** + * List of addresses on which this node is reachable + */ public void set_addresses(NetAddress[] val) { bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray()); /* TODO 2 NetAddress */; } + /** + * Creates a copy of the UnsignedNodeAnnouncement + */ public UnsignedNodeAnnouncement clone() { long ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr); UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); @@ -74,11 +118,17 @@ public class UnsignedNodeAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read + */ public byte[] write() { byte[] ret = bindings.UnsignedNodeAnnouncement_write(this.ptr); return ret; } + /** + * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write + */ public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UnsignedNodeAnnouncement_read(ser); Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/UpdateAddHTLC.java b/src/main/java/org/ldk/structs/UpdateAddHTLC.java index 6e4afd24..fd3b2aca 100644 --- a/src/main/java/org/ldk/structs/UpdateAddHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateAddHTLC.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An update_add_htlc message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class UpdateAddHTLC extends CommonBase { UpdateAddHTLC(Object _dummy, long ptr) { super(ptr); } @@ -14,51 +18,84 @@ public class UpdateAddHTLC extends CommonBase { if (ptr != 0) { bindings.UpdateAddHTLC_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.UpdateAddHTLC_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.UpdateAddHTLC_set_channel_id(this.ptr, val); } + /** + * The HTLC ID + */ public long get_htlc_id() { long ret = bindings.UpdateAddHTLC_get_htlc_id(this.ptr); return ret; } + /** + * The HTLC ID + */ public void set_htlc_id(long val) { bindings.UpdateAddHTLC_set_htlc_id(this.ptr, val); } + /** + * The HTLC value in milli-satoshi + */ public long get_amount_msat() { long ret = bindings.UpdateAddHTLC_get_amount_msat(this.ptr); return ret; } + /** + * The HTLC value in milli-satoshi + */ public void set_amount_msat(long val) { bindings.UpdateAddHTLC_set_amount_msat(this.ptr, val); } + /** + * The payment hash, the pre-image of which controls HTLC redemption + */ public byte[] get_payment_hash() { byte[] ret = bindings.UpdateAddHTLC_get_payment_hash(this.ptr); return ret; } + /** + * The payment hash, the pre-image of which controls HTLC redemption + */ public void set_payment_hash(byte[] val) { bindings.UpdateAddHTLC_set_payment_hash(this.ptr, val); } + /** + * The expiry height of the HTLC + */ public int get_cltv_expiry() { int ret = bindings.UpdateAddHTLC_get_cltv_expiry(this.ptr); return ret; } + /** + * The expiry height of the HTLC + */ public void set_cltv_expiry(int val) { bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val); } + /** + * Creates a copy of the UpdateAddHTLC + */ public UpdateAddHTLC clone() { long ret = bindings.UpdateAddHTLC_clone(this.ptr); UpdateAddHTLC ret_hu_conv = new UpdateAddHTLC(null, ret); @@ -66,11 +103,17 @@ public class UpdateAddHTLC extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read + */ public byte[] write() { byte[] ret = bindings.UpdateAddHTLC_write(this.ptr); return ret; } + /** + * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write + */ public static Result_UpdateAddHTLCDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UpdateAddHTLC_read(ser); Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/UpdateFailHTLC.java b/src/main/java/org/ldk/structs/UpdateFailHTLC.java index 35566615..f558b4f9 100644 --- a/src/main/java/org/ldk/structs/UpdateFailHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailHTLC.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An update_fail_htlc message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class UpdateFailHTLC extends CommonBase { UpdateFailHTLC(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,39 @@ public class UpdateFailHTLC extends CommonBase { if (ptr != 0) { bindings.UpdateFailHTLC_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.UpdateFailHTLC_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.UpdateFailHTLC_set_channel_id(this.ptr, val); } + /** + * The HTLC ID + */ public long get_htlc_id() { long ret = bindings.UpdateFailHTLC_get_htlc_id(this.ptr); return ret; } + /** + * The HTLC ID + */ public void set_htlc_id(long val) { bindings.UpdateFailHTLC_set_htlc_id(this.ptr, val); } + /** + * Creates a copy of the UpdateFailHTLC + */ public UpdateFailHTLC clone() { long ret = bindings.UpdateFailHTLC_clone(this.ptr); UpdateFailHTLC ret_hu_conv = new UpdateFailHTLC(null, ret); @@ -39,11 +58,17 @@ public class UpdateFailHTLC extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read + */ public byte[] write() { byte[] ret = bindings.UpdateFailHTLC_write(this.ptr); return ret; } + /** + * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write + */ public static Result_UpdateFailHTLCDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UpdateFailHTLC_read(ser); Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java index 0b28fc68..b56ebc84 100644 --- a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An update_fail_malformed_htlc message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class UpdateFailMalformedHTLC extends CommonBase { UpdateFailMalformedHTLC(Object _dummy, long ptr) { super(ptr); } @@ -14,33 +18,54 @@ public class UpdateFailMalformedHTLC extends CommonBase { if (ptr != 0) { bindings.UpdateFailMalformedHTLC_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, val); } + /** + * The HTLC ID + */ public long get_htlc_id() { long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this.ptr); return ret; } + /** + * The HTLC ID + */ public void set_htlc_id(long val) { bindings.UpdateFailMalformedHTLC_set_htlc_id(this.ptr, val); } + /** + * The failure code + */ public short get_failure_code() { short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this.ptr); return ret; } + /** + * The failure code + */ public void set_failure_code(short val) { bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val); } + /** + * Creates a copy of the UpdateFailMalformedHTLC + */ public UpdateFailMalformedHTLC clone() { long ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr); UpdateFailMalformedHTLC ret_hu_conv = new UpdateFailMalformedHTLC(null, ret); @@ -48,11 +73,17 @@ public class UpdateFailMalformedHTLC extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read + */ public byte[] write() { byte[] ret = bindings.UpdateFailMalformedHTLC_write(this.ptr); return ret; } + /** + * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write + */ public static Result_UpdateFailMalformedHTLCDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UpdateFailMalformedHTLC_read(ser); Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/UpdateFee.java b/src/main/java/org/ldk/structs/UpdateFee.java index fa186fb4..0edfefcf 100644 --- a/src/main/java/org/ldk/structs/UpdateFee.java +++ b/src/main/java/org/ldk/structs/UpdateFee.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An update_fee message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class UpdateFee extends CommonBase { UpdateFee(Object _dummy, long ptr) { super(ptr); } @@ -14,24 +18,39 @@ public class UpdateFee extends CommonBase { if (ptr != 0) { bindings.UpdateFee_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.UpdateFee_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.UpdateFee_set_channel_id(this.ptr, val); } + /** + * Fee rate per 1000-weight of the transaction + */ public int get_feerate_per_kw() { int ret = bindings.UpdateFee_get_feerate_per_kw(this.ptr); return ret; } + /** + * Fee rate per 1000-weight of the transaction + */ public void set_feerate_per_kw(int val) { bindings.UpdateFee_set_feerate_per_kw(this.ptr, val); } + /** + * Constructs a new UpdateFee given each field + */ public static UpdateFee constructor_new(byte[] channel_id_arg, int feerate_per_kw_arg) { long ret = bindings.UpdateFee_new(channel_id_arg, feerate_per_kw_arg); UpdateFee ret_hu_conv = new UpdateFee(null, ret); @@ -39,6 +58,9 @@ public class UpdateFee extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the UpdateFee + */ public UpdateFee clone() { long ret = bindings.UpdateFee_clone(this.ptr); UpdateFee ret_hu_conv = new UpdateFee(null, ret); @@ -46,11 +68,17 @@ public class UpdateFee extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read + */ public byte[] write() { byte[] ret = bindings.UpdateFee_write(this.ptr); return ret; } + /** + * Read a UpdateFee from a byte array, created by UpdateFee_write + */ public static Result_UpdateFeeDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UpdateFee_read(ser); Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java index 966392bd..b1b690c2 100644 --- a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java @@ -5,6 +5,10 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An update_fulfill_htlc message to be sent or received from a peer + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class UpdateFulfillHTLC extends CommonBase { UpdateFulfillHTLC(Object _dummy, long ptr) { super(ptr); } @@ -14,33 +18,54 @@ public class UpdateFulfillHTLC extends CommonBase { if (ptr != 0) { bindings.UpdateFulfillHTLC_free(ptr); } } + /** + * The channel ID + */ public byte[] get_channel_id() { byte[] ret = bindings.UpdateFulfillHTLC_get_channel_id(this.ptr); return ret; } + /** + * The channel ID + */ public void set_channel_id(byte[] val) { bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, val); } + /** + * The HTLC ID + */ public long get_htlc_id() { long ret = bindings.UpdateFulfillHTLC_get_htlc_id(this.ptr); return ret; } + /** + * The HTLC ID + */ public void set_htlc_id(long val) { bindings.UpdateFulfillHTLC_set_htlc_id(this.ptr, val); } + /** + * The pre-image of the payment hash, allowing HTLC redemption + */ public byte[] get_payment_preimage() { byte[] ret = bindings.UpdateFulfillHTLC_get_payment_preimage(this.ptr); return ret; } + /** + * The pre-image of the payment hash, allowing HTLC redemption + */ public void set_payment_preimage(byte[] val) { bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, val); } + /** + * Constructs a new UpdateFulfillHTLC given each field + */ public static UpdateFulfillHTLC constructor_new(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) { long ret = bindings.UpdateFulfillHTLC_new(channel_id_arg, htlc_id_arg, payment_preimage_arg); UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret); @@ -48,6 +73,9 @@ public class UpdateFulfillHTLC extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the UpdateFulfillHTLC + */ public UpdateFulfillHTLC clone() { long ret = bindings.UpdateFulfillHTLC_clone(this.ptr); UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret); @@ -55,11 +83,17 @@ public class UpdateFulfillHTLC extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read + */ public byte[] write() { byte[] ret = bindings.UpdateFulfillHTLC_write(this.ptr); return ret; } + /** + * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write + */ public static Result_UpdateFulfillHTLCDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.UpdateFulfillHTLC_read(ser); Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/UserConfig.java b/src/main/java/org/ldk/structs/UserConfig.java index 5629008e..7bf96f59 100644 --- a/src/main/java/org/ldk/structs/UserConfig.java +++ b/src/main/java/org/ldk/structs/UserConfig.java @@ -5,6 +5,13 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Top-level config which holds ChannelHandshakeLimits and ChannelConfig. + * + * Default::default() provides sane defaults for most configurations + * (but currently with 0 relay fees!) + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class UserConfig extends CommonBase { UserConfig(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +21,9 @@ public class UserConfig extends CommonBase { if (ptr != 0) { bindings.UserConfig_free(ptr); } } + /** + * Channel config that we propose to our counterparty. + */ public ChannelHandshakeConfig get_own_channel_config() { long ret = bindings.UserConfig_get_own_channel_config(this.ptr); ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); @@ -21,11 +31,17 @@ public class UserConfig extends CommonBase { return ret_hu_conv; } + /** + * Channel config that we propose to our counterparty. + */ public void set_own_channel_config(ChannelHandshakeConfig val) { bindings.UserConfig_set_own_channel_config(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Limits applied to our counterparty's proposed channel config settings. + */ public ChannelHandshakeLimits get_peer_channel_config_limits() { long ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr); ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); @@ -33,11 +49,17 @@ public class UserConfig extends CommonBase { return ret_hu_conv; } + /** + * Limits applied to our counterparty's proposed channel config settings. + */ public void set_peer_channel_config_limits(ChannelHandshakeLimits val) { bindings.UserConfig_set_peer_channel_config_limits(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Channel config which affects behavior during channel lifetime. + */ public ChannelConfig get_channel_options() { long ret = bindings.UserConfig_get_channel_options(this.ptr); ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); @@ -45,11 +67,17 @@ public class UserConfig extends CommonBase { return ret_hu_conv; } + /** + * Channel config which affects behavior during channel lifetime. + */ public void set_channel_options(ChannelConfig val) { bindings.UserConfig_set_channel_options(this.ptr, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(val); } + /** + * Constructs a new UserConfig given each field + */ public static UserConfig constructor_new(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg) { long ret = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1); UserConfig ret_hu_conv = new UserConfig(null, ret); @@ -60,6 +88,9 @@ public class UserConfig extends CommonBase { return ret_hu_conv; } + /** + * Creates a copy of the UserConfig + */ public UserConfig clone() { long ret = bindings.UserConfig_clone(this.ptr); UserConfig ret_hu_conv = new UserConfig(null, ret); @@ -67,6 +98,9 @@ public class UserConfig extends CommonBase { return ret_hu_conv; } + /** + * Creates a "default" UserConfig. See other documentaiton for details on what this implies. + */ public static UserConfig constructor_default() { long ret = bindings.UserConfig_default(); UserConfig ret_hu_conv = new UserConfig(null, ret); diff --git a/src/main/java/org/ldk/structs/UtilMethods.java b/src/main/java/org/ldk/structs/UtilMethods.java index 3a1bcbfe..2d80e29b 100644 --- a/src/main/java/org/ldk/structs/UtilMethods.java +++ b/src/main/java/org/ldk/structs/UtilMethods.java @@ -3,6 +3,9 @@ import org.ldk.impl.bindings; import java.util.Arrays; public class UtilMethods { + /** + * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write + */ public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constructor_BlockHashChannelMonitorZ_read(byte[] ser, KeysInterface arg) { long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg == null ? 0 : arg.ptr); Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); @@ -10,6 +13,9 @@ public class UtilMethods { return ret_hu_conv; } + /** + * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write + */ public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constructor_BlockHashChannelManagerZ_read(byte[] ser, KeysInterface arg_keys_manager, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) { long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_keys_manager == null ? 0 : arg_keys_manager.ptr, arg_fee_estimator == null ? 0 : arg_fee_estimator.ptr, arg_chain_monitor == null ? 0 : arg_chain_monitor.ptr, arg_tx_broadcaster == null ? 0 : arg_tx_broadcaster.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr & ~1, Arrays.stream(arg_channel_monitors).mapToLong(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr & ~1).toArray())); Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret); diff --git a/src/main/java/org/ldk/structs/Watch.java b/src/main/java/org/ldk/structs/Watch.java index c9b156fb..85602ac8 100644 --- a/src/main/java/org/ldk/structs/Watch.java +++ b/src/main/java/org/ldk/structs/Watch.java @@ -5,6 +5,29 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +/** + * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as + * blocks are connected and disconnected. + * + * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are + * responsible for maintaining a set of monitors such that they can be updated accordingly as + * channel state changes and HTLCs are resolved. See method documentation for specific + * requirements. + * + * Implementations **must** ensure that updates are successfully applied and persisted upon method + * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down + * without taking any further action such as persisting the current state. + * + * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing + * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it + * could result in a revoked transaction being broadcast, allowing the counterparty to claim all + * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle + * multiple instances. + * + * [`ChannelMonitor`]: channelmonitor/struct.ChannelMonitor.html + * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html + * [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Watch extends CommonBase { final bindings.LDKWatch bindings_instance; @@ -20,8 +43,32 @@ public class Watch extends CommonBase { } public static interface WatchInterface { + /** + * Watches a channel identified by `funding_txo` using `monitor`. + * + * Implementations are responsible for watching the chain for the funding transaction along + * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means + * calling [`block_connected`] and [`block_disconnected`] on the monitor. + * + * [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch + * [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected + * [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected + */ Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor); + /** + * Updates a channel identified by `funding_txo` by applying `update` to its monitor. + * + * Implementations must call [`update_monitor`] with the given update. See + * [`ChannelMonitorUpdateErr`] for invariants around returning an error. + * + * [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor + * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html + */ Result_NoneChannelMonitorUpdateErrZ update_channel(OutPoint funding_txo, ChannelMonitorUpdate update); + /** + * Returns any monitor events since the last call. Subsequent calls must only return new + * events. + */ MonitorEvent[] release_pending_monitor_events(); } private static class LDKWatchHolder { Watch held; } @@ -55,6 +102,17 @@ public class Watch extends CommonBase { }); return impl_holder.held; } + /** + * Watches a channel identified by `funding_txo` using `monitor`. + * + * Implementations are responsible for watching the chain for the funding transaction along + * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means + * calling [`block_connected`] and [`block_disconnected`] on the monitor. + * + * [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch + * [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected + * [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected + */ 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); @@ -63,6 +121,15 @@ public class Watch extends CommonBase { return ret_hu_conv; } + /** + * Updates a channel identified by `funding_txo` by applying `update` to its monitor. + * + * Implementations must call [`update_monitor`] with the given update. See + * [`ChannelMonitorUpdateErr`] for invariants around returning an error. + * + * [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor + * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html + */ 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); @@ -71,6 +138,10 @@ public class Watch extends CommonBase { return ret_hu_conv; } + /** + * Returns any monitor events since the last call. Subsequent calls must only return new + * events. + */ public MonitorEvent[] release_pending_monitor_events() { long[] ret = bindings.Watch_release_pending_monitor_events(this.ptr); MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret.length]; diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index c00a6981..5c05a422 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -1958,6 +1958,111 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScr (*env)->SetByteArrayRegion(env, b_arr, 0, b_var.datalen, b_var.data); return b_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_t a, int8_tArray b) { + LDKC2Tuple_u32ScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + ret->a = a; + 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 int32_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32ScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t ptr) { + LDKC2Tuple_u32ScriptZ *tuple = (LDKC2Tuple_u32ScriptZ*)(ptr & ~1); + return tuple->a; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32ScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t ptr) { + LDKC2Tuple_u32ScriptZ *tuple = (LDKC2Tuple_u32ScriptZ*)(ptr & ~1); + LDKCVec_u8Z b_var = tuple->b; + int8_tArray b_arr = (*env)->NewByteArray(env, b_var.datalen); + (*env)->SetByteArrayRegion(env, b_arr, 0, b_var.datalen, b_var.data); + return b_arr; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32ScriptZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { + LDKCVec_C2Tuple_u32ScriptZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32ScriptZZ), "LDKCVec_C2Tuple_u32ScriptZZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * ret->datalen, "LDKCVec_C2Tuple_u32ScriptZZ Data"); + int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + int64_t arr_elem = java_elems[i]; + LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1); + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { + LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]); + } + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + ret->a = a_ref; + LDKCVec_C2Tuple_u32ScriptZZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); + for (size_t b = 0; b < b_constr.datalen; b++) { + int64_t b_conv_27 = b_vals[b]; + LDKC2Tuple_u32ScriptZ b_conv_27_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_27) & ~1); + FREE((void*)b_conv_27); + b_constr.data[b] = b_conv_27_conv; + } + (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); + ret->b = b_constr; + return (long)ret; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t ptr) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *tuple = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(ptr & ~1); + int8_tArray a_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, a_arr, 0, 32, tuple->a.data); + return a_arr; +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t ptr) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *tuple = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(ptr & ~1); + LDKCVec_C2Tuple_u32ScriptZZ b_var = tuple->b; + int64_tArray b_arr = (*env)->NewLongArray(env, b_var.datalen); + int64_t *b_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, b_arr, NULL); + for (size_t b = 0; b < b_var.datalen; b++) { + long b_conv_27_ref = (long)(&b_var.data[b]) | 1; + b_arr_ptr[b] = b_conv_27_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, b_arr, b_arr_ptr, 0); + return b_arr; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Data"); + int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + int64_t arr_elem = java_elems[i]; + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1); + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) { LDKC2Tuple_u32TxOutZ* ret = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); ret->a = a; @@ -2406,28 +2511,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSign_1new(JNIEnv *env, j return (long)res_ptr; } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form); return ret_arr; } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data); return ret_arr; } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data); return ret_arr; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1counterparty_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; @@ -2437,7 +2542,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1counterparty_1c } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1holder_1commitment_1and_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKHolderCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; @@ -2447,7 +2552,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1holder_1commitm } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1justice_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, int64_t htlc) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKTransaction justice_tx_ref; justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx); justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); @@ -2466,7 +2571,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1justice_1transa } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1counterparty_1htlc_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, int64_t htlc) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKTransaction htlc_tx_ref; htlc_tx_ref.datalen = (*env)->GetArrayLength(env, htlc_tx); htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes"); @@ -2484,7 +2589,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1counterparty_1h } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1closing_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray closing_tx) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKTransaction closing_tx_ref; closing_tx_ref.datalen = (*env)->GetArrayLength(env, closing_tx); closing_tx_ref.data = MALLOC(closing_tx_ref.datalen, "LDKTransaction Bytes"); @@ -2496,7 +2601,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1closing_1transa } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -2506,7 +2611,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1channel_1announ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1ready_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; @@ -2514,7 +2619,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1ready_1channel(JNIEnv *e } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -2528,7 +2633,7 @@ LDKChannelPublicKeys LDKSign_set_get_pubkeys(LDKSign* this_arg) { return this_arg->pubkeys; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKChannelPublicKeys ret_var = LDKSign_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. @@ -2972,7 +3077,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new(JNIEnv *env, return (long)res_ptr; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) { - LDKWatch* this_arg_conv = (LDKWatch*)this_arg; + LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); @@ -2987,7 +3092,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEn } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t update) { - LDKWatch* this_arg_conv = (LDKWatch*)this_arg; + LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); @@ -3002,7 +3107,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIE } JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKWatch* this_arg_conv = (LDKWatch*)this_arg; + LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1); LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); @@ -3072,7 +3177,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1ne return (long)res_ptr; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray tx) { - LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg; + LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)(((uint64_t)this_arg) & ~1); LDKTransaction tx_ref; tx_ref.datalen = (*env)->GetArrayLength(env, tx); tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); @@ -3237,14 +3342,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new(JNIEn return (long)res_ptr; } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes); return ret_arr; } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1destination_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -3253,28 +3358,28 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1des } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_shutdown_pubkey)(this_arg_conv->this_arg).compressed_form); return ret_arr; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis); return (long)ret; } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1secure_1random_1bytes(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data); return ret_arr; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1read_1chan_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray reader) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); LDKu8slice reader_ref; reader_ref.datalen = (*env)->GetArrayLength(env, reader); reader_ref.data = (*env)->GetByteArrayElements (env, reader, NULL); @@ -3336,7 +3441,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new(JNIEnv return (long)res_ptr; } JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_arg, jclass confirmation_target) { - LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg; + LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)(((uint64_t)this_arg) & ~1); LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(env, confirmation_target); int32_t ret_val = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv); return ret_val; @@ -4510,7 +4615,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvide return (long)res_ptr; } JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg; + LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)(((uint64_t)this_arg) & ~1); LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg); int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); @@ -4591,7 +4696,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new(JNIE return (long)res_ptr; } JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_EventsProvider_1get_1and_1clear_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg; + LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)(((uint64_t)this_arg) & ~1); LDKCVec_EventZ ret_var = (this_arg_conv->get_and_clear_pending_events)(this_arg_conv->this_arg); int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); @@ -4662,7 +4767,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new(JNIEnv *env, return (long)res_ptr; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) { - LDKAccess* this_arg_conv = (LDKAccess*)this_arg; + LDKAccess* this_arg_conv = (LDKAccess*)(((uint64_t)this_arg) & ~1); unsigned char genesis_hash_arr[32]; CHECK((*env)->GetArrayLength(env, genesis_hash) == 32); (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr); @@ -4740,7 +4845,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKListen_1new(JNIEnv *env, return (long)res_ptr; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray block, int32_t height) { - LDKListen* this_arg_conv = (LDKListen*)this_arg; + LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1); LDKu8slice block_ref; block_ref.datalen = (*env)->GetArrayLength(env, block); block_ref.data = (*env)->GetByteArrayElements (env, block, NULL); @@ -4749,7 +4854,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected(JNIEn } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) { - LDKListen* this_arg_conv = (LDKListen*)this_arg; + LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -4836,7 +4941,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new(JNIEnv *env, return (long)res_ptr; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid, int8_tArray script_pubkey) { - LDKFilter* this_arg_conv = (LDKFilter*)this_arg; + LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1); unsigned char txid_arr[32]; CHECK((*env)->GetArrayLength(env, txid) == 32); (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); @@ -4849,7 +4954,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx(JNIEnv *e } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEnv *env, jclass clz, int64_t this_arg, int64_t outpoint, int8_tArray script_pubkey) { - LDKFilter* this_arg_conv = (LDKFilter*)this_arg; + LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1); LDKOutPoint outpoint_conv; outpoint_conv.inner = (void*)(outpoint & (~1)); outpoint_conv.is_owned = false; @@ -4967,7 +5072,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new(JNIEnv *env return (long)res_ptr; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t data) { - LDKPersist* this_arg_conv = (LDKPersist*)this_arg; + LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1); LDKOutPoint id_conv; id_conv.inner = (void*)(id & (~1)); id_conv.is_owned = (id & 1) || (id == 0); @@ -4981,7 +5086,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1chan } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t update, int64_t data) { - LDKPersist* this_arg_conv = (LDKPersist*)this_arg; + LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1); LDKOutPoint id_conv; id_conv.inner = (void*)(id & (~1)); id_conv.is_owned = (id & 1) || (id == 0); @@ -5472,7 +5577,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1n return (long)res_ptr; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1open_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5487,7 +5592,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1accept_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5502,7 +5607,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1created(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5513,7 +5618,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5524,7 +5629,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1locked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5535,7 +5640,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5549,7 +5654,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1closing_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5560,7 +5665,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1add_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5571,7 +5676,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fulfill_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5582,7 +5687,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5593,7 +5698,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1malformed_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5604,7 +5709,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5615,7 +5720,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1revoke_1and_1ack(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5626,7 +5731,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fee(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5637,7 +5742,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1announcement_1signatures(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5648,7 +5753,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5656,7 +5761,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1d } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5667,7 +5772,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1c } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5678,7 +5783,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1error(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -5989,7 +6094,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1n return (long)res_ptr; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -5999,7 +6104,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -6009,7 +6114,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -6019,13 +6124,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1htlc_1fail_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t update) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKHTLCFailChannelUpdate* update_conv = (LDKHTLCFailChannelUpdate*)update; (this_arg_conv->handle_htlc_fail_channel_update)(this_arg_conv->this_arg, update_conv); } JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1channel_1announcements(JNIEnv *env, jclass clz, int64_t this_arg, int64_t starting_point, int8_t batch_amount) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount); int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); @@ -6040,7 +6145,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_ } JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1node_1announcements(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray starting_point, int8_t batch_amount) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey starting_point_ref; CHECK((*env)->GetArrayLength(env, starting_point) == 33); (*env)->GetByteArrayRegion(env, starting_point, 0, 33, starting_point_ref.compressed_form); @@ -6063,7 +6168,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_ } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1sync_1routing_1table(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -6074,7 +6179,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1sync_1r } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1channel_1range(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -6088,7 +6193,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1short_1channel_1ids_1end(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -6102,7 +6207,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1channel_1range(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -6116,7 +6221,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); 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); @@ -6222,7 +6327,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new(JN return (long)res_ptr; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray data, jboolean resume_read) { - LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; + LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1); LDKu8slice data_ref; data_ref.datalen = (*env)->GetArrayLength(env, data); data_ref.data = (*env)->GetByteArrayElements (env, data, NULL); @@ -6232,12 +6337,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1dat } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; + LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1); (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; + LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1); int64_t ret_val = (this_arg_conv->hash)(this_arg_conv->this_arg); return ret_val; } @@ -7564,6 +7669,96 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free C2Tuple_OutPointScriptZ_free(_res_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); + LDKC2Tuple_u32ScriptZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_ref = C2Tuple_u32ScriptZ_clone(orig_conv); + return (long)ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_t a, int8_tArray b) { + 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_u32ScriptZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_ref = C2Tuple_u32ScriptZ_new(a, b_ref); + return (long)ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + C2Tuple_u32ScriptZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_u32ScriptZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t b = 0; b < _res_constr.datalen; b++) { + int64_t _res_conv_27 = _res_vals[b]; + LDKC2Tuple_u32ScriptZ _res_conv_27_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res_conv_27) & ~1); + FREE((void*)_res_conv_27); + _res_constr.data[b] = _res_conv_27_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_u32ScriptZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKCVec_C2Tuple_u32ScriptZZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); + for (size_t b = 0; b < b_constr.datalen; b++) { + int64_t b_conv_27 = b_vals[b]; + LDKC2Tuple_u32ScriptZ b_conv_27_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_27) & ~1); + FREE((void*)b_conv_27); + b_constr.data[b] = b_conv_27_conv; + } + (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_ref = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr); + return (long)ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _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_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t v = 0; v < _res_constr.datalen; v++) { + int64_t _res_conv_47 = _res_vals[v]; + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_47_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res_conv_47) & ~1); + FREE((void*)_res_conv_47); + _res_constr.data[v] = _res_conv_47_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { LDKCVec_TransactionZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -9643,11 +9838,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jcla Logger_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelHandshakeConfig_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelHandshakeConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelHandshakeConfig_free(this_obj_conv); } JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -9731,11 +9926,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1def return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelHandshakeLimits_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelHandshakeLimits this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelHandshakeLimits_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -9924,11 +10119,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1def return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelConfig_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelConfig_free(this_obj_conv); } JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -10033,11 +10228,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UserConfig_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUserConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UserConfig_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -10217,11 +10412,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env FeeEstimator_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChainMonitor this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChainMonitor_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChainMonitor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChainMonitor_free(this_obj_conv); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) { @@ -10261,7 +10456,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnec } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *env, jclass clz, int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) { - LDKFilter* chain_source_conv = (LDKFilter*)chain_source; + LDKFilter *chain_source_conv_ptr = NULL; + if (chain_source != 0) { + LDKFilter chain_source_conv; + chain_source_conv = *(LDKFilter*)(((uint64_t)chain_source) & ~1); + if (chain_source_conv.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_clone(chain_source_conv.this_arg); + } + chain_source_conv_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter"); + *chain_source_conv_ptr = chain_source_conv; + } LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1); if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. @@ -10282,7 +10487,7 @@ JNIEXPORT int64_t 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. LDKPersist_JCalls_clone(persister_conv.this_arg); } - LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); + LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv_ptr, 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; @@ -10310,11 +10515,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsPro return (long)ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelMonitorUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelMonitorUpdate_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelMonitorUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelMonitorUpdate_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -10373,11 +10578,11 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clo return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKMonitorUpdateError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - MonitorUpdateError_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMonitorUpdateError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + MonitorUpdateError_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone(JNIEnv *env, jclass clz, int64_t orig) { @@ -10409,11 +10614,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - HTLCUpdate_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHTLCUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + HTLCUpdate_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { @@ -10451,11 +10656,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv *en return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelMonitor this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelMonitor_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelMonitor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelMonitor_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) { @@ -10490,9 +10695,9 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1mon LDKChannelMonitorUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = false; - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster; - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator; - LDKLogger* logger_conv = (LDKLogger*)logger; + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1); + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1); + LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); return (long)ret_conv; @@ -10515,6 +10720,31 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1fundin return (long)ret_ref; } +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); + int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t v = 0; v < ret_var.datalen; v++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_47_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv_47_ref = ret_var.data[v]; + ret_arr_ptr[v] = (long)ret_conv_47_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_ChannelMonitor_1load_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg, int64_t filter) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKFilter* filter_conv = (LDKFilter*)(((uint64_t)filter) & ~1); + ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv); +} + JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); @@ -10555,7 +10785,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1l LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - LDKLogger* logger_conv = (LDKLogger*)logger; + LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1); LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); ; @@ -10657,18 +10887,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg; + LDKKeysInterface* arg_conv = (LDKKeysInterface*)(((uint64_t)arg) & ~1); 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 clz, int64_t this_ptr) { - LDKOutPoint this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - OutPoint_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOutPoint this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + OutPoint_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -10763,11 +10993,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv *env, return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - DelayedPaymentOutputDescriptor_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDelayedPaymentOutputDescriptor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + DelayedPaymentOutputDescriptor_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -10931,11 +11161,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - StaticPaymentOutputDescriptor_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKStaticPaymentOutputDescriptor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + StaticPaymentOutputDescriptor_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -11075,7 +11305,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1 } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSign* orig_conv = (LDKSign*)orig; + LDKSign* orig_conv = (LDKSign*)(((uint64_t)orig) & ~1); LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret = Sign_clone(orig_conv); return (long)ret; @@ -11095,11 +11325,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv *en KeysInterface_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - InMemorySigner_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInMemorySigner this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + InMemorySigner_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -11392,11 +11622,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKKeysManager this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - KeysManager_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKKeysManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + KeysManager_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { @@ -11482,18 +11712,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterf return (long)ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManager this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelManager_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelManager_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChainParameters_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChainParameters this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChainParameters_free(this_obj_conv); } JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1network(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -11561,11 +11791,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelDetails_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelDetails this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelDetails_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -12084,11 +12314,11 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(J return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelManagerReadArgs_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelManagerReadArgs this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelManagerReadArgs_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -12285,11 +12515,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDecodeError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - DecodeError_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDecodeError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + DecodeError_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) { @@ -12306,11 +12536,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv * return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInit this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - Init_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInit this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + Init_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -12367,11 +12597,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKErrorMessage this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ErrorMessage_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKErrorMessage this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ErrorMessage_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -12445,11 +12675,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - Ping_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPing this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + Ping_free(this_obj_conv); } JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -12507,11 +12737,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPong this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - Pong_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPong this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + Pong_free(this_obj_conv); } JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -12554,11 +12784,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - OpenChannel_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOpenChannel this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + OpenChannel_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -12877,11 +13107,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv * return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - AcceptChannel_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKAcceptChannel this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + AcceptChannel_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13136,11 +13366,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - FundingCreated_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFundingCreated this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + FundingCreated_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13249,11 +13479,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEn return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingSigned this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - FundingSigned_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFundingSigned this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + FundingSigned_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13325,11 +13555,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingLocked this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - FundingLocked_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFundingLocked this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + FundingLocked_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13401,11 +13631,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKShutdown this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - Shutdown_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKShutdown this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + Shutdown_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13480,11 +13710,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSigned this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ClosingSigned_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKClosingSigned this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ClosingSigned_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13571,11 +13801,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UpdateAddHTLC_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateAddHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UpdateAddHTLC_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13675,11 +13905,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFulfillHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UpdateFulfillHTLC_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFulfillHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UpdateFulfillHTLC_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13766,11 +13996,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JN return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UpdateFailHTLC_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFailHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UpdateFailHTLC_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13821,11 +14051,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEn return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailMalformedHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UpdateFailMalformedHTLC_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFailMalformedHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UpdateFailMalformedHTLC_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -13891,11 +14121,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1cl return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentSigned this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - CommitmentSigned_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentSigned this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CommitmentSigned_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -14000,11 +14230,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNI return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRevokeAndACK this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - RevokeAndACK_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRevokeAndACK this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + RevokeAndACK_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -14098,11 +14328,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFee this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UpdateFee_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFee this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UpdateFee_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -14167,11 +14397,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *en return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDataLossProtect this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - DataLossProtect_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDataLossProtect this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + DataLossProtect_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -14243,11 +14473,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIE return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelReestablish this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelReestablish_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelReestablish this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelReestablish_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -14313,11 +14543,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(J return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnnouncementSignatures this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - AnnouncementSignatures_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKAnnouncementSignatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + AnnouncementSignatures_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -14460,11 +14690,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Result_1read(JNIEnv *env, j return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UnsignedNodeAnnouncement_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedNodeAnnouncement this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UnsignedNodeAnnouncement_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -14599,11 +14829,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1c return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NodeAnnouncement_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeAnnouncement this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NodeAnnouncement_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -14682,11 +14912,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNI return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UnsignedChannelAnnouncement_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedChannelAnnouncement this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UnsignedChannelAnnouncement_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -14838,11 +15068,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelAnnouncement_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelAnnouncement this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelAnnouncement_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -14987,11 +15217,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone( return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UnsignedChannelUpdate_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedChannelUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UnsignedChannelUpdate_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -15132,11 +15362,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clon return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelUpdate_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelUpdate_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -15215,11 +15445,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - QueryChannelRange_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKQueryChannelRange this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + QueryChannelRange_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -15299,11 +15529,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JN return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ReplyChannelRange_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReplyChannelRange this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ReplyChannelRange_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -15429,11 +15659,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JN return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKQueryShortChannelIds this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - QueryShortChannelIds_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKQueryShortChannelIds this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + QueryShortChannelIds_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -15514,11 +15744,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyShortChannelIdsEnd this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ReplyShortChannelIdsEnd_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReplyShortChannelIdsEnd this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ReplyShortChannelIdsEnd_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -15583,11 +15813,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1cl return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKGossipTimestampFilter this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + GossipTimestampFilter_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -15682,11 +15912,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv * return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKLightningError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + LightningError_free(this_obj_conv); } JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -15759,11 +15989,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEn return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CommitmentUpdate_free(this_obj_conv); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { @@ -16685,11 +16915,11 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1 return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKIgnoringMessageHandler this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - IgnoringMessageHandler_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKIgnoringMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + IgnoringMessageHandler_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) { @@ -16721,11 +16951,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ return (long)ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKErroringMessageHandler this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ErroringMessageHandler_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKErroringMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ErroringMessageHandler_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) { @@ -16757,11 +16987,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_ return (long)ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + MessageHandler_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -16826,7 +17056,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig; + LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)(((uint64_t)orig) & ~1); LDKSocketDescriptor* ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *ret = SocketDescriptor_clone(orig_conv); return (long)ret; @@ -16839,11 +17069,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv SocketDescriptor_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPeerHandleError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + PeerHandleError_free(this_obj_conv); } JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -16886,11 +17116,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIE return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPeerManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + PeerManager_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int8_tArray ephemeral_random_data, int64_t logger) { @@ -16971,7 +17201,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_ LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor; + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1); 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; @@ -16981,7 +17211,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JN 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; + LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)peer_descriptor) & ~1); LDKu8slice data_ref; data_ref.datalen = (*env)->GetArrayLength(env, data); data_ref.data = (*env)->GetByteArrayElements (env, data, NULL); @@ -17002,7 +17232,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnec LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor; + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1); PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); } @@ -17084,11 +17314,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_ return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKTxCreationKeys this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + TxCreationKeys_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -17247,11 +17477,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelPublicKeys this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelPublicKeys_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -17460,11 +17690,11 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeem return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - HTLCOutputInCommitment_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHTLCOutputInCommitment this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + HTLCOutputInCommitment_free(this_obj_conv); } JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -17615,11 +17845,11 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transactio return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t 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); - ChannelTransactionParameters_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelTransactionParameters this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelTransactionParameters_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -17764,11 +17994,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCounterpartyChannelTransactionParameters this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CounterpartyChannelTransactionParameters_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -17918,11 +18148,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDirectedChannelTransactionParameters this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + DirectedChannelTransactionParameters_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -17983,11 +18213,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHolderCommitmentTransaction 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); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHolderCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + HolderCommitmentTransaction_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -18101,11 +18331,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t 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); - BuiltCommitmentTransaction_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBuiltCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + BuiltCommitmentTransaction_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -18234,11 +18464,11 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t 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); - CommitmentTransaction_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CommitmentTransaction_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { @@ -18340,11 +18570,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1veri return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t 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 void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKTrustedCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + TrustedCommitmentTransaction_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -18453,25 +18683,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIE return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInitFeatures this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - InitFeatures_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInitFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + InitFeatures_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeFeatures this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NodeFeatures_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NodeFeatures_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelFeatures this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelFeatures_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelFeatures_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) { @@ -18603,11 +18833,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEn return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHop this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - RouteHop_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRouteHop this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + RouteHop_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -18760,11 +18990,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRoute this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - Route_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRoute this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + Route_free(this_obj_conv); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { @@ -18872,11 +19102,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv *env, jc return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRouteHint this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - RouteHint_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRouteHint this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + RouteHint_free(this_obj_conv); } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -19019,11 +19249,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv *env, jcl return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNetworkGraph this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NetworkGraph_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNetworkGraph this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NetworkGraph_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone(JNIEnv *env, jclass clz, int64_t orig) { @@ -19040,31 +19270,41 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKLockedNetworkGraph this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - LockedNetworkGraph_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKLockedNetworkGraph this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + LockedNetworkGraph_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNetGraphMsgHandler this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NetGraphMsgHandler_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNetGraphMsgHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NetGraphMsgHandler_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv *env, jclass clz, int8_tArray genesis_hash, int64_t chain_access, int64_t 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; + LDKAccess *chain_access_conv_ptr = NULL; + if (chain_access != 0) { + LDKAccess chain_access_conv; + chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1); + if (chain_access_conv.free == LDKAccess_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAccess_JCalls_clone(chain_access_conv.this_arg); + } + chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *chain_access_conv_ptr = chain_access_conv; + } LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1); 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(genesis_hash_ref, chain_access_conv, logger_conv); + LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(genesis_hash_ref, chain_access_conv_ptr, 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; @@ -19075,7 +19315,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv *env, jclass clz, int64_t chain_access, int64_t logger, int64_t network_graph) { - LDKAccess* chain_access_conv = (LDKAccess*)chain_access; + LDKAccess *chain_access_conv_ptr = NULL; + if (chain_access != 0) { + LDKAccess chain_access_conv; + chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1); + if (chain_access_conv.free == LDKAccess_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAccess_JCalls_clone(chain_access_conv.this_arg); + } + chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *chain_access_conv_ptr = chain_access_conv; + } LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1); if (logger_conv.free == LDKLogger_JCalls_free) { // If this_arg is a JCalls struct, then we need to increment the refcnt in it. @@ -19085,7 +19335,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1n network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0); network_graph_conv = NetworkGraph_clone(&network_graph_conv); - LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv); + LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_from_net_graph(chain_access_conv_ptr, logger_conv, network_graph_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; @@ -19099,8 +19349,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - LDKAccess* chain_access_conv = (LDKAccess*)chain_access; - NetGraphMsgHandler_add_chain_access(&this_arg_conv, chain_access_conv); + LDKAccess *chain_access_conv_ptr = NULL; + if (chain_access != 0) { + LDKAccess chain_access_conv; + chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1); + if (chain_access_conv.free == LDKAccess_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAccess_JCalls_clone(chain_access_conv.this_arg); + } + chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *chain_access_conv_ptr = chain_access_conv; + } + NetGraphMsgHandler_add_chain_access(&this_arg_conv, chain_access_conv_ptr); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -19149,11 +19409,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1Mes return (long)ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDirectionalChannelInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - DirectionalChannelInfo_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDirectionalChannelInfo this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + DirectionalChannelInfo_free(this_obj_conv); } JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -19301,11 +19561,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1rea return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelInfo_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelInfo this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelInfo_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -19481,11 +19741,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv *e return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRoutingFees this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - RoutingFees_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRoutingFees this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + RoutingFees_free(this_obj_conv); } JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -19564,11 +19824,11 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIE return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NodeAnnouncementInfo_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeAnnouncementInfo this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NodeAnnouncementInfo_free(this_obj_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -19769,11 +20029,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read( return (long)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NodeInfo_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeInfo this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NodeInfo_free(this_obj_conv); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { @@ -19977,9 +20237,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; - LDKAccess* chain_access_conv = (LDKAccess*)chain_access; + LDKAccess *chain_access_conv_ptr = NULL; + if (chain_access != 0) { + LDKAccess chain_access_conv; + chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1); + if (chain_access_conv.free == LDKAccess_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAccess_JCalls_clone(chain_access_conv.this_arg); + } + chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *chain_access_conv_ptr = chain_access_conv; + } 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); + *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv_ptr); return (long)ret_conv; } @@ -19990,9 +20260,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; - LDKAccess* chain_access_conv = (LDKAccess*)chain_access; + LDKAccess *chain_access_conv_ptr = NULL; + if (chain_access != 0) { + LDKAccess chain_access_conv; + chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1); + if (chain_access_conv.free == LDKAccess_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAccess_JCalls_clone(chain_access_conv.this_arg); + } + chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *chain_access_conv_ptr = chain_access_conv; + } 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); + *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv_ptr); 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 623d4a4a..918e0b03 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -1119,6 +1119,70 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1get_1b (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2Tuple_u32ScriptZ_new + * Signature: (I[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32ScriptZ_1new + (JNIEnv *, jclass, jint, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2Tuple_u32ScriptZ_get_a + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32ScriptZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2Tuple_u32ScriptZ_get_b + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32ScriptZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVec_C2Tuple_u32ScriptZZ_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32ScriptZZ_1new + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new + * Signature: ([B[J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new + (JNIEnv *, jclass, jbyteArray, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKC2Tuple_u32TxOutZ_new @@ -4303,6 +4367,62 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_u32ScriptZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_u32ScriptZ_new + * Signature: (I[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new + (JNIEnv *, jclass, jint, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_u32ScriptZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_u32ScriptZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new + * Signature: ([B[J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new + (JNIEnv *, jclass, jbyteArray, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: CVec_TransactionZ_free @@ -6839,6 +6959,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMonitor_get_outputs_to_watch + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1outputs_1to_1watch + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMonitor_load_outputs_to_watch + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_1to_1watch + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelMonitor_get_and_clear_pending_monitor_events diff --git a/ts/bindings.c b/ts/bindings.c index 6a6178c5..d6b93137 100644 --- a/ts/bindings.c +++ b/ts/bindings.c @@ -1446,6 +1446,107 @@ int8_tArray __attribute__((visibility("default"))) TS_LDKC2Tuple_OutPointScript memcpy((uint8_t*)(b_arr + 4), b_var.data, b_var.datalen); return b_arr; } +uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_u32ScriptZ_new(int32_t a, int8_tArray b) { + LDKC2Tuple_u32ScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + ret->a = a; + LDKCVec_u8Z b_ref; + b_ref.datalen = *((uint32_t*)b); + b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(b_ref.data, (uint8_t*)(b + 4), b_ref.datalen); + ret->b = b_ref; + return (long)ret; +} +int32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_u32ScriptZ_get_a(uint32_t ptr) { + LDKC2Tuple_u32ScriptZ *tuple = (LDKC2Tuple_u32ScriptZ*)(ptr & ~1); + return tuple->a; +} +int8_tArray __attribute__((visibility("default"))) TS_LDKC2Tuple_u32ScriptZ_get_b(uint32_t ptr) { + LDKC2Tuple_u32ScriptZ *tuple = (LDKC2Tuple_u32ScriptZ*)(ptr & ~1); + LDKCVec_u8Z b_var = tuple->b; + int8_tArray b_arr = init_arr(b_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(b_arr + 4), b_var.data, b_var.datalen); + return b_arr; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_u32ScriptZZ_new(uint32_tArray elems) { + LDKCVec_C2Tuple_u32ScriptZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32ScriptZZ), "LDKCVec_C2Tuple_u32ScriptZZ"); + ret->datalen = *((uint32_t*)elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * ret->datalen, "LDKCVec_C2Tuple_u32ScriptZZ Data"); + uint32_t *java_elems = (uint32_t*)(elems + 4); + for (size_t i = 0; i < ret->datalen; i++) { + uint32_t arr_elem = java_elems[i]; + LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1); + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + } + return (long)ret; +} +static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { + LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]); + } + return ret; +} +uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint32_tArray b) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + LDKThirtyTwoBytes a_ref; + CHECK(*((uint32_t*)a) == 32); + memcpy(a_ref.data, (uint8_t*)(a + 4), 32); + ret->a = a_ref; + LDKCVec_C2Tuple_u32ScriptZZ b_constr; + b_constr.datalen = *((uint32_t*)b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); + else + b_constr.data = NULL; + uint32_t* b_vals = (uint32_t*)(b + 4); + for (size_t e = 0; e < b_constr.datalen; e++) { + uint32_t b_conv_30 = b_vals[e]; + LDKC2Tuple_u32ScriptZ b_conv_30_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_30) & ~1); + FREE((void*)b_conv_30); + b_constr.data[e] = b_conv_30_conv; + } + ret->b = b_constr; + return (long)ret; +} +int8_tArray __attribute__((visibility("default"))) TS_LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(uint32_t ptr) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *tuple = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(ptr & ~1); + int8_tArray a_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(a_arr + 4), tuple->a.data, 32); + return a_arr; +} +uint32_tArray __attribute__((visibility("default"))) TS_LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(uint32_t ptr) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *tuple = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(ptr & ~1); + LDKCVec_C2Tuple_u32ScriptZZ b_var = tuple->b; + uint32_tArray b_arr = init_arr(b_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); + uint32_t *b_arr_ptr = (uint32_t*)(b_arr + 4); + for (size_t e = 0; e < b_var.datalen; e++) { + long b_conv_30_ref = (long)(&b_var.data[e]) | 1; + b_arr_ptr[e] = b_conv_30_ref; + } + return b_arr; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new(uint32_tArray elems) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ"); + ret->datalen = *((uint32_t*)elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Data"); + uint32_t *java_elems = (uint32_t*)(elems + 4); + for (size_t i = 0; i < ret->datalen; i++) { + uint32_t arr_elem = java_elems[i]; + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1); + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + } + return (long)ret; +} uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_u32TxOutZ_new(int32_t a, uint32_t b) { LDKC2Tuple_u32TxOutZ* ret = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); ret->a = a; @@ -1828,28 +1929,28 @@ long __attribute__((visibility("default"))) TS_LDKSign_new(/*TODO: JS Object Re return (long)res_ptr; } int8_tArray __attribute__((visibility("default"))) TS_Sign_get_per_commitment_point(uint32_t this_arg, int64_t idx) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33); return ret_arr; } int8_tArray __attribute__((visibility("default"))) TS_Sign_release_commitment_secret(uint32_t this_arg, int64_t idx) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32); return ret_arr; } int8_tArray __attribute__((visibility("default"))) TS_Sign_channel_keys_id(uint32_t this_arg) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32); return ret_arr; } uint32_t __attribute__((visibility("default"))) TS_Sign_sign_counterparty_commitment(uint32_t this_arg, uint32_t commitment_tx) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; @@ -1859,7 +1960,7 @@ uint32_t __attribute__((visibility("default"))) TS_Sign_sign_counterparty_commi } uint32_t __attribute__((visibility("default"))) TS_Sign_sign_holder_commitment_and_htlcs(uint32_t this_arg, uint32_t commitment_tx) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKHolderCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; @@ -1869,7 +1970,7 @@ uint32_t __attribute__((visibility("default"))) TS_Sign_sign_holder_commitment_ } uint32_t __attribute__((visibility("default"))) TS_Sign_sign_justice_transaction(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKTransaction justice_tx_ref; justice_tx_ref.datalen = *((uint32_t*)justice_tx); justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); @@ -1888,7 +1989,7 @@ uint32_t __attribute__((visibility("default"))) TS_Sign_sign_justice_transactio } uint32_t __attribute__((visibility("default"))) TS_Sign_sign_counterparty_htlc_transaction(uint32_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKTransaction htlc_tx_ref; htlc_tx_ref.datalen = *((uint32_t*)htlc_tx); htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes"); @@ -1906,7 +2007,7 @@ uint32_t __attribute__((visibility("default"))) TS_Sign_sign_counterparty_htlc_ } uint32_t __attribute__((visibility("default"))) TS_Sign_sign_closing_transaction(uint32_t this_arg, int8_tArray closing_tx) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKTransaction closing_tx_ref; closing_tx_ref.datalen = *((uint32_t*)closing_tx); closing_tx_ref.data = MALLOC(closing_tx_ref.datalen, "LDKTransaction Bytes"); @@ -1918,7 +2019,7 @@ uint32_t __attribute__((visibility("default"))) TS_Sign_sign_closing_transactio } uint32_t __attribute__((visibility("default"))) TS_Sign_sign_channel_announcement(uint32_t this_arg, uint32_t msg) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -1928,7 +2029,7 @@ uint32_t __attribute__((visibility("default"))) TS_Sign_sign_channel_announceme } void __attribute__((visibility("default"))) TS_Sign_ready_channel(uint32_t this_arg, uint32_t channel_parameters) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; @@ -1936,7 +2037,7 @@ void __attribute__((visibility("default"))) TS_Sign_ready_channel(uint32_t this } int8_tArray __attribute__((visibility("default"))) TS_Sign_write(uint32_t this_arg) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -1950,7 +2051,7 @@ LDKChannelPublicKeys LDKSign_set_get_pubkeys(LDKSign* this_arg) { return this_arg->pubkeys; } uint32_t __attribute__((visibility("default"))) TS_Sign_get_pubkeys(uint32_t this_arg) { - LDKSign* this_arg_conv = (LDKSign*)this_arg; + LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1); LDKChannelPublicKeys ret_var = LDKSign_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. @@ -2299,7 +2400,7 @@ long __attribute__((visibility("default"))) TS_LDKWatch_new(/*TODO: JS Object R return (long)res_ptr; } uint32_t __attribute__((visibility("default"))) TS_Watch_watch_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t monitor) { - LDKWatch* this_arg_conv = (LDKWatch*)this_arg; + LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); @@ -2314,7 +2415,7 @@ uint32_t __attribute__((visibility("default"))) TS_Watch_watch_channel(uint32_t } uint32_t __attribute__((visibility("default"))) TS_Watch_update_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t update) { - LDKWatch* this_arg_conv = (LDKWatch*)this_arg; + LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); @@ -2329,7 +2430,7 @@ uint32_t __attribute__((visibility("default"))) TS_Watch_update_channel(uint32_ } uint32_tArray __attribute__((visibility("default"))) TS_Watch_release_pending_monitor_events(uint32_t this_arg) { - LDKWatch* this_arg_conv = (LDKWatch*)this_arg; + LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1); LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4); @@ -2385,7 +2486,7 @@ long __attribute__((visibility("default"))) TS_LDKBroadcasterInterface_new(/*TO return (long)res_ptr; } void __attribute__((visibility("default"))) TS_BroadcasterInterface_broadcast_transaction(uint32_t this_arg, int8_tArray tx) { - LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg; + LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)(((uint64_t)this_arg) & ~1); LDKTransaction tx_ref; tx_ref.datalen = *((uint32_t*)tx); tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); @@ -2512,14 +2613,14 @@ long __attribute__((visibility("default"))) TS_LDKKeysInterface_new(/*TODO: JS return (long)res_ptr; } int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_node_secret(uint32_t this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes, 32); return ret_arr; } int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_destination_script(uint32_t this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -2528,28 +2629,28 @@ int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_destina } int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_shutdown_pubkey(uint32_t this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_shutdown_pubkey)(this_arg_conv->this_arg).compressed_form, 33); return ret_arr; } uint32_t __attribute__((visibility("default"))) TS_KeysInterface_get_channel_signer(uint32_t this_arg, jboolean inbound, int64_t channel_value_satoshis) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis); return (long)ret; } int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_secure_random_bytes(uint32_t this_arg) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32); return ret_arr; } uint32_t __attribute__((visibility("default"))) TS_KeysInterface_read_chan_signer(uint32_t this_arg, int8_tArray reader) { - LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1); LDKu8slice reader_ref; reader_ref.datalen = *((uint32_t*)reader); reader_ref.data = (int8_t*)(reader + 4); @@ -2597,7 +2698,7 @@ long __attribute__((visibility("default"))) TS_LDKFeeEstimator_new(/*TODO: JS O return (long)res_ptr; } int32_t __attribute__((visibility("default"))) TS_FeeEstimator_get_est_sat_per_1000_weight(uint32_t this_arg, uint32_t confirmation_target) { - LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg; + LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)(((uint64_t)this_arg) & ~1); LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target); int32_t ret_val = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv); return ret_val; @@ -3737,7 +3838,7 @@ long __attribute__((visibility("default"))) TS_LDKMessageSendEventsProvider_new return (long)res_ptr; } uint32_tArray __attribute__((visibility("default"))) TS_MessageSendEventsProvider_get_and_clear_pending_msg_events(uint32_t this_arg) { - LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg; + LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)(((uint64_t)this_arg) & ~1); LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg); uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4); @@ -3803,7 +3904,7 @@ long __attribute__((visibility("default"))) TS_LDKEventsProvider_new(/*TODO: JS return (long)res_ptr; } uint32_tArray __attribute__((visibility("default"))) TS_EventsProvider_get_and_clear_pending_events(uint32_t this_arg) { - LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg; + LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)(((uint64_t)this_arg) & ~1); LDKCVec_EventZ ret_var = (this_arg_conv->get_and_clear_pending_events)(this_arg_conv->this_arg); uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4); @@ -3860,7 +3961,7 @@ long __attribute__((visibility("default"))) TS_LDKAccess_new(/*TODO: JS Object return (long)res_ptr; } uint32_t __attribute__((visibility("default"))) TS_Access_get_utxo(uint32_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) { - LDKAccess* this_arg_conv = (LDKAccess*)this_arg; + LDKAccess* this_arg_conv = (LDKAccess*)(((uint64_t)this_arg) & ~1); unsigned char genesis_hash_arr[32]; CHECK(*((uint32_t*)genesis_hash) == 32); memcpy(genesis_hash_arr, (uint8_t*)(genesis_hash + 4), 32); @@ -3920,7 +4021,7 @@ long __attribute__((visibility("default"))) TS_LDKListen_new(/*TODO: JS Object return (long)res_ptr; } void __attribute__((visibility("default"))) TS_Listen_block_connected(uint32_t this_arg, int8_tArray block, int32_t height) { - LDKListen* this_arg_conv = (LDKListen*)this_arg; + LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1); LDKu8slice block_ref; block_ref.datalen = *((uint32_t*)block); block_ref.data = (int8_t*)(block + 4); @@ -3928,7 +4029,7 @@ void __attribute__((visibility("default"))) TS_Listen_block_connected(uint32_t } void __attribute__((visibility("default"))) TS_Listen_block_disconnected(uint32_t this_arg, int8_tArray header, int32_t height) { - LDKListen* this_arg_conv = (LDKListen*)this_arg; + LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1); unsigned char header_arr[80]; CHECK(*((uint32_t*)header) == 80); memcpy(header_arr, (uint8_t*)(header + 4), 80); @@ -3997,7 +4098,7 @@ long __attribute__((visibility("default"))) TS_LDKFilter_new(/*TODO: JS Object return (long)res_ptr; } void __attribute__((visibility("default"))) TS_Filter_register_tx(uint32_t this_arg, int8_tArray txid, int8_tArray script_pubkey) { - LDKFilter* this_arg_conv = (LDKFilter*)this_arg; + LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1); unsigned char txid_arr[32]; CHECK(*((uint32_t*)txid) == 32); memcpy(txid_arr, (uint8_t*)(txid + 4), 32); @@ -4009,7 +4110,7 @@ void __attribute__((visibility("default"))) TS_Filter_register_tx(uint32_t this } void __attribute__((visibility("default"))) TS_Filter_register_output(uint32_t this_arg, uint32_t outpoint, int8_tArray script_pubkey) { - LDKFilter* this_arg_conv = (LDKFilter*)this_arg; + LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1); LDKOutPoint outpoint_conv; outpoint_conv.inner = (void*)(outpoint & (~1)); outpoint_conv.is_owned = false; @@ -4108,7 +4209,7 @@ long __attribute__((visibility("default"))) TS_LDKPersist_new(/*TODO: JS Object return (long)res_ptr; } uint32_t __attribute__((visibility("default"))) TS_Persist_persist_new_channel(uint32_t this_arg, uint32_t id, uint32_t data) { - LDKPersist* this_arg_conv = (LDKPersist*)this_arg; + LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1); LDKOutPoint id_conv; id_conv.inner = (void*)(id & (~1)); id_conv.is_owned = (id & 1) || (id == 0); @@ -4122,7 +4223,7 @@ uint32_t __attribute__((visibility("default"))) TS_Persist_persist_new_channel( } uint32_t __attribute__((visibility("default"))) TS_Persist_update_persisted_channel(uint32_t this_arg, uint32_t id, uint32_t update, uint32_t data) { - LDKPersist* this_arg_conv = (LDKPersist*)this_arg; + LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1); LDKOutPoint id_conv; id_conv.inner = (void*)(id & (~1)); id_conv.is_owned = (id & 1) || (id == 0); @@ -4510,7 +4611,7 @@ long __attribute__((visibility("default"))) TS_LDKChannelMessageHandler_new(/*T return (long)res_ptr; } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_open_channel(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4525,7 +4626,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_ope } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_accept_channel(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4540,7 +4641,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_acc } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_funding_created(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4551,7 +4652,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_fun } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_funding_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4562,7 +4663,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_fun } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_funding_locked(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4573,7 +4674,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_fun } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_shutdown(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4587,7 +4688,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_shu } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_closing_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4598,7 +4699,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_clo } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_add_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4609,7 +4710,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fulfill_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4620,7 +4721,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fail_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4631,7 +4732,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fail_malformed_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4642,7 +4743,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_commitment_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4653,7 +4754,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_com } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_revoke_and_ack(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4664,7 +4765,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_rev } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fee(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4675,7 +4776,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_announcement_signatures(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4686,7 +4787,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_ann } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_peer_disconnected(uint32_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4694,7 +4795,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_peer_disco } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_peer_connected(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4705,7 +4806,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_peer_conne } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_channel_reestablish(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4716,7 +4817,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_cha } void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_error(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; + LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -4962,7 +5063,7 @@ long __attribute__((visibility("default"))) TS_LDKRoutingMessageHandler_new(/*T return (long)res_ptr; } uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_node_announcement(uint32_t this_arg, uint32_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -4972,7 +5073,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle } uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_channel_announcement(uint32_t this_arg, uint32_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -4982,7 +5083,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle } uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_channel_update(uint32_t this_arg, uint32_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -4992,13 +5093,13 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle } void __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_htlc_fail_channel_update(uint32_t this_arg, uint32_t update) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKHTLCFailChannelUpdate* update_conv = (LDKHTLCFailChannelUpdate*)update; (this_arg_conv->handle_htlc_fail_channel_update)(this_arg_conv->this_arg, update_conv); } uint32_tArray __attribute__((visibility("default"))) TS_RoutingMessageHandler_get_next_channel_announcements(uint32_t this_arg, int64_t starting_point, int8_t batch_amount) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount); uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4); @@ -5012,7 +5113,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RoutingMessageHandler_g } uint32_tArray __attribute__((visibility("default"))) TS_RoutingMessageHandler_get_next_node_announcements(uint32_t this_arg, int8_tArray starting_point, int8_t batch_amount) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey starting_point_ref; CHECK(*((uint32_t*)starting_point) == 33); memcpy(starting_point_ref.compressed_form, (uint8_t*)(starting_point + 4), 33); @@ -5034,7 +5135,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RoutingMessageHandler_g } void __attribute__((visibility("default"))) TS_RoutingMessageHandler_sync_routing_table(uint32_t this_arg, int8_tArray their_node_id, uint32_t init) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -5045,7 +5146,7 @@ void __attribute__((visibility("default"))) TS_RoutingMessageHandler_sync_routi } uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_reply_channel_range(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -5059,7 +5160,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle } uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_reply_short_channel_ids_end(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -5073,7 +5174,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle } uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_query_channel_range(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -5087,7 +5188,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle } uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_query_short_channel_ids(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; + LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -5165,7 +5266,7 @@ long __attribute__((visibility("default"))) TS_LDKSocketDescriptor_new(/*TODO: return (long)res_ptr; } int64_t __attribute__((visibility("default"))) TS_SocketDescriptor_send_data(uint32_t this_arg, int8_tArray data, jboolean resume_read) { - LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; + LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1); LDKu8slice data_ref; data_ref.datalen = *((uint32_t*)data); data_ref.data = (int8_t*)(data + 4); @@ -5174,12 +5275,12 @@ int64_t __attribute__((visibility("default"))) TS_SocketDescriptor_send_data(ui } void __attribute__((visibility("default"))) TS_SocketDescriptor_disconnect_socket(uint32_t this_arg) { - LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; + LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1); (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg); } int64_t __attribute__((visibility("default"))) TS_SocketDescriptor_hash(uint32_t this_arg) { - LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; + LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1); int64_t ret_val = (this_arg_conv->hash)(this_arg_conv->this_arg); return ret_val; } @@ -6501,6 +6602,93 @@ void __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_free(uin C2Tuple_OutPointScriptZ_free(_res_conv); } +uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_clone(uint32_t orig) { + LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); + LDKC2Tuple_u32ScriptZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_ref = C2Tuple_u32ScriptZ_clone(orig_conv); + return (long)ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_new(int32_t a, int8_tArray b) { + LDKCVec_u8Z b_ref; + b_ref.datalen = *((uint32_t*)b); + b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(b_ref.data, (uint8_t*)(b + 4), b_ref.datalen); + LDKC2Tuple_u32ScriptZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_ref = C2Tuple_u32ScriptZ_new(a, b_ref); + return (long)ret_ref; +} + +void __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + C2Tuple_u32ScriptZ_free(_res_conv); +} + +void __attribute__((visibility("default"))) TS_CVec_C2Tuple_u32ScriptZZ_free(uint32_tArray _res) { + LDKCVec_C2Tuple_u32ScriptZZ _res_constr; + _res_constr.datalen = *((uint32_t*)_res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); + else + _res_constr.data = NULL; + uint32_t* _res_vals = (uint32_t*)(_res + 4); + for (size_t e = 0; e < _res_constr.datalen; e++) { + uint32_t _res_conv_30 = _res_vals[e]; + LDKC2Tuple_u32ScriptZ _res_conv_30_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res_conv_30) & ~1); + FREE((void*)_res_conv_30); + _res_constr.data[e] = _res_conv_30_conv; + } + CVec_C2Tuple_u32ScriptZZ_free(_res_constr); +} + +uint32_t __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint32_tArray b) { + LDKThirtyTwoBytes a_ref; + CHECK(*((uint32_t*)a) == 32); + memcpy(a_ref.data, (uint8_t*)(a + 4), 32); + LDKCVec_C2Tuple_u32ScriptZZ b_constr; + b_constr.datalen = *((uint32_t*)b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); + else + b_constr.data = NULL; + uint32_t* b_vals = (uint32_t*)(b + 4); + for (size_t e = 0; e < b_constr.datalen; e++) { + uint32_t b_conv_30 = b_vals[e]; + LDKC2Tuple_u32ScriptZ b_conv_30_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_30) & ~1); + FREE((void*)b_conv_30); + b_constr.data[e] = b_conv_30_conv; + } + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_ref = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr); + return (long)ret_ref; +} + +void __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res) & ~1); + FREE((void*)_res); + C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv); +} + +void __attribute__((visibility("default"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(uint32_tArray _res) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr; + _res_constr.datalen = *((uint32_t*)_res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements"); + else + _res_constr.data = NULL; + uint32_t* _res_vals = (uint32_t*)(_res + 4); + for (size_t c = 0; c < _res_constr.datalen; c++) { + uint32_t _res_conv_54 = _res_vals[c]; + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_54_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res_conv_54) & ~1); + FREE((void*)_res_conv_54); + _res_constr.data[c] = _res_conv_54_conv; + } + CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr); +} + void __attribute__((visibility("default"))) TS_CVec_TransactionZ_free(ptrArray _res) { LDKCVec_TransactionZ _res_constr; _res_constr.datalen = *((uint32_t*)_res); @@ -8565,11 +8753,11 @@ void __attribute__((visibility("default"))) TS_Logger_free(uint32_t this_ptr) { Logger_free(this_ptr_conv); } -void __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_free(uint32_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelHandshakeConfig_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_free(uint32_t this_obj) { + LDKChannelHandshakeConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelHandshakeConfig_free(this_obj_conv); } int32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_get_minimum_depth(uint32_t this_ptr) { @@ -8653,11 +8841,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_defau return ret_ref; } -void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_free(uint32_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelHandshakeLimits_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_free(uint32_t this_obj) { + LDKChannelHandshakeLimits this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelHandshakeLimits_free(this_obj_conv); } int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_min_funding_satoshis(uint32_t this_ptr) { @@ -8846,11 +9034,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_defau return ret_ref; } -void __attribute__((visibility("default"))) TS_ChannelConfig_free(uint32_t this_ptr) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelConfig_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelConfig_free(uint32_t this_obj) { + LDKChannelConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelConfig_free(this_obj_conv); } int32_t __attribute__((visibility("default"))) TS_ChannelConfig_get_fee_proportional_millionths(uint32_t this_ptr) { @@ -8954,11 +9142,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_read(int8_tArr return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_UserConfig_free(uint32_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UserConfig_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_UserConfig_free(uint32_t this_obj) { + LDKUserConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UserConfig_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_UserConfig_get_own_channel_config(uint32_t this_ptr) { @@ -9138,11 +9326,11 @@ void __attribute__((visibility("default"))) TS_FeeEstimator_free(uint32_t this_ FeeEstimator_free(this_ptr_conv); } -void __attribute__((visibility("default"))) TS_ChainMonitor_free(uint32_t this_ptr) { - LDKChainMonitor this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChainMonitor_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChainMonitor_free(uint32_t this_obj) { + LDKChainMonitor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChainMonitor_free(this_obj_conv); } void __attribute__((visibility("default"))) TS_ChainMonitor_block_connected(uint32_t this_arg, int8_tArray header, uint32_tArray txdata, int32_t height) { @@ -9181,12 +9369,18 @@ void __attribute__((visibility("default"))) TS_ChainMonitor_block_disconnected( } uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_new(uint32_t chain_source, uint32_t broadcaster, uint32_t logger, uint32_t feeest, uint32_t persister) { - LDKFilter* chain_source_conv = (LDKFilter*)chain_source; + LDKFilter *chain_source_conv_ptr = NULL; + if (chain_source != 0) { + LDKFilter chain_source_conv; + chain_source_conv = *(LDKFilter*)(((uint64_t)chain_source) & ~1); + chain_source_conv_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter"); + *chain_source_conv_ptr = chain_source_conv; + } LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1); LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1); LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(((uint64_t)feeest) & ~1); LDKPersist persister_conv = *(LDKPersist*)(((uint64_t)persister) & ~1); - LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); + LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv_ptr, 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; @@ -9214,11 +9408,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_EventsProvid return (long)ret; } -void __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_free(uint32_t this_ptr) { - LDKChannelMonitorUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelMonitorUpdate_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_free(uint32_t this_obj) { + LDKChannelMonitorUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelMonitorUpdate_free(this_obj_conv); } int64_t __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_get_update_id(uint32_t this_ptr) { @@ -9276,11 +9470,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelMonitorUpdateErr_clon return ret_conv; } -void __attribute__((visibility("default"))) TS_MonitorUpdateError_free(uint32_t this_ptr) { - LDKMonitorUpdateError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - MonitorUpdateError_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_MonitorUpdateError_free(uint32_t this_obj) { + LDKMonitorUpdateError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + MonitorUpdateError_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_clone(uint32_t orig) { @@ -9312,11 +9506,11 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_clone(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_HTLCUpdate_free(uint32_t this_ptr) { - LDKHTLCUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - HTLCUpdate_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_HTLCUpdate_free(uint32_t this_obj) { + LDKHTLCUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + HTLCUpdate_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_HTLCUpdate_clone(uint32_t orig) { @@ -9353,11 +9547,11 @@ uint32_t __attribute__((visibility("default"))) TS_HTLCUpdate_read(int8_tArray return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_ChannelMonitor_free(uint32_t this_ptr) { - LDKChannelMonitor this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelMonitor_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelMonitor_free(uint32_t this_obj) { + LDKChannelMonitor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelMonitor_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_clone(uint32_t orig) { @@ -9392,9 +9586,9 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_update_monito LDKChannelMonitorUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = false; - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster; - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator; - LDKLogger* logger_conv = (LDKLogger*)logger; + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1); + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1); + LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); return (long)ret_conv; @@ -9417,6 +9611,30 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_get_funding_t return (long)ret_ref; } +uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_outputs_to_watch(uint32_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); + uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); + uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4); + for (size_t c = 0; c < ret_var.datalen; c++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_54_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv_54_ref = ret_var.data[c]; + ret_arr_ptr[c] = (long)ret_conv_54_ref; + } + FREE(ret_var.data); + return ret_arr; +} + +void __attribute__((visibility("default"))) TS_ChannelMonitor_load_outputs_to_watch(uint32_t this_arg, uint32_t filter) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + LDKFilter* filter_conv = (LDKFilter*)(((uint64_t)filter) & ~1); + ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv); +} + uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_and_clear_pending_monitor_events(uint32_t this_arg) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); @@ -9455,7 +9673,7 @@ ptrArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_latest_ho LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - LDKLogger* logger_conv = (LDKLogger*)logger; + LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1); LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes"); int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4); @@ -9531,17 +9749,17 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMoni LDKu8slice ser_ref; ser_ref.datalen = *((uint32_t*)ser); ser_ref.data = (int8_t*)(ser + 4); - LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg; + LDKKeysInterface* arg_conv = (LDKKeysInterface*)(((uint64_t)arg) & ~1); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv); return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_OutPoint_free(uint32_t this_ptr) { - LDKOutPoint this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - OutPoint_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_OutPoint_free(uint32_t this_obj) { + LDKOutPoint this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + OutPoint_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_OutPoint_get_txid(uint32_t this_ptr) { @@ -9635,11 +9853,11 @@ uint32_t __attribute__((visibility("default"))) TS_OutPoint_read(int8_tArray se return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_free(uint32_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - DelayedPaymentOutputDescriptor_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_free(uint32_t this_obj) { + LDKDelayedPaymentOutputDescriptor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + DelayedPaymentOutputDescriptor_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_get_outpoint(uint32_t this_ptr) { @@ -9803,11 +10021,11 @@ uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescript return ret_ref; } -void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_free(uint32_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - StaticPaymentOutputDescriptor_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_free(uint32_t this_obj) { + LDKStaticPaymentOutputDescriptor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + StaticPaymentOutputDescriptor_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_get_outpoint(uint32_t this_ptr) { @@ -9946,7 +10164,7 @@ uint32_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_re } uint32_t __attribute__((visibility("default"))) TS_Sign_clone(uint32_t orig) { - LDKSign* orig_conv = (LDKSign*)orig; + LDKSign* orig_conv = (LDKSign*)(((uint64_t)orig) & ~1); LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret = Sign_clone(orig_conv); return (long)ret; @@ -9966,11 +10184,11 @@ void __attribute__((visibility("default"))) TS_KeysInterface_free(uint32_t this KeysInterface_free(this_ptr_conv); } -void __attribute__((visibility("default"))) TS_InMemorySigner_free(uint32_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - InMemorySigner_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_InMemorySigner_free(uint32_t this_obj) { + LDKInMemorySigner this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + InMemorySigner_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_funding_key(uint32_t this_ptr) { @@ -10262,11 +10480,11 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_read(int8_tAr return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_KeysManager_free(uint32_t this_ptr) { - LDKKeysManager this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - KeysManager_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_KeysManager_free(uint32_t this_obj) { + LDKKeysManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + KeysManager_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { @@ -10350,18 +10568,18 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_as_KeysInterface return (long)ret; } -void __attribute__((visibility("default"))) TS_ChannelManager_free(uint32_t this_ptr) { - LDKChannelManager this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelManager_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelManager_free(uint32_t this_obj) { + LDKChannelManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelManager_free(this_obj_conv); } -void __attribute__((visibility("default"))) TS_ChainParameters_free(uint32_t this_ptr) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChainParameters_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChainParameters_free(uint32_t this_obj) { + LDKChainParameters this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChainParameters_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_ChainParameters_get_network(uint32_t this_ptr) { @@ -10429,11 +10647,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChainParameters_new(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_ChannelDetails_free(uint32_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelDetails_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelDetails_free(uint32_t this_obj) { + LDKChannelDetails this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelDetails_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_ChannelDetails_get_channel_id(uint32_t this_ptr) { @@ -10928,11 +11146,11 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelManager_write(uint return ret_arr; } -void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_free(uint32_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelManagerReadArgs_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_free(uint32_t this_obj) { + LDKChannelManagerReadArgs this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelManagerReadArgs_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_keys_manager(uint32_t this_ptr) { @@ -11087,11 +11305,11 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMana return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_DecodeError_free(uint32_t this_ptr) { - LDKDecodeError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - DecodeError_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_DecodeError_free(uint32_t this_obj) { + LDKDecodeError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + DecodeError_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_DecodeError_clone(uint32_t orig) { @@ -11108,11 +11326,11 @@ uint32_t __attribute__((visibility("default"))) TS_DecodeError_clone(uint32_t o return ret_ref; } -void __attribute__((visibility("default"))) TS_Init_free(uint32_t this_ptr) { - LDKInit this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - Init_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_Init_free(uint32_t this_obj) { + LDKInit this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + Init_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_Init_get_features(uint32_t this_ptr) { @@ -11169,11 +11387,11 @@ uint32_t __attribute__((visibility("default"))) TS_Init_clone(uint32_t orig) { return ret_ref; } -void __attribute__((visibility("default"))) TS_ErrorMessage_free(uint32_t this_ptr) { - LDKErrorMessage this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ErrorMessage_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ErrorMessage_free(uint32_t this_obj) { + LDKErrorMessage this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ErrorMessage_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_ErrorMessage_get_channel_id(uint32_t this_ptr) { @@ -11247,11 +11465,11 @@ uint32_t __attribute__((visibility("default"))) TS_ErrorMessage_clone(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_Ping_free(uint32_t this_ptr) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - Ping_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_Ping_free(uint32_t this_obj) { + LDKPing this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + Ping_free(this_obj_conv); } int16_t __attribute__((visibility("default"))) TS_Ping_get_ponglen(uint32_t this_ptr) { @@ -11309,11 +11527,11 @@ uint32_t __attribute__((visibility("default"))) TS_Ping_clone(uint32_t orig) { return ret_ref; } -void __attribute__((visibility("default"))) TS_Pong_free(uint32_t this_ptr) { - LDKPong this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - Pong_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_Pong_free(uint32_t this_obj) { + LDKPong this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + Pong_free(this_obj_conv); } int16_t __attribute__((visibility("default"))) TS_Pong_get_byteslen(uint32_t this_ptr) { @@ -11356,11 +11574,11 @@ uint32_t __attribute__((visibility("default"))) TS_Pong_clone(uint32_t orig) { return ret_ref; } -void __attribute__((visibility("default"))) TS_OpenChannel_free(uint32_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - OpenChannel_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_OpenChannel_free(uint32_t this_obj) { + LDKOpenChannel this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + OpenChannel_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_chain_hash(uint32_t this_ptr) { @@ -11679,11 +11897,11 @@ uint32_t __attribute__((visibility("default"))) TS_OpenChannel_clone(uint32_t o return ret_ref; } -void __attribute__((visibility("default"))) TS_AcceptChannel_free(uint32_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - AcceptChannel_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_AcceptChannel_free(uint32_t this_obj) { + LDKAcceptChannel this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + AcceptChannel_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_temporary_channel_id(uint32_t this_ptr) { @@ -11938,11 +12156,11 @@ uint32_t __attribute__((visibility("default"))) TS_AcceptChannel_clone(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_FundingCreated_free(uint32_t this_ptr) { - LDKFundingCreated this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - FundingCreated_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_FundingCreated_free(uint32_t this_obj) { + LDKFundingCreated this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + FundingCreated_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_FundingCreated_get_temporary_channel_id(uint32_t this_ptr) { @@ -12051,11 +12269,11 @@ uint32_t __attribute__((visibility("default"))) TS_FundingCreated_clone(uint32_ return ret_ref; } -void __attribute__((visibility("default"))) TS_FundingSigned_free(uint32_t this_ptr) { - LDKFundingSigned this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - FundingSigned_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_FundingSigned_free(uint32_t this_obj) { + LDKFundingSigned this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + FundingSigned_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_FundingSigned_get_channel_id(uint32_t this_ptr) { @@ -12127,11 +12345,11 @@ uint32_t __attribute__((visibility("default"))) TS_FundingSigned_clone(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_FundingLocked_free(uint32_t this_ptr) { - LDKFundingLocked this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - FundingLocked_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_FundingLocked_free(uint32_t this_obj) { + LDKFundingLocked this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + FundingLocked_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_FundingLocked_get_channel_id(uint32_t this_ptr) { @@ -12203,11 +12421,11 @@ uint32_t __attribute__((visibility("default"))) TS_FundingLocked_clone(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_Shutdown_free(uint32_t this_ptr) { - LDKShutdown this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - Shutdown_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_Shutdown_free(uint32_t this_obj) { + LDKShutdown this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + Shutdown_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_Shutdown_get_channel_id(uint32_t this_ptr) { @@ -12282,11 +12500,11 @@ uint32_t __attribute__((visibility("default"))) TS_Shutdown_clone(uint32_t orig return ret_ref; } -void __attribute__((visibility("default"))) TS_ClosingSigned_free(uint32_t this_ptr) { - LDKClosingSigned this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ClosingSigned_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ClosingSigned_free(uint32_t this_obj) { + LDKClosingSigned this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ClosingSigned_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_ClosingSigned_get_channel_id(uint32_t this_ptr) { @@ -12373,11 +12591,11 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSigned_clone(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_UpdateAddHTLC_free(uint32_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UpdateAddHTLC_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_UpdateAddHTLC_free(uint32_t this_obj) { + LDKUpdateAddHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UpdateAddHTLC_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_channel_id(uint32_t this_ptr) { @@ -12477,11 +12695,11 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_clone(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_free(uint32_t this_ptr) { - LDKUpdateFulfillHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UpdateFulfillHTLC_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_free(uint32_t this_obj) { + LDKUpdateFulfillHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UpdateFulfillHTLC_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_get_channel_id(uint32_t this_ptr) { @@ -12568,11 +12786,11 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_clone(uint return ret_ref; } -void __attribute__((visibility("default"))) TS_UpdateFailHTLC_free(uint32_t this_ptr) { - LDKUpdateFailHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UpdateFailHTLC_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_UpdateFailHTLC_free(uint32_t this_obj) { + LDKUpdateFailHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UpdateFailHTLC_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_UpdateFailHTLC_get_channel_id(uint32_t this_ptr) { @@ -12623,11 +12841,11 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFailHTLC_clone(uint32_ return ret_ref; } -void __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_free(uint32_t this_ptr) { - LDKUpdateFailMalformedHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UpdateFailMalformedHTLC_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_free(uint32_t this_obj) { + LDKUpdateFailMalformedHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UpdateFailMalformedHTLC_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_get_channel_id(uint32_t this_ptr) { @@ -12693,11 +12911,11 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_clon return ret_ref; } -void __attribute__((visibility("default"))) TS_CommitmentSigned_free(uint32_t this_ptr) { - LDKCommitmentSigned this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - CommitmentSigned_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_CommitmentSigned_free(uint32_t this_obj) { + LDKCommitmentSigned this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CommitmentSigned_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_CommitmentSigned_get_channel_id(uint32_t this_ptr) { @@ -12804,11 +13022,11 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentSigned_clone(uint3 return ret_ref; } -void __attribute__((visibility("default"))) TS_RevokeAndACK_free(uint32_t this_ptr) { - LDKRevokeAndACK this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - RevokeAndACK_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_RevokeAndACK_free(uint32_t this_obj) { + LDKRevokeAndACK this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + RevokeAndACK_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_RevokeAndACK_get_channel_id(uint32_t this_ptr) { @@ -12902,11 +13120,11 @@ uint32_t __attribute__((visibility("default"))) TS_RevokeAndACK_clone(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_UpdateFee_free(uint32_t this_ptr) { - LDKUpdateFee this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UpdateFee_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_UpdateFee_free(uint32_t this_obj) { + LDKUpdateFee this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UpdateFee_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_UpdateFee_get_channel_id(uint32_t this_ptr) { @@ -12971,11 +13189,11 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFee_clone(uint32_t ori return ret_ref; } -void __attribute__((visibility("default"))) TS_DataLossProtect_free(uint32_t this_ptr) { - LDKDataLossProtect this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - DataLossProtect_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_DataLossProtect_free(uint32_t this_obj) { + LDKDataLossProtect this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + DataLossProtect_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_DataLossProtect_get_your_last_per_commitment_secret(uint32_t this_ptr) { @@ -13047,11 +13265,11 @@ uint32_t __attribute__((visibility("default"))) TS_DataLossProtect_clone(uint32 return ret_ref; } -void __attribute__((visibility("default"))) TS_ChannelReestablish_free(uint32_t this_ptr) { - LDKChannelReestablish this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelReestablish_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelReestablish_free(uint32_t this_obj) { + LDKChannelReestablish this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelReestablish_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_ChannelReestablish_get_channel_id(uint32_t this_ptr) { @@ -13117,11 +13335,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelReestablish_clone(uin return ret_ref; } -void __attribute__((visibility("default"))) TS_AnnouncementSignatures_free(uint32_t this_ptr) { - LDKAnnouncementSignatures this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - AnnouncementSignatures_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_AnnouncementSignatures_free(uint32_t this_obj) { + LDKAnnouncementSignatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + AnnouncementSignatures_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_AnnouncementSignatures_get_channel_id(uint32_t this_ptr) { @@ -13263,11 +13481,11 @@ uint32_t __attribute__((visibility("default"))) TS_Result_read(int8_tArray ser) return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_free(uint32_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UnsignedNodeAnnouncement_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_free(uint32_t this_obj) { + LDKUnsignedNodeAnnouncement this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UnsignedNodeAnnouncement_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_get_features(uint32_t this_ptr) { @@ -13401,11 +13619,11 @@ uint32_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_clo return ret_ref; } -void __attribute__((visibility("default"))) TS_NodeAnnouncement_free(uint32_t this_ptr) { - LDKNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NodeAnnouncement_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_NodeAnnouncement_free(uint32_t this_obj) { + LDKNodeAnnouncement this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NodeAnnouncement_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncement_get_signature(uint32_t this_ptr) { @@ -13484,11 +13702,11 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncement_clone(uint3 return ret_ref; } -void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_free(uint32_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UnsignedChannelAnnouncement_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_free(uint32_t this_obj) { + LDKUnsignedChannelAnnouncement this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UnsignedChannelAnnouncement_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_get_features(uint32_t this_ptr) { @@ -13640,11 +13858,11 @@ uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_ return ret_ref; } -void __attribute__((visibility("default"))) TS_ChannelAnnouncement_free(uint32_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelAnnouncement_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelAnnouncement_free(uint32_t this_obj) { + LDKChannelAnnouncement this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelAnnouncement_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_node_signature_1(uint32_t this_ptr) { @@ -13789,11 +14007,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_clone(ui return ret_ref; } -void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_free(uint32_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - UnsignedChannelUpdate_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_free(uint32_t this_obj) { + LDKUnsignedChannelUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + UnsignedChannelUpdate_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_chain_hash(uint32_t this_ptr) { @@ -13934,11 +14152,11 @@ uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_clone( return ret_ref; } -void __attribute__((visibility("default"))) TS_ChannelUpdate_free(uint32_t this_ptr) { - LDKChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelUpdate_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelUpdate_free(uint32_t this_obj) { + LDKChannelUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelUpdate_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_ChannelUpdate_get_signature(uint32_t this_ptr) { @@ -14017,11 +14235,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelUpdate_clone(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_QueryChannelRange_free(uint32_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - QueryChannelRange_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_QueryChannelRange_free(uint32_t this_obj) { + LDKQueryChannelRange this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + QueryChannelRange_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_QueryChannelRange_get_chain_hash(uint32_t this_ptr) { @@ -14101,11 +14319,11 @@ uint32_t __attribute__((visibility("default"))) TS_QueryChannelRange_clone(uint return ret_ref; } -void __attribute__((visibility("default"))) TS_ReplyChannelRange_free(uint32_t this_ptr) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ReplyChannelRange_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ReplyChannelRange_free(uint32_t this_obj) { + LDKReplyChannelRange this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ReplyChannelRange_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_ReplyChannelRange_get_chain_hash(uint32_t this_ptr) { @@ -14229,11 +14447,11 @@ uint32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_clone(uint return ret_ref; } -void __attribute__((visibility("default"))) TS_QueryShortChannelIds_free(uint32_t this_ptr) { - LDKQueryShortChannelIds this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - QueryShortChannelIds_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_QueryShortChannelIds_free(uint32_t this_obj) { + LDKQueryShortChannelIds this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + QueryShortChannelIds_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_QueryShortChannelIds_get_chain_hash(uint32_t this_ptr) { @@ -14312,11 +14530,11 @@ uint32_t __attribute__((visibility("default"))) TS_QueryShortChannelIds_clone(u return ret_ref; } -void __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_free(uint32_t this_ptr) { - LDKReplyShortChannelIdsEnd this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ReplyShortChannelIdsEnd_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_free(uint32_t this_obj) { + LDKReplyShortChannelIdsEnd this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ReplyShortChannelIdsEnd_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_get_chain_hash(uint32_t this_ptr) { @@ -14381,11 +14599,11 @@ uint32_t __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_clon return ret_ref; } -void __attribute__((visibility("default"))) TS_GossipTimestampFilter_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_GossipTimestampFilter_free(uint32_t this_obj) { + LDKGossipTimestampFilter this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + GossipTimestampFilter_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_GossipTimestampFilter_get_chain_hash(uint32_t this_ptr) { @@ -14480,11 +14698,11 @@ uint32_t __attribute__((visibility("default"))) TS_ErrorAction_clone(uint32_t o return ret_ref; } -void __attribute__((visibility("default"))) TS_LightningError_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_LightningError_free(uint32_t this_obj) { + LDKLightningError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + LightningError_free(this_obj_conv); } jstring __attribute__((visibility("default"))) TS_LightningError_get_err(uint32_t this_ptr) { @@ -14557,11 +14775,11 @@ uint32_t __attribute__((visibility("default"))) TS_LightningError_clone(uint32_ return ret_ref; } -void __attribute__((visibility("default"))) TS_CommitmentUpdate_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_CommitmentUpdate_free(uint32_t this_obj) { + LDKCommitmentUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CommitmentUpdate_free(this_obj_conv); } void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_add_htlcs(uint32_t this_ptr, uint32_tArray val) { @@ -15444,11 +15662,11 @@ int8_tArray __attribute__((visibility("default"))) TS_GossipTimestampFilter_wri return ret_arr; } -void __attribute__((visibility("default"))) TS_IgnoringMessageHandler_free(uint32_t this_ptr) { - LDKIgnoringMessageHandler this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - IgnoringMessageHandler_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_IgnoringMessageHandler_free(uint32_t this_obj) { + LDKIgnoringMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + IgnoringMessageHandler_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_new() { @@ -15480,11 +15698,11 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_as_Ro return (long)ret; } -void __attribute__((visibility("default"))) TS_ErroringMessageHandler_free(uint32_t this_ptr) { - LDKErroringMessageHandler this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ErroringMessageHandler_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ErroringMessageHandler_free(uint32_t this_obj) { + LDKErroringMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ErroringMessageHandler_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_ErroringMessageHandler_new() { @@ -15516,11 +15734,11 @@ uint32_t __attribute__((visibility("default"))) TS_ErroringMessageHandler_as_Ch return (long)ret; } -void __attribute__((visibility("default"))) TS_MessageHandler_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_MessageHandler_free(uint32_t this_obj) { + LDKMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + MessageHandler_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_MessageHandler_get_chan_handler(uint32_t this_ptr) { @@ -15569,7 +15787,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageHandler_new(uint32_t } uint32_t __attribute__((visibility("default"))) TS_SocketDescriptor_clone(uint32_t orig) { - LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig; + LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)(((uint64_t)orig) & ~1); LDKSocketDescriptor* ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *ret = SocketDescriptor_clone(orig_conv); return (long)ret; @@ -15582,11 +15800,11 @@ void __attribute__((visibility("default"))) TS_SocketDescriptor_free(uint32_t t SocketDescriptor_free(this_ptr_conv); } -void __attribute__((visibility("default"))) TS_PeerHandleError_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_PeerHandleError_free(uint32_t this_obj) { + LDKPeerHandleError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + PeerHandleError_free(this_obj_conv); } jboolean __attribute__((visibility("default"))) TS_PeerHandleError_get_no_connection_possible(uint32_t this_ptr) { @@ -15629,11 +15847,11 @@ uint32_t __attribute__((visibility("default"))) TS_PeerHandleError_clone(uint32 return ret_ref; } -void __attribute__((visibility("default"))) TS_PeerManager_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_PeerManager_free(uint32_t this_obj) { + LDKPeerManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + PeerManager_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_PeerManager_new(uint32_t message_handler, int8_tArray our_node_secret, int8_tArray ephemeral_random_data, uint32_t logger) { @@ -15702,7 +15920,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_write_buffer_spa LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor; + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1); 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; @@ -15712,7 +15930,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_read_event(uint3 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; + LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)peer_descriptor) & ~1); LDKu8slice data_ref; data_ref.datalen = *((uint32_t*)data); data_ref.data = (int8_t*)(data + 4); @@ -15732,7 +15950,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_socket_disconnected( LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor; + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1); PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); } @@ -15814,11 +16032,11 @@ uint32_t __attribute__((visibility("default"))) TS_derive_public_revocation_key return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_TxCreationKeys_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_TxCreationKeys_free(uint32_t this_obj) { + LDKTxCreationKeys this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + TxCreationKeys_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_per_commitment_point(uint32_t this_ptr) { @@ -15976,11 +16194,11 @@ uint32_t __attribute__((visibility("default"))) TS_TxCreationKeys_read(int8_tAr return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_ChannelPublicKeys_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_ChannelPublicKeys_free(uint32_t this_obj) { + LDKChannelPublicKeys this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelPublicKeys_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_funding_pubkey(uint32_t this_ptr) { @@ -16188,11 +16406,11 @@ int8_tArray __attribute__((visibility("default"))) TS_get_revokeable_redeemscri return ret_arr; } -void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_free(uint32_t this_obj) { + LDKHTLCOutputInCommitment this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + HTLCOutputInCommitment_free(this_obj_conv); } jboolean __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_get_offered(uint32_t this_ptr) { @@ -16342,11 +16560,11 @@ int8_tArray __attribute__((visibility("default"))) TS_build_htlc_transaction(in return ret_arr; } -void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_free(uint32_t 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); - ChannelTransactionParameters_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_free(uint32_t this_obj) { + LDKChannelTransactionParameters this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelTransactionParameters_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_get_holder_pubkeys(uint32_t this_ptr) { @@ -16491,11 +16709,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters return ret_ref; } -void __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionParameters_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionParameters_free(uint32_t this_obj) { + LDKCounterpartyChannelTransactionParameters this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CounterpartyChannelTransactionParameters_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionParameters_get_pubkeys(uint32_t this_ptr) { @@ -16643,11 +16861,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_DirectedChannelTransactionParameters_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_DirectedChannelTransactionParameters_free(uint32_t this_obj) { + LDKDirectedChannelTransactionParameters this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + DirectedChannelTransactionParameters_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_DirectedChannelTransactionParameters_broadcaster_pubkeys(uint32_t this_arg) { @@ -16708,11 +16926,11 @@ uint32_t __attribute__((visibility("default"))) TS_DirectedChannelTransactionPa return ret_ref; } -void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_free(uint32_t this_ptr) { - LDKHolderCommitmentTransaction 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); +void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_free(uint32_t this_obj) { + LDKHolderCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + HolderCommitmentTransaction_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_get_counterparty_sig(uint32_t this_ptr) { @@ -16827,11 +17045,11 @@ uint32_t __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_ return ret_ref; } -void __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_free(uint32_t 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); - BuiltCommitmentTransaction_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_free(uint32_t this_obj) { + LDKBuiltCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + BuiltCommitmentTransaction_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_get_transaction(uint32_t this_ptr) { @@ -16957,11 +17175,11 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio return ret_arr; } -void __attribute__((visibility("default"))) TS_CommitmentTransaction_free(uint32_t 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); - CommitmentTransaction_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_CommitmentTransaction_free(uint32_t this_obj) { + LDKCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CommitmentTransaction_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_clone(uint32_t orig) { @@ -17062,11 +17280,11 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_verify return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction_free(uint32_t 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); +void __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction_free(uint32_t this_obj) { + LDKTrustedCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + TrustedCommitmentTransaction_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction_txid(uint32_t this_arg) { @@ -17175,25 +17393,25 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_clone(uint32 return ret_ref; } -void __attribute__((visibility("default"))) TS_InitFeatures_free(uint32_t this_ptr) { - LDKInitFeatures this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - InitFeatures_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_InitFeatures_free(uint32_t this_obj) { + LDKInitFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + InitFeatures_free(this_obj_conv); } -void __attribute__((visibility("default"))) TS_NodeFeatures_free(uint32_t this_ptr) { - LDKNodeFeatures this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NodeFeatures_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_NodeFeatures_free(uint32_t this_obj) { + LDKNodeFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NodeFeatures_free(this_obj_conv); } -void __attribute__((visibility("default"))) TS_ChannelFeatures_free(uint32_t this_ptr) { - LDKChannelFeatures this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelFeatures_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelFeatures_free(uint32_t this_obj) { + LDKChannelFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelFeatures_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_InitFeatures_empty() { @@ -17322,11 +17540,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_read(int8_tA return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_RouteHop_free(uint32_t this_ptr) { - LDKRouteHop this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - RouteHop_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_RouteHop_free(uint32_t this_obj) { + LDKRouteHop this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + RouteHop_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_RouteHop_get_pubkey(uint32_t this_ptr) { @@ -17479,11 +17697,11 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHop_clone(uint32_t orig return ret_ref; } -void __attribute__((visibility("default"))) TS_Route_free(uint32_t this_ptr) { - LDKRoute this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - Route_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_Route_free(uint32_t this_obj) { + LDKRoute this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + Route_free(this_obj_conv); } void __attribute__((visibility("default"))) TS_Route_set_paths(uint32_t this_ptr, ptrArray val) { @@ -17590,11 +17808,11 @@ uint32_t __attribute__((visibility("default"))) TS_Route_read(int8_tArray ser) return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_RouteHint_free(uint32_t this_ptr) { - LDKRouteHint this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - RouteHint_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_RouteHint_free(uint32_t this_obj) { + LDKRouteHint this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + RouteHint_free(this_obj_conv); } int8_tArray __attribute__((visibility("default"))) TS_RouteHint_get_src_node_id(uint32_t this_ptr) { @@ -17731,11 +17949,11 @@ uint32_t __attribute__((visibility("default"))) TS_get_route(int8_tArray our_no return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_NetworkGraph_free(uint32_t this_ptr) { - LDKNetworkGraph this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NetworkGraph_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_NetworkGraph_free(uint32_t this_obj) { + LDKNetworkGraph this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NetworkGraph_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_clone(uint32_t orig) { @@ -17752,27 +17970,33 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_clone(uint32_t return ret_ref; } -void __attribute__((visibility("default"))) TS_LockedNetworkGraph_free(uint32_t this_ptr) { - LDKLockedNetworkGraph this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - LockedNetworkGraph_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_LockedNetworkGraph_free(uint32_t this_obj) { + LDKLockedNetworkGraph this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + LockedNetworkGraph_free(this_obj_conv); } -void __attribute__((visibility("default"))) TS_NetGraphMsgHandler_free(uint32_t this_ptr) { - LDKNetGraphMsgHandler this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NetGraphMsgHandler_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_NetGraphMsgHandler_free(uint32_t this_obj) { + LDKNetGraphMsgHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NetGraphMsgHandler_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_new(int8_tArray genesis_hash, uint32_t chain_access, uint32_t logger) { LDKThirtyTwoBytes genesis_hash_ref; CHECK(*((uint32_t*)genesis_hash) == 32); memcpy(genesis_hash_ref.data, (uint8_t*)(genesis_hash + 4), 32); - LDKAccess* chain_access_conv = (LDKAccess*)chain_access; + LDKAccess *chain_access_conv_ptr = NULL; + if (chain_access != 0) { + LDKAccess chain_access_conv; + chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1); + chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *chain_access_conv_ptr = chain_access_conv; + } LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1); - LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(genesis_hash_ref, chain_access_conv, logger_conv); + LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(genesis_hash_ref, chain_access_conv_ptr, 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; @@ -17783,13 +18007,19 @@ uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_new(int8_ } uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_from_net_graph(uint32_t chain_access, uint32_t logger, uint32_t network_graph) { - LDKAccess* chain_access_conv = (LDKAccess*)chain_access; + LDKAccess *chain_access_conv_ptr = NULL; + if (chain_access != 0) { + LDKAccess chain_access_conv; + chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1); + chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *chain_access_conv_ptr = chain_access_conv; + } LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1); LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0); network_graph_conv = NetworkGraph_clone(&network_graph_conv); - LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv); + LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_from_net_graph(chain_access_conv_ptr, logger_conv, network_graph_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; @@ -17803,8 +18033,14 @@ void __attribute__((visibility("default"))) TS_NetGraphMsgHandler_add_chain_acc LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - LDKAccess* chain_access_conv = (LDKAccess*)chain_access; - NetGraphMsgHandler_add_chain_access(&this_arg_conv, chain_access_conv); + LDKAccess *chain_access_conv_ptr = NULL; + if (chain_access != 0) { + LDKAccess chain_access_conv; + chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1); + chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *chain_access_conv_ptr = chain_access_conv; + } + NetGraphMsgHandler_add_chain_access(&this_arg_conv, chain_access_conv_ptr); } uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_read_locked_graph(uint32_t this_arg) { @@ -17853,11 +18089,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_as_Messag return (long)ret; } -void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_free(uint32_t this_ptr) { - LDKDirectionalChannelInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - DirectionalChannelInfo_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_free(uint32_t this_obj) { + LDKDirectionalChannelInfo this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + DirectionalChannelInfo_free(this_obj_conv); } int32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_last_update(uint32_t this_ptr) { @@ -18004,11 +18240,11 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_read( return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_ChannelInfo_free(uint32_t this_ptr) { - LDKChannelInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - ChannelInfo_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_ChannelInfo_free(uint32_t this_obj) { + LDKChannelInfo this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + ChannelInfo_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_features(uint32_t this_ptr) { @@ -18183,11 +18419,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_read(int8_tArray return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_RoutingFees_free(uint32_t this_ptr) { - LDKRoutingFees this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - RoutingFees_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_RoutingFees_free(uint32_t this_obj) { + LDKRoutingFees this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + RoutingFees_free(this_obj_conv); } int32_t __attribute__((visibility("default"))) TS_RoutingFees_get_base_msat(uint32_t this_ptr) { @@ -18265,11 +18501,11 @@ int8_tArray __attribute__((visibility("default"))) TS_RoutingFees_write(uint32_ return ret_arr; } -void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_free(uint32_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NodeAnnouncementInfo_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_free(uint32_t this_obj) { + LDKNodeAnnouncementInfo this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NodeAnnouncementInfo_free(this_obj_conv); } uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_features(uint32_t this_ptr) { @@ -18467,11 +18703,11 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_read(in return (long)ret_conv; } -void __attribute__((visibility("default"))) TS_NodeInfo_free(uint32_t this_ptr) { - LDKNodeInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0); - NodeInfo_free(this_ptr_conv); +void __attribute__((visibility("default"))) TS_NodeInfo_free(uint32_t this_obj) { + LDKNodeInfo this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + NodeInfo_free(this_obj_conv); } void __attribute__((visibility("default"))) TS_NodeInfo_set_channels(uint32_t this_ptr, int64_tArray val) { @@ -18671,9 +18907,15 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel_ LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; - LDKAccess* chain_access_conv = (LDKAccess*)chain_access; + LDKAccess *chain_access_conv_ptr = NULL; + if (chain_access != 0) { + LDKAccess chain_access_conv; + chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1); + chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *chain_access_conv_ptr = chain_access_conv; + } 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); + *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv_ptr); return (long)ret_conv; } @@ -18684,9 +18926,15 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel_ LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; - LDKAccess* chain_access_conv = (LDKAccess*)chain_access; + LDKAccess *chain_access_conv_ptr = NULL; + if (chain_access != 0) { + LDKAccess chain_access_conv; + chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1); + chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *chain_access_conv_ptr = chain_access_conv; + } 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); + *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv_ptr); return (long)ret_conv; } diff --git a/ts/bindings.ts b/ts/bindings.ts index ed4a3fdf..326a84e2 100644 --- a/ts/bindings.ts +++ b/ts/bindings.ts @@ -498,6 +498,14 @@ public static native long new_empty_slice_vec(); public static native long LDKC2Tuple_OutPointScriptZ_new(number a, Uint8Array b); public static native number LDKC2Tuple_OutPointScriptZ_get_a(long ptr); public static native Uint8Array LDKC2Tuple_OutPointScriptZ_get_b(long ptr); + public static native long LDKC2Tuple_u32ScriptZ_new(number a, Uint8Array b); + public static native number LDKC2Tuple_u32ScriptZ_get_a(long ptr); + public static native Uint8Array LDKC2Tuple_u32ScriptZ_get_b(long ptr); + public static native long LDKCVec_C2Tuple_u32ScriptZZ_new(number[] elems); + public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(Uint8Array a, number[] b); + public static native Uint8Array LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(long ptr); + public static native number[] LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(long ptr); + public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new(number[] elems); public static native long LDKC2Tuple_u32TxOutZ_new(number a, number b); public static native number LDKC2Tuple_u32TxOutZ_get_a(long ptr); public static native number LDKC2Tuple_u32TxOutZ_get_b(long ptr); @@ -541,7 +549,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // LDKPublicKey Sign_get_per_commitment_point LDKSign* this_arg, uint64_t idx + // LDKPublicKey Sign_get_per_commitment_point LDKSign *NONNULL_PTR this_arg, uint64_t idx export function Sign_get_per_commitment_point(this_arg: number, idx: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -549,7 +557,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_get_per_commitment_point(this_arg, idx); return decodeArray(nativeResponseValue); } - // LDKThirtyTwoBytes Sign_release_commitment_secret LDKSign* this_arg, uint64_t idx + // LDKThirtyTwoBytes Sign_release_commitment_secret LDKSign *NONNULL_PTR this_arg, uint64_t idx export function Sign_release_commitment_secret(this_arg: number, idx: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -557,7 +565,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_release_commitment_secret(this_arg, idx); return decodeArray(nativeResponseValue); } - // LDKThirtyTwoBytes Sign_channel_keys_id LDKSign* this_arg + // LDKThirtyTwoBytes Sign_channel_keys_id LDKSign *NONNULL_PTR this_arg export function Sign_channel_keys_id(this_arg: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -565,7 +573,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_channel_keys_id(this_arg); return decodeArray(nativeResponseValue); } - // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_counterparty_commitment LDKSign* this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx + // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_counterparty_commitment LDKSign *NONNULL_PTR this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx export function Sign_sign_counterparty_commitment(this_arg: number, commitment_tx: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -573,7 +581,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_sign_counterparty_commitment(this_arg, commitment_tx); return nativeResponseValue; } - // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_holder_commitment_and_htlcs LDKSign* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx + // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_holder_commitment_and_htlcs LDKSign *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx export function Sign_sign_holder_commitment_and_htlcs(this_arg: number, commitment_tx: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -581,7 +589,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_sign_holder_commitment_and_htlcs(this_arg, commitment_tx); return nativeResponseValue; } - // LDKCResult_SignatureNoneZ Sign_sign_justice_transaction LDKSign* 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 + // LDKCResult_SignatureNoneZ Sign_sign_justice_transaction LDKSign *NONNULL_PTR 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 export function Sign_sign_justice_transaction(this_arg: number, justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -589,7 +597,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_sign_justice_transaction(this_arg, encodeArray(justice_tx), input, amount, encodeArray(per_commitment_key), htlc); return nativeResponseValue; } - // LDKCResult_SignatureNoneZ Sign_sign_counterparty_htlc_transaction LDKSign* this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc + // LDKCResult_SignatureNoneZ Sign_sign_counterparty_htlc_transaction LDKSign *NONNULL_PTR this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc export function Sign_sign_counterparty_htlc_transaction(this_arg: number, htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -597,7 +605,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_sign_counterparty_htlc_transaction(this_arg, encodeArray(htlc_tx), input, amount, encodeArray(per_commitment_point), htlc); return nativeResponseValue; } - // LDKCResult_SignatureNoneZ Sign_sign_closing_transaction LDKSign* this_arg, struct LDKTransaction closing_tx + // LDKCResult_SignatureNoneZ Sign_sign_closing_transaction LDKSign *NONNULL_PTR this_arg, struct LDKTransaction closing_tx export function Sign_sign_closing_transaction(this_arg: number, closing_tx: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -605,7 +613,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_sign_closing_transaction(this_arg, encodeArray(closing_tx)); return nativeResponseValue; } - // LDKCResult_SignatureNoneZ Sign_sign_channel_announcement LDKSign* this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg + // LDKCResult_SignatureNoneZ Sign_sign_channel_announcement LDKSign *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg export function Sign_sign_channel_announcement(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -613,7 +621,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_sign_channel_announcement(this_arg, msg); return nativeResponseValue; } - // void Sign_ready_channel LDKSign* this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters + // void Sign_ready_channel LDKSign *NONNULL_PTR this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters export function Sign_ready_channel(this_arg: number, channel_parameters: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -621,7 +629,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_ready_channel(this_arg, channel_parameters); // debug statements here } - // LDKCVec_u8Z Sign_write LDKSign* this_arg + // LDKCVec_u8Z Sign_write LDKSign *NONNULL_PTR this_arg export function Sign_write(this_arg: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -629,7 +637,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_write(this_arg); return decodeArray(nativeResponseValue); } - // LDKChannelPublicKeys Sign_get_pubkeys LDKSign* this_arg + // LDKChannelPublicKeys Sign_get_pubkeys LDKSign *NONNULL_PTR this_arg export function Sign_get_pubkeys(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -718,7 +726,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_watch_channel LDKWatch* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor + // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_watch_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor export function Watch_watch_channel(this_arg: number, funding_txo: number, monitor: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -726,7 +734,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Watch_watch_channel(this_arg, funding_txo, monitor); return nativeResponseValue; } - // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_update_channel LDKWatch* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update + // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_update_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update export function Watch_update_channel(this_arg: number, funding_txo: number, update: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -734,7 +742,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Watch_update_channel(this_arg, funding_txo, update); return nativeResponseValue; } - // LDKCVec_MonitorEventZ Watch_release_pending_monitor_events LDKWatch* this_arg + // LDKCVec_MonitorEventZ Watch_release_pending_monitor_events LDKWatch *NONNULL_PTR this_arg export function Watch_release_pending_monitor_events(this_arg: number): number[] { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -758,7 +766,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface* this_arg, struct LDKTransaction tx + // void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface *NONNULL_PTR this_arg, struct LDKTransaction tx export function BroadcasterInterface_broadcast_transaction(this_arg: number, tx: Uint8Array): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -790,7 +798,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // LDKSecretKey KeysInterface_get_node_secret LDKKeysInterface* this_arg + // LDKSecretKey KeysInterface_get_node_secret LDKKeysInterface *NONNULL_PTR this_arg export function KeysInterface_get_node_secret(this_arg: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -798,7 +806,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.KeysInterface_get_node_secret(this_arg); return decodeArray(nativeResponseValue); } - // LDKCVec_u8Z KeysInterface_get_destination_script LDKKeysInterface* this_arg + // LDKCVec_u8Z KeysInterface_get_destination_script LDKKeysInterface *NONNULL_PTR this_arg export function KeysInterface_get_destination_script(this_arg: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -806,7 +814,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.KeysInterface_get_destination_script(this_arg); return decodeArray(nativeResponseValue); } - // LDKPublicKey KeysInterface_get_shutdown_pubkey LDKKeysInterface* this_arg + // LDKPublicKey KeysInterface_get_shutdown_pubkey LDKKeysInterface *NONNULL_PTR this_arg export function KeysInterface_get_shutdown_pubkey(this_arg: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -814,7 +822,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.KeysInterface_get_shutdown_pubkey(this_arg); return decodeArray(nativeResponseValue); } - // LDKSign KeysInterface_get_channel_signer LDKKeysInterface* this_arg, bool inbound, uint64_t channel_value_satoshis + // LDKSign KeysInterface_get_channel_signer LDKKeysInterface *NONNULL_PTR this_arg, bool inbound, uint64_t channel_value_satoshis export function KeysInterface_get_channel_signer(this_arg: number, inbound: boolean, channel_value_satoshis: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -822,7 +830,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.KeysInterface_get_channel_signer(this_arg, inbound, channel_value_satoshis); return nativeResponseValue; } - // LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface* this_arg + // LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface *NONNULL_PTR this_arg export function KeysInterface_get_secure_random_bytes(this_arg: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -830,7 +838,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.KeysInterface_get_secure_random_bytes(this_arg); return decodeArray(nativeResponseValue); } - // LDKCResult_SignDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface* this_arg, struct LDKu8slice reader + // LDKCResult_SignDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface *NONNULL_PTR this_arg, struct LDKu8slice reader export function KeysInterface_read_chan_signer(this_arg: number, reader: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -854,7 +862,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator* this_arg, enum LDKConfirmationTarget confirmation_target + // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator *NONNULL_PTR this_arg, enum LDKConfirmationTarget confirmation_target export function FeeEstimator_get_est_sat_per_1000_weight(this_arg: number, confirmation_target: LDKConfirmationTarget): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1024,7 +1032,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider* this_arg + // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider *NONNULL_PTR this_arg export function MessageSendEventsProvider_get_and_clear_pending_msg_events(this_arg: number): number[] { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1048,7 +1056,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // LDKCVec_EventZ EventsProvider_get_and_clear_pending_events LDKEventsProvider* this_arg + // LDKCVec_EventZ EventsProvider_get_and_clear_pending_events LDKEventsProvider *NONNULL_PTR this_arg export function EventsProvider_get_and_clear_pending_events(this_arg: number): number[] { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1072,7 +1080,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id + // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess *NONNULL_PTR this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id export function Access_get_utxo(this_arg: number, genesis_hash: Uint8Array, short_channel_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1097,7 +1105,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // void Listen_block_connected LDKListen* this_arg, struct LDKu8slice block, uint32_t height + // void Listen_block_connected LDKListen *NONNULL_PTR this_arg, struct LDKu8slice block, uint32_t height export function Listen_block_connected(this_arg: number, block: Uint8Array, height: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1105,7 +1113,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Listen_block_connected(this_arg, encodeArray(block), height); // debug statements here } - // void Listen_block_disconnected LDKListen* this_arg, const uint8_t (*header)[80], uint32_t height + // void Listen_block_disconnected LDKListen *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height export function Listen_block_disconnected(this_arg: number, header: Uint8Array, height: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1130,7 +1138,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // void Filter_register_tx LDKFilter* this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey + // void Filter_register_tx LDKFilter *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey export function Filter_register_tx(this_arg: number, txid: Uint8Array, script_pubkey: Uint8Array): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1138,7 +1146,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Filter_register_tx(this_arg, encodeArray(txid), encodeArray(script_pubkey)); // debug statements here } - // void Filter_register_output LDKFilter* this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey + // void Filter_register_output LDKFilter *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey export function Filter_register_output(this_arg: number, outpoint: number, script_pubkey: Uint8Array): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1163,7 +1171,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data + // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data export function Persist_persist_new_channel(this_arg: number, id: number, data: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1171,7 +1179,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Persist_persist_new_channel(this_arg, id, data); return nativeResponseValue; } - // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data + // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data export function Persist_update_persisted_channel(this_arg: number, id: number, update: number, data: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1213,7 +1221,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg + // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg export function ChannelMessageHandler_handle_open_channel(this_arg: number, their_node_id: Uint8Array, their_features: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1221,7 +1229,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_open_channel(this_arg, encodeArray(their_node_id), their_features, msg); // debug statements here } - // void ChannelMessageHandler_handle_accept_channel LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg + // void ChannelMessageHandler_handle_accept_channel LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg export function ChannelMessageHandler_handle_accept_channel(this_arg: number, their_node_id: Uint8Array, their_features: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1229,7 +1237,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_accept_channel(this_arg, encodeArray(their_node_id), their_features, msg); // debug statements here } - // void ChannelMessageHandler_handle_funding_created LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg + // void ChannelMessageHandler_handle_funding_created LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg export function ChannelMessageHandler_handle_funding_created(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1237,7 +1245,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_funding_created(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_funding_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg + // void ChannelMessageHandler_handle_funding_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg export function ChannelMessageHandler_handle_funding_signed(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1245,7 +1253,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_funding_signed(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_funding_locked LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg + // void ChannelMessageHandler_handle_funding_locked LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg export function ChannelMessageHandler_handle_funding_locked(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1253,7 +1261,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_funding_locked(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg + // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg export function ChannelMessageHandler_handle_shutdown(this_arg: number, their_node_id: Uint8Array, their_features: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1261,7 +1269,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_shutdown(this_arg, encodeArray(their_node_id), their_features, msg); // debug statements here } - // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg + // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg export function ChannelMessageHandler_handle_closing_signed(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1269,7 +1277,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_closing_signed(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_update_add_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg + // void ChannelMessageHandler_handle_update_add_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg export function ChannelMessageHandler_handle_update_add_htlc(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1277,7 +1285,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_update_add_htlc(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_update_fulfill_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg + // void ChannelMessageHandler_handle_update_fulfill_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg export function ChannelMessageHandler_handle_update_fulfill_htlc(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1285,7 +1293,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_update_fulfill_htlc(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_update_fail_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg + // void ChannelMessageHandler_handle_update_fail_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg export function ChannelMessageHandler_handle_update_fail_htlc(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1293,7 +1301,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_update_fail_htlc(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_update_fail_malformed_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg + // void ChannelMessageHandler_handle_update_fail_malformed_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg export function ChannelMessageHandler_handle_update_fail_malformed_htlc(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1301,7 +1309,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_update_fail_malformed_htlc(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_commitment_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg + // void ChannelMessageHandler_handle_commitment_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg export function ChannelMessageHandler_handle_commitment_signed(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1309,7 +1317,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_commitment_signed(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_revoke_and_ack LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg + // void ChannelMessageHandler_handle_revoke_and_ack LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg export function ChannelMessageHandler_handle_revoke_and_ack(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1317,7 +1325,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_revoke_and_ack(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_update_fee LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg + // void ChannelMessageHandler_handle_update_fee LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg export function ChannelMessageHandler_handle_update_fee(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1325,7 +1333,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_update_fee(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_announcement_signatures LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg + // void ChannelMessageHandler_handle_announcement_signatures LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg export function ChannelMessageHandler_handle_announcement_signatures(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1333,7 +1341,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_announcement_signatures(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_peer_disconnected LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible + // void ChannelMessageHandler_peer_disconnected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible export function ChannelMessageHandler_peer_disconnected(this_arg: number, their_node_id: Uint8Array, no_connection_possible: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1341,7 +1349,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_peer_disconnected(this_arg, encodeArray(their_node_id), no_connection_possible); // debug statements here } - // void ChannelMessageHandler_peer_connected LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg + // void ChannelMessageHandler_peer_connected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg export function ChannelMessageHandler_peer_connected(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1349,7 +1357,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_peer_connected(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg + // void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg export function ChannelMessageHandler_handle_channel_reestablish(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1357,7 +1365,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMessageHandler_handle_channel_reestablish(this_arg, encodeArray(their_node_id), msg); // debug statements here } - // void ChannelMessageHandler_handle_error LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg + // void ChannelMessageHandler_handle_error LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg export function ChannelMessageHandler_handle_error(this_arg: number, their_node_id: Uint8Array, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1391,7 +1399,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler* this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg export function RoutingMessageHandler_handle_node_announcement(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1399,7 +1407,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_handle_node_announcement(this_arg, msg); return nativeResponseValue; } - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler* this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg export function RoutingMessageHandler_handle_channel_announcement(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1407,7 +1415,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_handle_channel_announcement(this_arg, msg); return nativeResponseValue; } - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler* this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg export function RoutingMessageHandler_handle_channel_update(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1415,7 +1423,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_handle_channel_update(this_arg, msg); return nativeResponseValue; } - // void RoutingMessageHandler_handle_htlc_fail_channel_update LDKRoutingMessageHandler* this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update + // void RoutingMessageHandler_handle_htlc_fail_channel_update LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update export function RoutingMessageHandler_handle_htlc_fail_channel_update(this_arg: number, update: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1423,7 +1431,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_handle_htlc_fail_channel_update(this_arg, update); // debug statements here } - // LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ RoutingMessageHandler_get_next_channel_announcements LDKRoutingMessageHandler* this_arg, uint64_t starting_point, uint8_t batch_amount + // LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ RoutingMessageHandler_get_next_channel_announcements LDKRoutingMessageHandler *NONNULL_PTR this_arg, uint64_t starting_point, uint8_t batch_amount export function RoutingMessageHandler_get_next_channel_announcements(this_arg: number, starting_point: number, batch_amount: number): number[] { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1431,7 +1439,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_get_next_channel_announcements(this_arg, starting_point, batch_amount); return nativeResponseValue; } - // LDKCVec_NodeAnnouncementZ RoutingMessageHandler_get_next_node_announcements LDKRoutingMessageHandler* this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount + // LDKCVec_NodeAnnouncementZ RoutingMessageHandler_get_next_node_announcements LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount export function RoutingMessageHandler_get_next_node_announcements(this_arg: number, starting_point: Uint8Array, batch_amount: number): number[] { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1439,7 +1447,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_get_next_node_announcements(this_arg, encodeArray(starting_point), batch_amount); return nativeResponseValue; } - // void RoutingMessageHandler_sync_routing_table LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init + // void RoutingMessageHandler_sync_routing_table LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init export function RoutingMessageHandler_sync_routing_table(this_arg: number, their_node_id: Uint8Array, init: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1447,7 +1455,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_sync_routing_table(this_arg, encodeArray(their_node_id), init); // debug statements here } - // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_channel_range LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_channel_range LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg export function RoutingMessageHandler_handle_reply_channel_range(this_arg: number, their_node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1455,7 +1463,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_handle_reply_channel_range(this_arg, encodeArray(their_node_id), msg); return nativeResponseValue; } - // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_short_channel_ids_end LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_short_channel_ids_end LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg export function RoutingMessageHandler_handle_reply_short_channel_ids_end(this_arg: number, their_node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1463,7 +1471,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_handle_reply_short_channel_ids_end(this_arg, encodeArray(their_node_id), msg); return nativeResponseValue; } - // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_channel_range LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_channel_range LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg export function RoutingMessageHandler_handle_query_channel_range(this_arg: number, their_node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1471,7 +1479,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_handle_query_channel_range(this_arg, encodeArray(their_node_id), msg); return nativeResponseValue; } - // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_short_channel_ids LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg + // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_short_channel_ids LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg export function RoutingMessageHandler_handle_query_short_channel_ids(this_arg: number, their_node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1498,7 +1506,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // uintptr_t SocketDescriptor_send_data LDKSocketDescriptor* this_arg, struct LDKu8slice data, bool resume_read + // uintptr_t SocketDescriptor_send_data LDKSocketDescriptor *NONNULL_PTR this_arg, struct LDKu8slice data, bool resume_read export function SocketDescriptor_send_data(this_arg: number, data: Uint8Array, resume_read: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1506,7 +1514,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SocketDescriptor_send_data(this_arg, encodeArray(data), resume_read); return nativeResponseValue; } - // void SocketDescriptor_disconnect_socket LDKSocketDescriptor* this_arg + // void SocketDescriptor_disconnect_socket LDKSocketDescriptor *NONNULL_PTR this_arg export function SocketDescriptor_disconnect_socket(this_arg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1514,7 +1522,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SocketDescriptor_disconnect_socket(this_arg); // debug statements here } - // uint64_t SocketDescriptor_hash LDKSocketDescriptor* this_arg + // uint64_t SocketDescriptor_hash LDKSocketDescriptor *NONNULL_PTR this_arg export function SocketDescriptor_hash(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2698,6 +2706,62 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_OutPointScriptZ_free(_res); // debug statements here } + // struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig); + export function C2Tuple_u32ScriptZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_u32ScriptZ_clone(orig); + return nativeResponseValue; + } + // struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b); + export function C2Tuple_u32ScriptZ_new(a: number, b: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_u32ScriptZ_new(a, encodeArray(b)); + return nativeResponseValue; + } + // void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res); + export function C2Tuple_u32ScriptZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_u32ScriptZ_free(_res); + // debug statements here + } + // void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res); + export function CVec_C2Tuple_u32ScriptZZ_free(_res: number[]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CVec_C2Tuple_u32ScriptZZ_free(_res); + // debug statements here + } + // struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b); + export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a: Uint8Array, b: number[]): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(encodeArray(a), b); + return nativeResponseValue; + } + // void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res); + export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res); + // debug statements here + } + // void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res); + export function CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res: number[]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res); + // debug statements here + } // void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); export function CVec_TransactionZ_free(_res: Uint8Array[]): void { if(!isWasmInitialized) { @@ -4506,12 +4570,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Logger_free(this_ptr); // debug statements here } - // void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_ptr); - export function ChannelHandshakeConfig_free(this_ptr: number): void { + // void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj); + export function ChannelHandshakeConfig_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_free(this_ptr); + const nativeResponseValue = wasm.ChannelHandshakeConfig_free(this_obj); // debug statements here } // uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); @@ -4586,12 +4650,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelHandshakeConfig_default(); return nativeResponseValue; } - // void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_ptr); - export function ChannelHandshakeLimits_free(this_ptr: number): void { + // void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj); + export function ChannelHandshakeLimits_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeLimits_free(this_ptr); + const nativeResponseValue = wasm.ChannelHandshakeLimits_free(this_obj); // debug statements here } // uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); @@ -4778,12 +4842,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelHandshakeLimits_default(); return nativeResponseValue; } - // void ChannelConfig_free(struct LDKChannelConfig this_ptr); - export function ChannelConfig_free(this_ptr: number): void { + // void ChannelConfig_free(struct LDKChannelConfig this_obj); + export function ChannelConfig_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelConfig_free(this_ptr); + const nativeResponseValue = wasm.ChannelConfig_free(this_obj); // debug statements here } // uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr); @@ -4874,12 +4938,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelConfig_read(encodeArray(ser)); return nativeResponseValue; } - // void UserConfig_free(struct LDKUserConfig this_ptr); - export function UserConfig_free(this_ptr: number): void { + // void UserConfig_free(struct LDKUserConfig this_obj); + export function UserConfig_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.UserConfig_free(this_ptr); + const nativeResponseValue = wasm.UserConfig_free(this_obj); // debug statements here } // struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr); @@ -5018,12 +5082,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.FeeEstimator_free(this_ptr); // debug statements here } - // void ChainMonitor_free(struct LDKChainMonitor this_ptr); - export function ChainMonitor_free(this_ptr: number): void { + // void ChainMonitor_free(struct LDKChainMonitor this_obj); + export function ChainMonitor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChainMonitor_free(this_ptr); + const nativeResponseValue = wasm.ChainMonitor_free(this_obj); // debug statements here } // void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height); @@ -5066,12 +5130,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChainMonitor_as_EventsProvider(this_arg); return nativeResponseValue; } - // void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_ptr); - export function ChannelMonitorUpdate_free(this_ptr: number): void { + // void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj); + export function ChannelMonitorUpdate_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitorUpdate_free(this_ptr); + const nativeResponseValue = wasm.ChannelMonitorUpdate_free(this_obj); // debug statements here } // uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr); @@ -5122,12 +5186,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMonitorUpdateErr_clone(orig); return nativeResponseValue; } - // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_ptr); - export function MonitorUpdateError_free(this_ptr: number): void { + // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj); + export function MonitorUpdateError_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.MonitorUpdateError_free(this_ptr); + const nativeResponseValue = wasm.MonitorUpdateError_free(this_obj); // debug statements here } // struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig); @@ -5154,12 +5218,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MonitorEvent_clone(orig); return nativeResponseValue; } - // void HTLCUpdate_free(struct LDKHTLCUpdate this_ptr); - export function HTLCUpdate_free(this_ptr: number): void { + // void HTLCUpdate_free(struct LDKHTLCUpdate this_obj); + export function HTLCUpdate_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.HTLCUpdate_free(this_ptr); + const nativeResponseValue = wasm.HTLCUpdate_free(this_obj); // debug statements here } // struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig); @@ -5186,12 +5250,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.HTLCUpdate_read(encodeArray(ser)); return nativeResponseValue; } - // void ChannelMonitor_free(struct LDKChannelMonitor this_ptr); - export function ChannelMonitor_free(this_ptr: number): void { + // void ChannelMonitor_free(struct LDKChannelMonitor this_obj); + export function ChannelMonitor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitor_free(this_ptr); + const nativeResponseValue = wasm.ChannelMonitor_free(this_obj); // debug statements here } // struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig); @@ -5234,6 +5298,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMonitor_get_funding_txo(this_arg); return nativeResponseValue; } + // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg); + export function ChannelMonitor_get_outputs_to_watch(this_arg: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitor_get_outputs_to_watch(this_arg); + return nativeResponseValue; + } + // void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter); + export function ChannelMonitor_load_outputs_to_watch(this_arg: number, filter: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitor_load_outputs_to_watch(this_arg, filter); + // debug statements here + } // MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg); export function ChannelMonitor_get_and_clear_pending_monitor_events(this_arg: number): number[] { if(!isWasmInitialized) { @@ -5290,12 +5370,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_BlockHashChannelMonitorZ_read(encodeArray(ser), arg); return nativeResponseValue; } - // void OutPoint_free(struct LDKOutPoint this_ptr); - export function OutPoint_free(this_ptr: number): void { + // void OutPoint_free(struct LDKOutPoint this_obj); + export function OutPoint_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.OutPoint_free(this_ptr); + const nativeResponseValue = wasm.OutPoint_free(this_obj); // debug statements here } // const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32]; @@ -5370,12 +5450,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.OutPoint_read(encodeArray(ser)); return nativeResponseValue; } - // void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_ptr); - export function DelayedPaymentOutputDescriptor_free(this_ptr: number): void { + // void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj); + export function DelayedPaymentOutputDescriptor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_free(this_ptr); + const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_free(this_obj); // debug statements here } // struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); @@ -5498,12 +5578,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_clone(orig); return nativeResponseValue; } - // void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_ptr); - export function StaticPaymentOutputDescriptor_free(this_ptr: number): void { + // void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj); + export function StaticPaymentOutputDescriptor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_free(this_ptr); + const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_free(this_obj); // debug statements here } // struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr); @@ -5634,12 +5714,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.KeysInterface_free(this_ptr); // debug statements here } - // void InMemorySigner_free(struct LDKInMemorySigner this_ptr); - export function InMemorySigner_free(this_ptr: number): void { + // void InMemorySigner_free(struct LDKInMemorySigner this_obj); + export function InMemorySigner_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.InMemorySigner_free(this_ptr); + const nativeResponseValue = wasm.InMemorySigner_free(this_obj); // debug statements here } // const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; @@ -5842,12 +5922,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InMemorySigner_read(encodeArray(ser)); return nativeResponseValue; } - // void KeysManager_free(struct LDKKeysManager this_ptr); - export function KeysManager_free(this_ptr: number): void { + // void KeysManager_free(struct LDKKeysManager this_obj); + export function KeysManager_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.KeysManager_free(this_ptr); + const nativeResponseValue = wasm.KeysManager_free(this_obj); // debug statements here } // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos); @@ -5882,20 +5962,20 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.KeysManager_as_KeysInterface(this_arg); return nativeResponseValue; } - // void ChannelManager_free(struct LDKChannelManager this_ptr); - export function ChannelManager_free(this_ptr: number): void { + // void ChannelManager_free(struct LDKChannelManager this_obj); + export function ChannelManager_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelManager_free(this_ptr); + const nativeResponseValue = wasm.ChannelManager_free(this_obj); // debug statements here } - // void ChainParameters_free(struct LDKChainParameters this_ptr); - export function ChainParameters_free(this_ptr: number): void { + // void ChainParameters_free(struct LDKChainParameters this_obj); + export function ChainParameters_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChainParameters_free(this_ptr); + const nativeResponseValue = wasm.ChainParameters_free(this_obj); // debug statements here } // enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr); @@ -5954,12 +6034,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChainParameters_new(network_arg, encodeArray(latest_hash_arg), latest_height_arg); return nativeResponseValue; } - // void ChannelDetails_free(struct LDKChannelDetails this_ptr); - export function ChannelDetails_free(this_ptr: number): void { + // void ChannelDetails_free(struct LDKChannelDetails this_obj); + export function ChannelDetails_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelDetails_free(this_ptr); + const nativeResponseValue = wasm.ChannelDetails_free(this_obj); // debug statements here } // const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32]; @@ -6306,12 +6386,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelManager_write(obj); return decodeArray(nativeResponseValue); } - // void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_ptr); - export function ChannelManagerReadArgs_free(this_ptr: number): void { + // void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj); + export function ChannelManagerReadArgs_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelManagerReadArgs_free(this_ptr); + const nativeResponseValue = wasm.ChannelManagerReadArgs_free(this_obj); // debug statements here } // const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); @@ -6426,12 +6506,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_BlockHashChannelManagerZ_read(encodeArray(ser), arg); return nativeResponseValue; } - // void DecodeError_free(struct LDKDecodeError this_ptr); - export function DecodeError_free(this_ptr: number): void { + // void DecodeError_free(struct LDKDecodeError this_obj); + export function DecodeError_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.DecodeError_free(this_ptr); + const nativeResponseValue = wasm.DecodeError_free(this_obj); // debug statements here } // struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig); @@ -6442,12 +6522,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DecodeError_clone(orig); return nativeResponseValue; } - // void Init_free(struct LDKInit this_ptr); - export function Init_free(this_ptr: number): void { + // void Init_free(struct LDKInit this_obj); + export function Init_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Init_free(this_ptr); + const nativeResponseValue = wasm.Init_free(this_obj); // debug statements here } // struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr); @@ -6482,12 +6562,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Init_clone(orig); return nativeResponseValue; } - // void ErrorMessage_free(struct LDKErrorMessage this_ptr); - export function ErrorMessage_free(this_ptr: number): void { + // void ErrorMessage_free(struct LDKErrorMessage this_obj); + export function ErrorMessage_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ErrorMessage_free(this_ptr); + const nativeResponseValue = wasm.ErrorMessage_free(this_obj); // debug statements here } // const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32]; @@ -6538,12 +6618,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ErrorMessage_clone(orig); return nativeResponseValue; } - // void Ping_free(struct LDKPing this_ptr); - export function Ping_free(this_ptr: number): void { + // void Ping_free(struct LDKPing this_obj); + export function Ping_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Ping_free(this_ptr); + const nativeResponseValue = wasm.Ping_free(this_obj); // debug statements here } // uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr); @@ -6594,12 +6674,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Ping_clone(orig); return nativeResponseValue; } - // void Pong_free(struct LDKPong this_ptr); - export function Pong_free(this_ptr: number): void { + // void Pong_free(struct LDKPong this_obj); + export function Pong_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Pong_free(this_ptr); + const nativeResponseValue = wasm.Pong_free(this_obj); // debug statements here } // uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr); @@ -6634,12 +6714,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Pong_clone(orig); return nativeResponseValue; } - // void OpenChannel_free(struct LDKOpenChannel this_ptr); - export function OpenChannel_free(this_ptr: number): void { + // void OpenChannel_free(struct LDKOpenChannel this_obj); + export function OpenChannel_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.OpenChannel_free(this_ptr); + const nativeResponseValue = wasm.OpenChannel_free(this_obj); // debug statements here } // const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; @@ -6938,12 +7018,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.OpenChannel_clone(orig); return nativeResponseValue; } - // void AcceptChannel_free(struct LDKAcceptChannel this_ptr); - export function AcceptChannel_free(this_ptr: number): void { + // void AcceptChannel_free(struct LDKAcceptChannel this_obj); + export function AcceptChannel_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.AcceptChannel_free(this_ptr); + const nativeResponseValue = wasm.AcceptChannel_free(this_obj); // debug statements here } // const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32]; @@ -7178,12 +7258,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.AcceptChannel_clone(orig); return nativeResponseValue; } - // void FundingCreated_free(struct LDKFundingCreated this_ptr); - export function FundingCreated_free(this_ptr: number): void { + // void FundingCreated_free(struct LDKFundingCreated this_obj); + export function FundingCreated_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.FundingCreated_free(this_ptr); + const nativeResponseValue = wasm.FundingCreated_free(this_obj); // debug statements here } // const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; @@ -7266,12 +7346,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.FundingCreated_clone(orig); return nativeResponseValue; } - // void FundingSigned_free(struct LDKFundingSigned this_ptr); - export function FundingSigned_free(this_ptr: number): void { + // void FundingSigned_free(struct LDKFundingSigned this_obj); + export function FundingSigned_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.FundingSigned_free(this_ptr); + const nativeResponseValue = wasm.FundingSigned_free(this_obj); // debug statements here } // const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32]; @@ -7322,12 +7402,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.FundingSigned_clone(orig); return nativeResponseValue; } - // void FundingLocked_free(struct LDKFundingLocked this_ptr); - export function FundingLocked_free(this_ptr: number): void { + // void FundingLocked_free(struct LDKFundingLocked this_obj); + export function FundingLocked_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.FundingLocked_free(this_ptr); + const nativeResponseValue = wasm.FundingLocked_free(this_obj); // debug statements here } // const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32]; @@ -7378,12 +7458,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.FundingLocked_clone(orig); return nativeResponseValue; } - // void Shutdown_free(struct LDKShutdown this_ptr); - export function Shutdown_free(this_ptr: number): void { + // void Shutdown_free(struct LDKShutdown this_obj); + export function Shutdown_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Shutdown_free(this_ptr); + const nativeResponseValue = wasm.Shutdown_free(this_obj); // debug statements here } // const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32]; @@ -7434,12 +7514,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Shutdown_clone(orig); return nativeResponseValue; } - // void ClosingSigned_free(struct LDKClosingSigned this_ptr); - export function ClosingSigned_free(this_ptr: number): void { + // void ClosingSigned_free(struct LDKClosingSigned this_obj); + export function ClosingSigned_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ClosingSigned_free(this_ptr); + const nativeResponseValue = wasm.ClosingSigned_free(this_obj); // debug statements here } // const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32]; @@ -7506,12 +7586,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ClosingSigned_clone(orig); return nativeResponseValue; } - // void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr); - export function UpdateAddHTLC_free(this_ptr: number): void { + // void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj); + export function UpdateAddHTLC_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.UpdateAddHTLC_free(this_ptr); + const nativeResponseValue = wasm.UpdateAddHTLC_free(this_obj); // debug statements here } // const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32]; @@ -7602,12 +7682,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UpdateAddHTLC_clone(orig); return nativeResponseValue; } - // void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr); - export function UpdateFulfillHTLC_free(this_ptr: number): void { + // void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj); + export function UpdateFulfillHTLC_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.UpdateFulfillHTLC_free(this_ptr); + const nativeResponseValue = wasm.UpdateFulfillHTLC_free(this_obj); // debug statements here } // const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32]; @@ -7674,12 +7754,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UpdateFulfillHTLC_clone(orig); return nativeResponseValue; } - // void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr); - export function UpdateFailHTLC_free(this_ptr: number): void { + // void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj); + export function UpdateFailHTLC_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.UpdateFailHTLC_free(this_ptr); + const nativeResponseValue = wasm.UpdateFailHTLC_free(this_obj); // debug statements here } // const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32]; @@ -7722,12 +7802,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UpdateFailHTLC_clone(orig); return nativeResponseValue; } - // void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr); - export function UpdateFailMalformedHTLC_free(this_ptr: number): void { + // void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj); + export function UpdateFailMalformedHTLC_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.UpdateFailMalformedHTLC_free(this_ptr); + const nativeResponseValue = wasm.UpdateFailMalformedHTLC_free(this_obj); // debug statements here } // const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32]; @@ -7786,12 +7866,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UpdateFailMalformedHTLC_clone(orig); return nativeResponseValue; } - // void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr); - export function CommitmentSigned_free(this_ptr: number): void { + // void CommitmentSigned_free(struct LDKCommitmentSigned this_obj); + export function CommitmentSigned_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CommitmentSigned_free(this_ptr); + const nativeResponseValue = wasm.CommitmentSigned_free(this_obj); // debug statements here } // const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32]; @@ -7850,12 +7930,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CommitmentSigned_clone(orig); return nativeResponseValue; } - // void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr); - export function RevokeAndACK_free(this_ptr: number): void { + // void RevokeAndACK_free(struct LDKRevokeAndACK this_obj); + export function RevokeAndACK_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RevokeAndACK_free(this_ptr); + const nativeResponseValue = wasm.RevokeAndACK_free(this_obj); // debug statements here } // const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; @@ -7922,12 +8002,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RevokeAndACK_clone(orig); return nativeResponseValue; } - // void UpdateFee_free(struct LDKUpdateFee this_ptr); - export function UpdateFee_free(this_ptr: number): void { + // void UpdateFee_free(struct LDKUpdateFee this_obj); + export function UpdateFee_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.UpdateFee_free(this_ptr); + const nativeResponseValue = wasm.UpdateFee_free(this_obj); // debug statements here } // const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32]; @@ -7978,12 +8058,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UpdateFee_clone(orig); return nativeResponseValue; } - // void DataLossProtect_free(struct LDKDataLossProtect this_ptr); - export function DataLossProtect_free(this_ptr: number): void { + // void DataLossProtect_free(struct LDKDataLossProtect this_obj); + export function DataLossProtect_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.DataLossProtect_free(this_ptr); + const nativeResponseValue = wasm.DataLossProtect_free(this_obj); // debug statements here } // const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32]; @@ -8034,12 +8114,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DataLossProtect_clone(orig); return nativeResponseValue; } - // void ChannelReestablish_free(struct LDKChannelReestablish this_ptr); - export function ChannelReestablish_free(this_ptr: number): void { + // void ChannelReestablish_free(struct LDKChannelReestablish this_obj); + export function ChannelReestablish_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelReestablish_free(this_ptr); + const nativeResponseValue = wasm.ChannelReestablish_free(this_obj); // debug statements here } // const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32]; @@ -8098,12 +8178,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelReestablish_clone(orig); return nativeResponseValue; } - // void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr); - export function AnnouncementSignatures_free(this_ptr: number): void { + // void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj); + export function AnnouncementSignatures_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.AnnouncementSignatures_free(this_ptr); + const nativeResponseValue = wasm.AnnouncementSignatures_free(this_obj); // debug statements here } // const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32]; @@ -8218,12 +8298,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Result_read(encodeArray(ser)); return nativeResponseValue; } - // void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_ptr); - export function UnsignedNodeAnnouncement_free(this_ptr: number): void { + // void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj); + export function UnsignedNodeAnnouncement_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.UnsignedNodeAnnouncement_free(this_ptr); + const nativeResponseValue = wasm.UnsignedNodeAnnouncement_free(this_obj); // debug statements here } // struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); @@ -8322,12 +8402,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UnsignedNodeAnnouncement_clone(orig); return nativeResponseValue; } - // void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr); - export function NodeAnnouncement_free(this_ptr: number): void { + // void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj); + export function NodeAnnouncement_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.NodeAnnouncement_free(this_ptr); + const nativeResponseValue = wasm.NodeAnnouncement_free(this_obj); // debug statements here } // struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr); @@ -8378,12 +8458,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NodeAnnouncement_clone(orig); return nativeResponseValue; } - // void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr); - export function UnsignedChannelAnnouncement_free(this_ptr: number): void { + // void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj); + export function UnsignedChannelAnnouncement_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.UnsignedChannelAnnouncement_free(this_ptr); + const nativeResponseValue = wasm.UnsignedChannelAnnouncement_free(this_obj); // debug statements here } // struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); @@ -8506,12 +8586,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UnsignedChannelAnnouncement_clone(orig); return nativeResponseValue; } - // void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr); - export function ChannelAnnouncement_free(this_ptr: number): void { + // void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj); + export function ChannelAnnouncement_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelAnnouncement_free(this_ptr); + const nativeResponseValue = wasm.ChannelAnnouncement_free(this_obj); // debug statements here } // struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); @@ -8610,12 +8690,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelAnnouncement_clone(orig); return nativeResponseValue; } - // void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr); - export function UnsignedChannelUpdate_free(this_ptr: number): void { + // void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj); + export function UnsignedChannelUpdate_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.UnsignedChannelUpdate_free(this_ptr); + const nativeResponseValue = wasm.UnsignedChannelUpdate_free(this_obj); // debug statements here } // const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32]; @@ -8754,12 +8834,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UnsignedChannelUpdate_clone(orig); return nativeResponseValue; } - // void ChannelUpdate_free(struct LDKChannelUpdate this_ptr); - export function ChannelUpdate_free(this_ptr: number): void { + // void ChannelUpdate_free(struct LDKChannelUpdate this_obj); + export function ChannelUpdate_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelUpdate_free(this_ptr); + const nativeResponseValue = wasm.ChannelUpdate_free(this_obj); // debug statements here } // struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr); @@ -8810,12 +8890,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelUpdate_clone(orig); return nativeResponseValue; } - // void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr); - export function QueryChannelRange_free(this_ptr: number): void { + // void QueryChannelRange_free(struct LDKQueryChannelRange this_obj); + export function QueryChannelRange_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.QueryChannelRange_free(this_ptr); + const nativeResponseValue = wasm.QueryChannelRange_free(this_obj); // debug statements here } // const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32]; @@ -8882,12 +8962,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.QueryChannelRange_clone(orig); return nativeResponseValue; } - // void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr); - export function ReplyChannelRange_free(this_ptr: number): void { + // void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj); + export function ReplyChannelRange_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ReplyChannelRange_free(this_ptr); + const nativeResponseValue = wasm.ReplyChannelRange_free(this_obj); // debug statements here } // const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32]; @@ -8978,12 +9058,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ReplyChannelRange_clone(orig); return nativeResponseValue; } - // void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr); - export function QueryShortChannelIds_free(this_ptr: number): void { + // void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj); + export function QueryShortChannelIds_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.QueryShortChannelIds_free(this_ptr); + const nativeResponseValue = wasm.QueryShortChannelIds_free(this_obj); // debug statements here } // const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32]; @@ -9026,12 +9106,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.QueryShortChannelIds_clone(orig); return nativeResponseValue; } - // void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr); - export function ReplyShortChannelIdsEnd_free(this_ptr: number): void { + // void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj); + export function ReplyShortChannelIdsEnd_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ReplyShortChannelIdsEnd_free(this_ptr); + const nativeResponseValue = wasm.ReplyShortChannelIdsEnd_free(this_obj); // debug statements here } // const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32]; @@ -9082,12 +9162,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ReplyShortChannelIdsEnd_clone(orig); return nativeResponseValue; } - // void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr); - export function GossipTimestampFilter_free(this_ptr: number): void { + // void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj); + export function GossipTimestampFilter_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.GossipTimestampFilter_free(this_ptr); + const nativeResponseValue = wasm.GossipTimestampFilter_free(this_obj); // debug statements here } // const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32]; @@ -9170,12 +9250,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ErrorAction_clone(orig); return nativeResponseValue; } - // void LightningError_free(struct LDKLightningError this_ptr); - export function LightningError_free(this_ptr: number): void { + // void LightningError_free(struct LDKLightningError this_obj); + export function LightningError_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.LightningError_free(this_ptr); + const nativeResponseValue = wasm.LightningError_free(this_obj); // debug statements here } // struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr); @@ -9226,12 +9306,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.LightningError_clone(orig); return nativeResponseValue; } - // void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr); - export function CommitmentUpdate_free(this_ptr: number): void { + // void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj); + export function CommitmentUpdate_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CommitmentUpdate_free(this_ptr); + const nativeResponseValue = wasm.CommitmentUpdate_free(this_obj); // debug statements here } // void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val); @@ -9842,12 +9922,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.GossipTimestampFilter_write(obj); return decodeArray(nativeResponseValue); } - // void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_ptr); - export function IgnoringMessageHandler_free(this_ptr: number): void { + // void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj); + export function IgnoringMessageHandler_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.IgnoringMessageHandler_free(this_ptr); + const nativeResponseValue = wasm.IgnoringMessageHandler_free(this_obj); // debug statements here } // MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void); @@ -9874,12 +9954,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.IgnoringMessageHandler_as_RoutingMessageHandler(this_arg); return nativeResponseValue; } - // void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_ptr); - export function ErroringMessageHandler_free(this_ptr: number): void { + // void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj); + export function ErroringMessageHandler_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ErroringMessageHandler_free(this_ptr); + const nativeResponseValue = wasm.ErroringMessageHandler_free(this_obj); // debug statements here } // MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void); @@ -9906,12 +9986,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ErroringMessageHandler_as_ChannelMessageHandler(this_arg); return nativeResponseValue; } - // void MessageHandler_free(struct LDKMessageHandler this_ptr); - export function MessageHandler_free(this_ptr: number): void { + // void MessageHandler_free(struct LDKMessageHandler this_obj); + export function MessageHandler_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.MessageHandler_free(this_ptr); + const nativeResponseValue = wasm.MessageHandler_free(this_obj); // debug statements here } // const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr); @@ -9970,12 +10050,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SocketDescriptor_free(this_ptr); // debug statements here } - // void PeerHandleError_free(struct LDKPeerHandleError this_ptr); - export function PeerHandleError_free(this_ptr: number): void { + // void PeerHandleError_free(struct LDKPeerHandleError this_obj); + export function PeerHandleError_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.PeerHandleError_free(this_ptr); + const nativeResponseValue = wasm.PeerHandleError_free(this_obj); // debug statements here } // bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr); @@ -10010,12 +10090,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PeerHandleError_clone(orig); return nativeResponseValue; } - // void PeerManager_free(struct LDKPeerManager this_ptr); - export function PeerManager_free(this_ptr: number): void { + // void PeerManager_free(struct LDKPeerManager this_obj); + export function PeerManager_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.PeerManager_free(this_ptr); + const nativeResponseValue = wasm.PeerManager_free(this_obj); // debug statements here } // 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); @@ -10138,12 +10218,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.derive_public_revocation_key(encodeArray(per_commitment_point), encodeArray(countersignatory_revocation_base_point)); return nativeResponseValue; } - // void TxCreationKeys_free(struct LDKTxCreationKeys this_ptr); - export function TxCreationKeys_free(this_ptr: number): void { + // void TxCreationKeys_free(struct LDKTxCreationKeys this_obj); + export function TxCreationKeys_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.TxCreationKeys_free(this_ptr); + const nativeResponseValue = wasm.TxCreationKeys_free(this_obj); // debug statements here } // struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); @@ -10258,12 +10338,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.TxCreationKeys_read(encodeArray(ser)); return nativeResponseValue; } - // void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_ptr); - export function ChannelPublicKeys_free(this_ptr: number): void { + // void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj); + export function ChannelPublicKeys_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelPublicKeys_free(this_ptr); + const nativeResponseValue = wasm.ChannelPublicKeys_free(this_obj); // debug statements here } // struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); @@ -10402,12 +10482,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.get_revokeable_redeemscript(encodeArray(revocation_key), contest_delay, encodeArray(broadcaster_delayed_payment_key)); return decodeArray(nativeResponseValue); } - // void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_ptr); - export function HTLCOutputInCommitment_free(this_ptr: number): void { + // void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj); + export function HTLCOutputInCommitment_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.HTLCOutputInCommitment_free(this_ptr); + const nativeResponseValue = wasm.HTLCOutputInCommitment_free(this_obj); // debug statements here } // bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); @@ -10522,12 +10602,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.build_htlc_transaction(encodeArray(prev_hash), feerate_per_kw, contest_delay, htlc, encodeArray(broadcaster_delayed_payment_key), encodeArray(revocation_key)); return decodeArray(nativeResponseValue); } - // void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_ptr); - export function ChannelTransactionParameters_free(this_ptr: number): void { + // void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj); + export function ChannelTransactionParameters_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelTransactionParameters_free(this_ptr); + const nativeResponseValue = wasm.ChannelTransactionParameters_free(this_obj); // debug statements here } // struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); @@ -10626,12 +10706,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelTransactionParameters_clone(orig); return nativeResponseValue; } - // void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr); - export function CounterpartyChannelTransactionParameters_free(this_ptr: number): void { + // void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj); + export function CounterpartyChannelTransactionParameters_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CounterpartyChannelTransactionParameters_free(this_ptr); + const nativeResponseValue = wasm.CounterpartyChannelTransactionParameters_free(this_obj); // debug statements here } // struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr); @@ -10738,12 +10818,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelTransactionParameters_read(encodeArray(ser)); return nativeResponseValue; } - // void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_ptr); - export function DirectedChannelTransactionParameters_free(this_ptr: number): void { + // void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj); + export function DirectedChannelTransactionParameters_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.DirectedChannelTransactionParameters_free(this_ptr); + const nativeResponseValue = wasm.DirectedChannelTransactionParameters_free(this_obj); // debug statements here } // MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); @@ -10786,12 +10866,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DirectedChannelTransactionParameters_funding_outpoint(this_arg); return nativeResponseValue; } - // void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_ptr); - export function HolderCommitmentTransaction_free(this_ptr: number): void { + // void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj); + export function HolderCommitmentTransaction_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.HolderCommitmentTransaction_free(this_ptr); + const nativeResponseValue = wasm.HolderCommitmentTransaction_free(this_obj); // debug statements here } // struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr); @@ -10850,12 +10930,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.HolderCommitmentTransaction_new(commitment_tx, encodeArray(counterparty_sig), counterparty_htlc_sigs, encodeArray(holder_funding_key), encodeArray(counterparty_funding_key)); return nativeResponseValue; } - // void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_ptr); - export function BuiltCommitmentTransaction_free(this_ptr: number): void { + // void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj); + export function BuiltCommitmentTransaction_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.BuiltCommitmentTransaction_free(this_ptr); + const nativeResponseValue = wasm.BuiltCommitmentTransaction_free(this_obj); // debug statements here } // struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr); @@ -10938,12 +11018,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.BuiltCommitmentTransaction_sign(this_arg, encodeArray(funding_key), encodeArray(funding_redeemscript), channel_value_satoshis); return decodeArray(nativeResponseValue); } - // void CommitmentTransaction_free(struct LDKCommitmentTransaction this_ptr); - export function CommitmentTransaction_free(this_ptr: number): void { + // void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj); + export function CommitmentTransaction_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CommitmentTransaction_free(this_ptr); + const nativeResponseValue = wasm.CommitmentTransaction_free(this_obj); // debug statements here } // struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig); @@ -11018,12 +11098,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CommitmentTransaction_verify(this_arg, channel_parameters, broadcaster_keys, countersignatory_keys); return nativeResponseValue; } - // void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_ptr); - export function TrustedCommitmentTransaction_free(this_ptr: number): void { + // void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj); + export function TrustedCommitmentTransaction_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.TrustedCommitmentTransaction_free(this_ptr); + const nativeResponseValue = wasm.TrustedCommitmentTransaction_free(this_obj); // debug statements here } // MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); @@ -11090,28 +11170,28 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelFeatures_clone(orig); return nativeResponseValue; } - // void InitFeatures_free(struct LDKInitFeatures this_ptr); - export function InitFeatures_free(this_ptr: number): void { + // void InitFeatures_free(struct LDKInitFeatures this_obj); + export function InitFeatures_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.InitFeatures_free(this_ptr); + const nativeResponseValue = wasm.InitFeatures_free(this_obj); // debug statements here } - // void NodeFeatures_free(struct LDKNodeFeatures this_ptr); - export function NodeFeatures_free(this_ptr: number): void { + // void NodeFeatures_free(struct LDKNodeFeatures this_obj); + export function NodeFeatures_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.NodeFeatures_free(this_ptr); + const nativeResponseValue = wasm.NodeFeatures_free(this_obj); // debug statements here } - // void ChannelFeatures_free(struct LDKChannelFeatures this_ptr); - export function ChannelFeatures_free(this_ptr: number): void { + // void ChannelFeatures_free(struct LDKChannelFeatures this_obj); + export function ChannelFeatures_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelFeatures_free(this_ptr); + const nativeResponseValue = wasm.ChannelFeatures_free(this_obj); // debug statements here } // MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void); @@ -11210,12 +11290,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelFeatures_read(encodeArray(ser)); return nativeResponseValue; } - // void RouteHop_free(struct LDKRouteHop this_ptr); - export function RouteHop_free(this_ptr: number): void { + // void RouteHop_free(struct LDKRouteHop this_obj); + export function RouteHop_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_free(this_ptr); + const nativeResponseValue = wasm.RouteHop_free(this_obj); // debug statements here } // struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr); @@ -11330,12 +11410,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RouteHop_clone(orig); return nativeResponseValue; } - // void Route_free(struct LDKRoute this_ptr); - export function Route_free(this_ptr: number): void { + // void Route_free(struct LDKRoute this_obj); + export function Route_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Route_free(this_ptr); + const nativeResponseValue = wasm.Route_free(this_obj); // debug statements here } // void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val); @@ -11378,12 +11458,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Route_read(encodeArray(ser)); return nativeResponseValue; } - // void RouteHint_free(struct LDKRouteHint this_ptr); - export function RouteHint_free(this_ptr: number): void { + // void RouteHint_free(struct LDKRouteHint this_obj); + export function RouteHint_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHint_free(this_ptr); + const nativeResponseValue = wasm.RouteHint_free(this_obj); // debug statements here } // struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *NONNULL_PTR this_ptr); @@ -11466,12 +11546,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.get_route(encodeArray(our_node_id), network, encodeArray(payee), first_hops, last_hops, final_value_msat, final_cltv, logger); return nativeResponseValue; } - // void NetworkGraph_free(struct LDKNetworkGraph this_ptr); - export function NetworkGraph_free(this_ptr: number): void { + // void NetworkGraph_free(struct LDKNetworkGraph this_obj); + export function NetworkGraph_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.NetworkGraph_free(this_ptr); + const nativeResponseValue = wasm.NetworkGraph_free(this_obj); // debug statements here } // struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig); @@ -11482,20 +11562,20 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkGraph_clone(orig); return nativeResponseValue; } - // void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_ptr); - export function LockedNetworkGraph_free(this_ptr: number): void { + // void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj); + export function LockedNetworkGraph_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.LockedNetworkGraph_free(this_ptr); + const nativeResponseValue = wasm.LockedNetworkGraph_free(this_obj); // debug statements here } - // void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_ptr); - export function NetGraphMsgHandler_free(this_ptr: number): void { + // void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj); + export function NetGraphMsgHandler_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.NetGraphMsgHandler_free(this_ptr); + const nativeResponseValue = wasm.NetGraphMsgHandler_free(this_obj); // debug statements here } // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger); @@ -11554,12 +11634,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetGraphMsgHandler_as_MessageSendEventsProvider(this_arg); return nativeResponseValue; } - // void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_ptr); - export function DirectionalChannelInfo_free(this_ptr: number): void { + // void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj); + export function DirectionalChannelInfo_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.DirectionalChannelInfo_free(this_ptr); + const nativeResponseValue = wasm.DirectionalChannelInfo_free(this_obj); // debug statements here } // uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); @@ -11682,12 +11762,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DirectionalChannelInfo_read(encodeArray(ser)); return nativeResponseValue; } - // void ChannelInfo_free(struct LDKChannelInfo this_ptr); - export function ChannelInfo_free(this_ptr: number): void { + // void ChannelInfo_free(struct LDKChannelInfo this_obj); + export function ChannelInfo_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelInfo_free(this_ptr); + const nativeResponseValue = wasm.ChannelInfo_free(this_obj); // debug statements here } // struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr); @@ -11810,12 +11890,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelInfo_read(encodeArray(ser)); return nativeResponseValue; } - // void RoutingFees_free(struct LDKRoutingFees this_ptr); - export function RoutingFees_free(this_ptr: number): void { + // void RoutingFees_free(struct LDKRoutingFees this_obj); + export function RoutingFees_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RoutingFees_free(this_ptr); + const nativeResponseValue = wasm.RoutingFees_free(this_obj); // debug statements here } // uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr); @@ -11882,12 +11962,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingFees_write(obj); return decodeArray(nativeResponseValue); } - // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr); - export function NodeAnnouncementInfo_free(this_ptr: number): void { + // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj); + export function NodeAnnouncementInfo_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.NodeAnnouncementInfo_free(this_ptr); + const nativeResponseValue = wasm.NodeAnnouncementInfo_free(this_obj); // debug statements here } // struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); @@ -12010,12 +12090,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NodeAnnouncementInfo_read(encodeArray(ser)); return nativeResponseValue; } - // void NodeInfo_free(struct LDKNodeInfo this_ptr); - export function NodeInfo_free(this_ptr: number): void { + // void NodeInfo_free(struct LDKNodeInfo this_obj); + export function NodeInfo_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.NodeInfo_free(this_ptr); + const nativeResponseValue = wasm.NodeInfo_free(this_obj); // debug statements here } // void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); diff --git a/ts/structs/ChannelMonitor.ts b/ts/structs/ChannelMonitor.ts index a2f59137..3c8a824d 100644 --- a/ts/structs/ChannelMonitor.ts +++ b/ts/structs/ChannelMonitor.ts @@ -58,6 +58,35 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_conv; } + public TwoTuple[]>[] get_outputs_to_watch() { + number[] ret = bindings.ChannelMonitor_get_outputs_to_watch(this.ptr); + TwoTuple[]>[] ret_conv_54_arr = new TwoTuple[ret.length]; + for (int c = 0; c < ret.length; c++) { + number ret_conv_54 = ret[c]; + Uint8Array ret_conv_54_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(ret_conv_54); + number[] ret_conv_54_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(ret_conv_54); + TwoTuple[] ret_conv_54_b_conv_30_arr = new TwoTuple[ret_conv_54_b.length]; + for (int e = 0; e < ret_conv_54_b.length; e++) { + number ret_conv_54_b_conv_30 = ret_conv_54_b[e]; + number ret_conv_54_b_conv_30_a = bindings.LDKC2Tuple_u32ScriptZ_get_a(ret_conv_54_b_conv_30); + Uint8Array ret_conv_54_b_conv_30_b = bindings.LDKC2Tuple_u32ScriptZ_get_b(ret_conv_54_b_conv_30); + TwoTuple ret_conv_54_b_conv_30_conv = new TwoTuple(ret_conv_54_b_conv_30_a, ret_conv_54_b_conv_30_b, () -> { + bindings.C2Tuple_u32ScriptZ_free(ret_conv_54_b_conv_30); + }); + ret_conv_54_b_conv_30_arr[e] = ret_conv_54_b_conv_30_conv; + }; + TwoTuple[]> ret_conv_54_conv = new TwoTuple[]>(ret_conv_54_a, ret_conv_54_b_conv_30_arr); + // Warning: We may not free the C tuple object! + ret_conv_54_arr[c] = ret_conv_54_conv; + } + return ret_conv_54_arr; + } + + public void load_outputs_to_watch(Filter filter) { + bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter == null ? 0 : filter.ptr); + this.ptrs_to.add(filter); + } + public MonitorEvent[] get_and_clear_pending_monitor_events() { number[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr); MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret.length];