public static native long COption_ScalarZ_none();
// void COption_ScalarZ_free(struct LDKCOption_ScalarZ _res);
public static native void COption_ScalarZ_free(long _res);
+ // uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg);
+ public static native long COption_ScalarZ_clone_ptr(long arg);
+ // struct LDKCOption_ScalarZ COption_ScalarZ_clone(const struct LDKCOption_ScalarZ *NONNULL_PTR orig);
+ public static native long COption_ScalarZ_clone(long orig);
// struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
public static native long CResult_SharedSecretNoneZ_ok(byte[] o);
// struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_err(void);
* [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
*/
public static BackgroundProcessor start(org.ldk.structs.Persister persister, org.ldk.structs.EventHandler event_handler, org.ldk.structs.ChainMonitor chain_monitor, org.ldk.structs.ChannelManager channel_manager, org.ldk.structs.GossipSync gossip_sync, org.ldk.structs.PeerManager peer_manager, org.ldk.structs.Logger logger, org.ldk.structs.Option_WriteableScoreZ scorer) {
- long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, channel_manager == null ? 0 : channel_manager.ptr, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr, logger == null ? 0 : logger.ptr, scorer.ptr);
+ long ret = bindings.BackgroundProcessor_start(persister.ptr, event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, channel_manager == null ? 0 : channel_manager.ptr, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr, logger.ptr, scorer.ptr);
Reference.reachabilityFence(persister);
Reference.reachabilityFence(event_handler);
Reference.reachabilityFence(chain_monitor);
* Errors if less than two hops are provided or if `node_pk`(s) are invalid.
*/
public static Result_BlindedPathNoneZ new_for_message(byte[][] node_pks, org.ldk.structs.EntropySource entropy_source) {
- long ret = bindings.BlindedPath_new_for_message(node_pks != null ? Arrays.stream(node_pks).map(node_pks_conv_8 -> InternalUtils.check_arr_len(node_pks_conv_8, 33)).toArray(byte[][]::new) : null, entropy_source == null ? 0 : entropy_source.ptr);
+ long ret = bindings.BlindedPath_new_for_message(node_pks != null ? Arrays.stream(node_pks).map(node_pks_conv_8 -> InternalUtils.check_arr_len(node_pks_conv_8, 33)).toArray(byte[][]::new) : null, entropy_source.ptr);
Reference.reachabilityFence(node_pks);
Reference.reachabilityFence(entropy_source);
if (ret >= 0 && ret <= 4096) { return null; }
* Signs the holder commitment transaction because we are about to broadcast it.
*/
public byte[] sign_holder_commitment(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis, org.ldk.structs.EntropySource entropy_source) {
- byte[] ret = bindings.BuiltCommitmentTransaction_sign_holder_commitment(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis, entropy_source == null ? 0 : entropy_source.ptr);
+ byte[] ret = bindings.BuiltCommitmentTransaction_sign_holder_commitment(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis, entropy_source.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(funding_key);
Reference.reachabilityFence(funding_redeemscript);
* transactions relevant to the watched channels.
*/
public static ChainMonitor of(org.ldk.structs.Option_FilterZ chain_source, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.Logger logger, org.ldk.structs.FeeEstimator feeest, org.ldk.structs.Persist persister) {
- long ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr);
+ long ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster.ptr, logger.ptr, feeest.ptr, persister.ptr);
Reference.reachabilityFence(chain_source);
Reference.reachabilityFence(broadcaster);
Reference.reachabilityFence(logger);
* [`params.best_block.block_hash`]: chain::BestBlock::block_hash
*/
public static ChannelManager of(org.ldk.structs.FeeEstimator fee_est, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.UserConfig config, org.ldk.structs.ChainParameters params) {
- 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, router == null ? 0 : router.ptr, logger == null ? 0 : logger.ptr, entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, signer_provider == null ? 0 : signer_provider.ptr, config == null ? 0 : config.ptr, params == null ? 0 : params.ptr);
+ long ret = bindings.ChannelManager_new(fee_est.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, entropy_source.ptr, node_signer.ptr, signer_provider.ptr, config == null ? 0 : config.ptr, params == null ? 0 : params.ptr);
Reference.reachabilityFence(fee_est);
Reference.reachabilityFence(chain_monitor);
Reference.reachabilityFence(tx_broadcaster);
* A cryptographically secure source of entropy.
*/
public void set_entropy_source(org.ldk.structs.EntropySource val) {
- bindings.ChannelManagerReadArgs_set_entropy_source(this.ptr, val == null ? 0 : val.ptr);
+ bindings.ChannelManagerReadArgs_set_entropy_source(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* A signer that is able to perform node-scoped cryptographic operations.
*/
public void set_node_signer(org.ldk.structs.NodeSigner val) {
- bindings.ChannelManagerReadArgs_set_node_signer(this.ptr, val == null ? 0 : val.ptr);
+ bindings.ChannelManagerReadArgs_set_node_signer(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* signing data.
*/
public void set_signer_provider(org.ldk.structs.SignerProvider val) {
- bindings.ChannelManagerReadArgs_set_signer_provider(this.ptr, val == null ? 0 : val.ptr);
+ bindings.ChannelManagerReadArgs_set_signer_provider(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* No calls to the FeeEstimator will be made during deserialization.
*/
public void set_fee_estimator(org.ldk.structs.FeeEstimator val) {
- bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val == null ? 0 : val.ptr);
+ bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* chain::Watch after deserializing this ChannelManager.
*/
public void set_chain_monitor(org.ldk.structs.Watch val) {
- bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val == null ? 0 : val.ptr);
+ bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* force-closed during deserialization.
*/
public void set_tx_broadcaster(org.ldk.structs.BroadcasterInterface val) {
- bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val == null ? 0 : val.ptr);
+ bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* No calls to the router will be made during deserialization.
*/
public void set_router(org.ldk.structs.Router val) {
- bindings.ChannelManagerReadArgs_set_router(this.ptr, val == null ? 0 : val.ptr);
+ bindings.ChannelManagerReadArgs_set_router(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* deserialization.
*/
public void set_logger(org.ldk.structs.Logger val) {
- bindings.ChannelManagerReadArgs_set_logger(this.ptr, val == null ? 0 : val.ptr);
+ bindings.ChannelManagerReadArgs_set_logger(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* populate a HashMap directly from C.
*/
public static ChannelManagerReadArgs of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.UserConfig default_config, ChannelMonitor[] channel_monitors) {
- long ret = bindings.ChannelManagerReadArgs_new(entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, signer_provider == null ? 0 : signer_provider.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, router == null ? 0 : router.ptr, logger == null ? 0 : logger.ptr, default_config == null ? 0 : default_config.ptr, channel_monitors != null ? Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr).toArray() : null);
+ long ret = bindings.ChannelManagerReadArgs_new(entropy_source.ptr, node_signer.ptr, signer_provider.ptr, fee_estimator.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, default_config == null ? 0 : default_config.ptr, channel_monitors != null ? Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr).toArray() : null);
Reference.reachabilityFence(entropy_source);
Reference.reachabilityFence(node_signer);
Reference.reachabilityFence(signer_provider);
* panics if the given update is not the next update by update_id.
*/
public Result_NoneNoneZ update_monitor(org.ldk.structs.ChannelMonitorUpdate updates, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
- long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(updates);
Reference.reachabilityFence(broadcaster);
* have been registered.
*/
public void load_outputs_to_watch(org.ldk.structs.Filter filter) {
- bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter == null ? 0 : filter.ptr);
+ bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(filter);
if (this != null) { this.ptrs_to.add(filter); };
* [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
*/
public byte[][] get_latest_holder_commitment_txn(org.ldk.structs.Logger logger) {
- byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : logger.ptr);
+ byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(logger);
if (this != null) { this.ptrs_to.add(logger); };
* [`get_outputs_to_watch`]: #method.get_outputs_to_watch
*/
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
- long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(header);
Reference.reachabilityFence(txdata);
* appropriately.
*/
public void block_disconnected(byte[] header, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
- bindings.ChannelMonitor_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ bindings.ChannelMonitor_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(header);
Reference.reachabilityFence(height);
* [`block_connected`]: Self::block_connected
*/
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
- long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(header);
Reference.reachabilityFence(txdata);
* [`block_disconnected`]: Self::block_disconnected
*/
public void transaction_unconfirmed(byte[] txid, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
- bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32), broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32), broadcaster.ptr, fee_estimator.ptr, logger.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(txid);
Reference.reachabilityFence(broadcaster);
* [`block_connected`]: Self::block_connected
*/
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] best_block_updated(byte[] header, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
- long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(header);
Reference.reachabilityFence(height);
* connections, like on mobile.
*/
public void rebroadcast_pending_claims(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
- bindings.ChannelMonitor_rebroadcast_pending_claims(this.ptr, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ bindings.ChannelMonitor_rebroadcast_pending_claims(this.ptr, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(broadcaster);
Reference.reachabilityFence(fee_estimator);
* to send.
*/
public Result_NoneLightningErrorZ handle_custom_message(org.ldk.structs.Type msg, byte[] sender_node_id) {
- long ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr, InternalUtils.check_arr_len(sender_node_id, 33));
+ long ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg.ptr, InternalUtils.check_arr_len(sender_node_id, 33));
Reference.reachabilityFence(this);
Reference.reachabilityFence(msg);
Reference.reachabilityFence(sender_node_id);
* Called with the custom message that was received.
*/
public void handle_custom_message(org.ldk.structs.CustomOnionMessageContents msg) {
- bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr);
+ bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(msg);
if (this != null) { this.ptrs_to.add(msg); };
* Creates a new router.
*/
public static DefaultRouter of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes, org.ldk.structs.LockableScore scorer) {
- long ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32), scorer == null ? 0 : scorer.ptr);
+ long ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr, logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32), scorer.ptr);
Reference.reachabilityFence(network_graph);
Reference.reachabilityFence(logger);
Reference.reachabilityFence(random_seed_bytes);
* See the trait-level documentation for requirements.
*/
public void process_pending_events(org.ldk.structs.EventHandler handler) {
- bindings.EventsProvider_process_pending_events(this.ptr, handler == null ? 0 : handler.ptr);
+ bindings.EventsProvider_process_pending_events(this.ptr, handler.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(handler);
if (this != null) { this.ptrs_to.add(handler); };
* Read `ChannelMonitor`s from disk.
*/
public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ read_channelmonitors(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.SignerProvider signer_provider) {
- long ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, entropy_source == null ? 0 : entropy_source.ptr, signer_provider == null ? 0 : signer_provider.ptr);
+ long ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, entropy_source.ptr, signer_provider.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(entropy_source);
Reference.reachabilityFence(signer_provider);
* completed, the callback will be called immediately.
*/
public void register_callback_fn(org.ldk.structs.FutureCallback callback) {
- bindings.Future_register_callback_fn(this.ptr, callback == null ? 0 : callback.ptr);
+ bindings.Future_register_callback_fn(this.ptr, callback.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(callback);
if (this != null) { this.ptrs_to.add(callback); };
* Read a InMemorySigner from a byte array, created by InMemorySigner_write
*/
public static Result_InMemorySignerDecodeErrorZ read(byte[] ser, org.ldk.structs.EntropySource arg) {
- long ret = bindings.InMemorySigner_read(ser, arg == null ? 0 : arg.ptr);
+ long ret = bindings.InMemorySigner_read(ser, arg.ptr);
Reference.reachabilityFence(ser);
Reference.reachabilityFence(arg);
if (ret >= 0 && ret <= 4096) { return null; }
@Override public long lock() {
Score ret = arg.lock();
Reference.reachabilityFence(arg);
- long result = ret == null ? 0 : ret.ptr;
+ long result = ret.ptr;
if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); };
return result;
}
* [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
*/
public void set_chan_handler(org.ldk.structs.ChannelMessageHandler val) {
- bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0 : val.ptr);
+ bindings.MessageHandler_set_chan_handler(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
*/
public void set_route_handler(org.ldk.structs.RoutingMessageHandler val) {
- bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : val.ptr);
+ bindings.MessageHandler_set_route_handler(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* [`IgnoringMessageHandler`].
*/
public void set_onion_message_handler(org.ldk.structs.OnionMessageHandler val) {
- bindings.MessageHandler_set_onion_message_handler(this.ptr, val == null ? 0 : val.ptr);
+ bindings.MessageHandler_set_onion_message_handler(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
if (this != null) { this.ptrs_to.add(val); };
* Constructs a new MessageHandler given each field
*/
public static MessageHandler of(org.ldk.structs.ChannelMessageHandler chan_handler_arg, org.ldk.structs.RoutingMessageHandler route_handler_arg, org.ldk.structs.OnionMessageHandler onion_message_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, onion_message_handler_arg == null ? 0 : onion_message_handler_arg.ptr);
+ long ret = bindings.MessageHandler_new(chan_handler_arg.ptr, route_handler_arg.ptr, onion_message_handler_arg.ptr);
Reference.reachabilityFence(chan_handler_arg);
Reference.reachabilityFence(route_handler_arg);
Reference.reachabilityFence(onion_message_handler_arg);
* Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
*/
public static MultiThreadedLockableScore of(org.ldk.structs.Score score) {
- long ret = bindings.MultiThreadedLockableScore_new(score == null ? 0 : score.ptr);
+ long ret = bindings.MultiThreadedLockableScore_new(score.ptr);
Reference.reachabilityFence(score);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.MultiThreadedLockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MultiThreadedLockableScore(null, ret); }
* Read a NetworkGraph from a byte array, created by NetworkGraph_write
*/
public static Result_NetworkGraphDecodeErrorZ read(byte[] ser, org.ldk.structs.Logger arg) {
- long ret = bindings.NetworkGraph_read(ser, arg == null ? 0 : arg.ptr);
+ long ret = bindings.NetworkGraph_read(ser, arg.ptr);
Reference.reachabilityFence(ser);
Reference.reachabilityFence(arg);
if (ret >= 0 && ret <= 4096) { return null; }
* Creates a new, empty, network graph.
*/
public static NetworkGraph of(org.ldk.enums.Network network, org.ldk.structs.Logger logger) {
- long ret = bindings.NetworkGraph_new(network, logger == null ? 0 : logger.ptr);
+ long ret = bindings.NetworkGraph_new(network, logger.ptr);
Reference.reachabilityFence(network);
Reference.reachabilityFence(logger);
if (ret >= 0 && ret <= 4096) { return null; }
* Utility method to constructs a new Custom-variant OnionMessageContents
*/
public static OnionMessageContents custom(org.ldk.structs.CustomOnionMessageContents a) {
- long ret = bindings.OnionMessageContents_custom(a == null ? 0 : a.ptr);
+ long ret = bindings.OnionMessageContents_custom(a.ptr);
Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.OnionMessageContents ret_hu_conv = org.ldk.structs.OnionMessageContents.constr_from_ptr(ret);
* their respective handlers.
*/
public static OnionMessenger of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.CustomOnionMessageHandler custom_handler) {
- long ret = bindings.OnionMessenger_new(entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, custom_handler == null ? 0 : custom_handler.ptr);
+ long ret = bindings.OnionMessenger_new(entropy_source.ptr, node_signer.ptr, logger.ptr, custom_handler.ptr);
Reference.reachabilityFence(entropy_source);
Reference.reachabilityFence(node_signer);
Reference.reachabilityFence(logger);
* Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
*/
public static Option_CustomOnionMessageContentsZ some(org.ldk.structs.CustomOnionMessageContents o) {
- long ret = bindings.COption_CustomOnionMessageContentsZ_some(o == null ? 0 : o.ptr);
+ long ret = bindings.COption_CustomOnionMessageContentsZ_some(o.ptr);
Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.Option_CustomOnionMessageContentsZ ret_hu_conv = org.ldk.structs.Option_CustomOnionMessageContentsZ.constr_from_ptr(ret);
* Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
*/
public static Option_FilterZ some(org.ldk.structs.Filter o) {
- long ret = bindings.COption_FilterZ_some(o == null ? 0 : o.ptr);
+ long ret = bindings.COption_FilterZ_some(o.ptr);
Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.Option_FilterZ ret_hu_conv = org.ldk.structs.Option_FilterZ.constr_from_ptr(ret);
return ret_hu_conv;
}
+ long clone_ptr() {
+ long ret = bindings.COption_ScalarZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a new COption_ScalarZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Option_ScalarZ clone() {
+ long ret = bindings.COption_ScalarZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.Option_ScalarZ ret_hu_conv = org.ldk.structs.Option_ScalarZ.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+ return ret_hu_conv;
+ }
+
}
* Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
*/
public static Option_TypeZ some(org.ldk.structs.Type o) {
- long ret = bindings.COption_TypeZ_some(o == null ? 0 : o.ptr);
+ long ret = bindings.COption_TypeZ_some(o.ptr);
Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.Option_TypeZ ret_hu_conv = org.ldk.structs.Option_TypeZ.constr_from_ptr(ret);
* Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
*/
public static Option_UtxoLookupZ some(org.ldk.structs.UtxoLookup o) {
- long ret = bindings.COption_UtxoLookupZ_some(o == null ? 0 : o.ptr);
+ long ret = bindings.COption_UtxoLookupZ_some(o.ptr);
Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.Option_UtxoLookupZ ret_hu_conv = org.ldk.structs.Option_UtxoLookupZ.constr_from_ptr(ret);
* Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
*/
public static Option_WriteableScoreZ some(org.ldk.structs.WriteableScore o) {
- long ret = bindings.COption_WriteableScoreZ_some(o == null ? 0 : o.ptr);
+ long ret = bindings.COption_WriteableScoreZ_some(o.ptr);
Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.Option_WriteableScoreZ ret_hu_conv = org.ldk.structs.Option_WriteableScoreZ.constr_from_ptr(ret);
* correct, and the announcement is signed with channel owners' keys.
*/
public static P2PGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Option_UtxoLookupZ utxo_lookup, org.ldk.structs.Logger logger) {
- long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr, utxo_lookup.ptr, logger == null ? 0 : logger.ptr);
+ long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr, utxo_lookup.ptr, logger.ptr);
Reference.reachabilityFence(network_graph);
Reference.reachabilityFence(utxo_lookup);
Reference.reachabilityFence(logger);
* minute should suffice.
*/
public static PeerManager of(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, OnionMessageHandler message_handler_onion_message_handler_arg, int current_time, byte[] ephemeral_random_data, org.ldk.structs.Logger logger, org.ldk.structs.CustomMessageHandler custom_message_handler, org.ldk.structs.NodeSigner node_signer) {
- 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, message_handler_onion_message_handler_arg == null ? 0 : message_handler_onion_message_handler_arg.ptr), current_time, InternalUtils.check_arr_len(ephemeral_random_data, 32), logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr, node_signer == null ? 0 : node_signer.ptr);
+ long ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg.ptr, message_handler_onion_message_handler_arg.ptr), current_time, InternalUtils.check_arr_len(ephemeral_random_data, 32), logger.ptr, custom_message_handler.ptr, node_signer.ptr);
Reference.reachabilityFence(message_handler_chan_handler_arg);
Reference.reachabilityFence(message_handler_route_handler_arg);
Reference.reachabilityFence(message_handler_onion_message_handler_arg);
* [`socket_disconnected`]: PeerManager::socket_disconnected
*/
public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, org.ldk.structs.SocketDescriptor descriptor, org.ldk.structs.Option_NetAddressZ remote_network_address) {
- long ret = bindings.PeerManager_new_outbound_connection(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), descriptor == null ? 0 : descriptor.ptr, remote_network_address.ptr);
+ long ret = bindings.PeerManager_new_outbound_connection(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), descriptor.ptr, remote_network_address.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(their_node_id);
Reference.reachabilityFence(descriptor);
* [`socket_disconnected`]: PeerManager::socket_disconnected
*/
public Result_NonePeerHandleErrorZ new_inbound_connection(org.ldk.structs.SocketDescriptor descriptor, org.ldk.structs.Option_NetAddressZ remote_network_address) {
- long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : descriptor.ptr, remote_network_address.ptr);
+ long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor.ptr, remote_network_address.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(descriptor);
Reference.reachabilityFence(remote_network_address);
* [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
*/
public Result_NonePeerHandleErrorZ write_buffer_space_avail(org.ldk.structs.SocketDescriptor descriptor) {
- long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : descriptor.ptr);
+ long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(descriptor);
if (ret >= 0 && ret <= 4096) { return null; }
* [`process_events`]: PeerManager::process_events
*/
public Result_boolPeerHandleErrorZ read_event(org.ldk.structs.SocketDescriptor peer_descriptor, byte[] data) {
- long ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0 : peer_descriptor.ptr, data);
+ long ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor.ptr, data);
Reference.reachabilityFence(this);
Reference.reachabilityFence(peer_descriptor);
Reference.reachabilityFence(data);
* Indicates that the given socket descriptor's connection is now closed.
*/
public void socket_disconnected(org.ldk.structs.SocketDescriptor descriptor) {
- bindings.PeerManager_socket_disconnected(this.ptr, descriptor == null ? 0 : descriptor.ptr);
+ bindings.PeerManager_socket_disconnected(this.ptr, descriptor.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(descriptor);
}
* Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
*/
public Result_NoneErrorZ persist_scorer(org.ldk.structs.WriteableScore scorer) {
- long ret = bindings.Persister_persist_scorer(this.ptr, scorer == null ? 0 : scorer.ptr);
+ long ret = bindings.Persister_persist_scorer(this.ptr, scorer.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(scorer);
if (ret >= 0 && ret <= 4096) { return null; }
* through a network graph.
*/
public static ProbabilisticScorer of(org.ldk.structs.ProbabilisticScoringParameters params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) {
- long ret = bindings.ProbabilisticScorer_new(params == null ? 0 : params.ptr, network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr);
+ long ret = bindings.ProbabilisticScorer_new(params == null ? 0 : params.ptr, network_graph == null ? 0 : network_graph.ptr, logger.ptr);
Reference.reachabilityFence(params);
Reference.reachabilityFence(network_graph);
Reference.reachabilityFence(logger);
* Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
*/
public static Result_ProbabilisticScorerDecodeErrorZ read(byte[] ser, org.ldk.structs.ProbabilisticScoringParameters arg_a, org.ldk.structs.NetworkGraph arg_b, org.ldk.structs.Logger arg_c) {
- long ret = bindings.ProbabilisticScorer_read(ser, arg_a == null ? 0 : arg_a.ptr, arg_b == null ? 0 : arg_b.ptr, arg_c == null ? 0 : arg_c.ptr);
+ long ret = bindings.ProbabilisticScorer_read(ser, arg_a == null ? 0 : arg_a.ptr, arg_b == null ? 0 : arg_b.ptr, arg_c.ptr);
Reference.reachabilityFence(ser);
Reference.reachabilityFence(arg_a);
Reference.reachabilityFence(arg_b);
* Instantiate a new [`RapidGossipSync`] instance.
*/
public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) {
- long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr);
+ long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr, logger.ptr);
Reference.reachabilityFence(network_graph);
Reference.reachabilityFence(logger);
if (ret >= 0 && ret <= 4096) { return null; }
* Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
*/
public static Result_NetworkGraphDecodeErrorZ ok(Network o_network, Logger o_logger) {
- long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(bindings.NetworkGraph_new(o_network, o_logger == null ? 0 : o_logger.ptr));
+ long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(bindings.NetworkGraph_new(o_network, o_logger.ptr));
Reference.reachabilityFence(o_network);
Reference.reachabilityFence(o_logger);
if (ret >= 0 && ret <= 4096) { return null; }
* Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
*/
public static Result_ProbabilisticScorerDecodeErrorZ ok(ProbabilisticScoringParameters o_params, NetworkGraph o_network_graph, Logger o_logger) {
- long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_params == null ? 0 : o_params.ptr, o_network_graph == null ? 0 : o_network_graph.ptr, o_logger == null ? 0 : o_logger.ptr));
+ long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_params == null ? 0 : o_params.ptr, o_network_graph == null ? 0 : o_network_graph.ptr, o_logger.ptr));
Reference.reachabilityFence(o_params);
Reference.reachabilityFence(o_network_graph);
Reference.reachabilityFence(o_logger);
* Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
*/
public static Result_WriteableEcdsaChannelSignerDecodeErrorZ ok(org.ldk.structs.WriteableEcdsaChannelSigner o) {
- long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o == null ? 0 : o.ptr);
+ long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o.ptr);
Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret);
* Initialize a new `ScorerAccountingForInFlightHtlcs`.
*/
public static ScorerAccountingForInFlightHtlcs of(org.ldk.structs.Score scorer, org.ldk.structs.InFlightHtlcs inflight_htlcs) {
- long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer == null ? 0 : scorer.ptr, inflight_htlcs == null ? 0 : inflight_htlcs.ptr);
+ long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer.ptr, inflight_htlcs == null ? 0 : inflight_htlcs.ptr);
Reference.reachabilityFence(scorer);
Reference.reachabilityFence(inflight_htlcs);
if (ret >= 0 && ret <= 4096) { return null; }
@Override public long derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) {
WriteableEcdsaChannelSigner ret = arg.derive_channel_signer(channel_value_satoshis, channel_keys_id);
Reference.reachabilityFence(arg);
- long result = ret == null ? 0 : ret.clone_ptr();
+ long result = ret.clone_ptr();
if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); };
return result;
}
* This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
*/
public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, org.ldk.structs.DirectedChannelTransactionParameters channel_parameters, org.ldk.structs.EntropySource entropy_source) {
- long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr, entropy_source == null ? 0 : entropy_source.ptr);
+ long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr, entropy_source.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(htlc_base_key);
Reference.reachabilityFence(channel_parameters);
* Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
*/
public static TwoTuple_BlockHashChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Router b_router, Logger b_logger, EntropySource b_entropy_source, NodeSigner b_node_signer, SignerProvider b_signer_provider, UserConfig b_config, ChainParameters b_params) {
- long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est == null ? 0 : b_fee_est.ptr, b_chain_monitor == null ? 0 : b_chain_monitor.ptr, b_tx_broadcaster == null ? 0 : b_tx_broadcaster.ptr, b_router == null ? 0 : b_router.ptr, b_logger == null ? 0 : b_logger.ptr, b_entropy_source == null ? 0 : b_entropy_source.ptr, b_node_signer == null ? 0 : b_node_signer.ptr, b_signer_provider == null ? 0 : b_signer_provider.ptr, b_config == null ? 0 : b_config.ptr, b_params == null ? 0 : b_params.ptr));
+ long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est.ptr, b_chain_monitor.ptr, b_tx_broadcaster.ptr, b_router.ptr, b_logger.ptr, b_entropy_source.ptr, b_node_signer.ptr, b_signer_provider.ptr, b_config == null ? 0 : b_config.ptr, b_params == null ? 0 : b_params.ptr));
Reference.reachabilityFence(a);
Reference.reachabilityFence(b_fee_est);
Reference.reachabilityFence(b_chain_monitor);
* Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
*/
public static TwoTuple_PublicKeyTypeZ of(byte[] a, org.ldk.structs.Type b) {
- long ret = bindings.C2Tuple_PublicKeyTypeZ_new(InternalUtils.check_arr_len(a, 33), b == null ? 0 : b.ptr);
+ long ret = bindings.C2Tuple_PublicKeyTypeZ_new(InternalUtils.check_arr_len(a, 33), b.ptr);
Reference.reachabilityFence(a);
Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
* Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
*/
public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(byte[] ser, org.ldk.structs.EntropySource arg_a, org.ldk.structs.SignerProvider arg_b) {
- long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg_a == null ? 0 : arg_a.ptr, arg_b == null ? 0 : arg_b.ptr);
+ long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg_a.ptr, arg_b.ptr);
Reference.reachabilityFence(ser);
Reference.reachabilityFence(arg_a);
Reference.reachabilityFence(arg_b);
* Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
*/
public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(byte[] ser, EntropySource arg_entropy_source, NodeSigner arg_node_signer, SignerProvider arg_signer_provider, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Router arg_router, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) {
- long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_entropy_source == null ? 0 : arg_entropy_source.ptr, arg_node_signer == null ? 0 : arg_node_signer.ptr, arg_signer_provider == null ? 0 : arg_signer_provider.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_router == null ? 0 : arg_router.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr, arg_channel_monitors != null ? Arrays.stream(arg_channel_monitors).mapToLong(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr).toArray() : null));
+ long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_entropy_source.ptr, arg_node_signer.ptr, arg_signer_provider.ptr, arg_fee_estimator.ptr, arg_chain_monitor.ptr, arg_tx_broadcaster.ptr, arg_router.ptr, arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr, arg_channel_monitors != null ? Arrays.stream(arg_channel_monitors).mapToLong(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr).toArray() : null));
Reference.reachabilityFence(ser);
Reference.reachabilityFence(arg_entropy_source);
Reference.reachabilityFence(arg_node_signer);
* [`NodeSigner::get_inbound_payment_key_material`]: crate::chain::keysinterface::NodeSigner::get_inbound_payment_key_material
*/
public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create(org.ldk.structs.ExpandedKey keys, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.EntropySource entropy_source, long current_time, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
- long ret = bindings.create(keys == null ? 0 : keys.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, entropy_source == null ? 0 : entropy_source.ptr, current_time, min_final_cltv_expiry_delta.ptr);
+ long ret = bindings.create(keys == null ? 0 : keys.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, entropy_source.ptr, current_time, min_final_cltv_expiry_delta.ptr);
Reference.reachabilityFence(keys);
Reference.reachabilityFence(min_value_msat);
Reference.reachabilityFence(invoice_expiry_delta_secs);
* Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, @Nullable ChannelDetails[] first_hops, org.ldk.structs.Logger logger, org.ldk.structs.Score scorer, byte[] random_seed_bytes) {
- long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr).toArray() : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32));
+ long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr).toArray() : null, logger.ptr, scorer.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32));
Reference.reachabilityFence(our_node_pubkey);
Reference.reachabilityFence(route_params);
Reference.reachabilityFence(network_graph);
* Re-uses logic from `find_route`, so the restrictions described there also apply here.
*/
public static Result_RouteLightningErrorZ build_route_from_hops(byte[] our_node_pubkey, byte[][] hops, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes) {
- long ret = bindings.build_route_from_hops(InternalUtils.check_arr_len(our_node_pubkey, 33), hops != null ? Arrays.stream(hops).map(hops_conv_8 -> InternalUtils.check_arr_len(hops_conv_8, 33)).toArray(byte[][]::new) : null, route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32));
+ long ret = bindings.build_route_from_hops(InternalUtils.check_arr_len(our_node_pubkey, 33), hops != null ? Arrays.stream(hops).map(hops_conv_8 -> InternalUtils.check_arr_len(hops_conv_8, 33)).toArray(byte[][]::new) : null, route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32));
Reference.reachabilityFence(our_node_pubkey);
Reference.reachabilityFence(hops);
Reference.reachabilityFence(route_params);
* Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice(org.ldk.structs.Option_u64Z amt_msat, @Nullable byte[] payment_hash, java.lang.String description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) {
- long ret = bindings.create_phantom_invoice(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), description, invoice_expiry_delta_secs, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch);
+ long ret = bindings.create_phantom_invoice(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), description, invoice_expiry_delta_secs, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch);
Reference.reachabilityFence(amt_msat);
Reference.reachabilityFence(payment_hash);
Reference.reachabilityFence(description);
* Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(org.ldk.structs.Option_u64Z amt_msat, @Nullable byte[] payment_hash, int invoice_expiry_delta_secs, org.ldk.structs.Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) {
- long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), invoice_expiry_delta_secs, description_hash == null ? 0 : description_hash.ptr, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch);
+ long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), invoice_expiry_delta_secs, description_hash == null ? 0 : description_hash.ptr, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch);
Reference.reachabilityFence(amt_msat);
Reference.reachabilityFence(payment_hash);
Reference.reachabilityFence(invoice_expiry_delta_secs);
* [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
*/
public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
- long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
+ long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
Reference.reachabilityFence(channelmanager);
Reference.reachabilityFence(node_signer);
Reference.reachabilityFence(logger);
* [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
*/
public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
- long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
+ long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
Reference.reachabilityFence(channelmanager);
Reference.reachabilityFence(node_signer);
Reference.reachabilityFence(logger);
* available and the current time is supplied by the caller.
*/
public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
- long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
+ long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
Reference.reachabilityFence(channelmanager);
Reference.reachabilityFence(node_signer);
Reference.reachabilityFence(logger);
* available and the current time is supplied by the caller.
*/
public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
- long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
+ long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
Reference.reachabilityFence(channelmanager);
Reference.reachabilityFence(node_signer);
Reference.reachabilityFence(logger);
* the payment hash is also involved outside the scope of lightning.
*/
public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
- long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.check_arr_len(payment_hash, 32), min_final_cltv_expiry_delta.ptr);
+ long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.check_arr_len(payment_hash, 32), min_final_cltv_expiry_delta.ptr);
Reference.reachabilityFence(channelmanager);
Reference.reachabilityFence(node_signer);
Reference.reachabilityFence(logger);
arr_of_B_clz = (*env)->FindClass(env, "[B");
CHECK(arr_of_B_clz != NULL);
arr_of_B_clz = (*env)->NewGlobalRef(env, arr_of_B_clz);
- String_clz = (*env)->FindClass(env, "Ljava/lang/String;");
+ String_clz = (*env)->FindClass(env, "java/lang/String");
CHECK(String_clz != NULL);
String_clz = (*env)->NewGlobalRef(env, String_clz);
}
void* tweak_ptr = untag_ptr(tweak);
CHECK_ACCESS(tweak_ptr);
LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
- // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
+ tweak_conv = COption_ScalarZ_clone((LDKCOption_ScalarZ*)untag_ptr(tweak));
LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
*ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
return tag_ptr(ret_conv, true);
COption_ScalarZ_free(_res_conv);
}
+static inline uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg) {
+ LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *ret_copy = COption_ScalarZ_clone(arg);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCOption_ScalarZ* arg_conv = (LDKCOption_ScalarZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_ScalarZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCOption_ScalarZ* orig_conv = (LDKCOption_ScalarZ*)untag_ptr(orig);
+ LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *ret_copy = COption_ScalarZ_clone(orig_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
LDKThirtyTwoBytes o_ref;
CHECK((*env)->GetArrayLength(env, o) == 32);
arr_of_B_clz = (*env)->FindClass(env, "[B");
CHECK(arr_of_B_clz != NULL);
arr_of_B_clz = (*env)->NewGlobalRef(env, arr_of_B_clz);
- String_clz = (*env)->FindClass(env, "Ljava/lang/String;");
+ String_clz = (*env)->FindClass(env, "java/lang/String");
CHECK(String_clz != NULL);
String_clz = (*env)->NewGlobalRef(env, String_clz);
}
void* tweak_ptr = untag_ptr(tweak);
CHECK_ACCESS(tweak_ptr);
LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
- // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
+ tweak_conv = COption_ScalarZ_clone((LDKCOption_ScalarZ*)untag_ptr(tweak));
LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
*ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
return tag_ptr(ret_conv, true);
COption_ScalarZ_free(_res_conv);
}
+static inline uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg) {
+ LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *ret_copy = COption_ScalarZ_clone(arg);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCOption_ScalarZ* arg_conv = (LDKCOption_ScalarZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_ScalarZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCOption_ScalarZ* orig_conv = (LDKCOption_ScalarZ*)untag_ptr(orig);
+ LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *ret_copy = COption_ScalarZ_clone(orig_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
LDKThirtyTwoBytes o_ref;
CHECK((*env)->GetArrayLength(env, o) == 32);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: COption_ScalarZ_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: COption_ScalarZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: CResult_SharedSecretNoneZ_ok