1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
13 * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
14 * Replace-By-Fee (RBF).
16 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
18 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
19 public class BumpTransactionEventHandler extends CommonBase {
20 BumpTransactionEventHandler(Object _dummy, long ptr) { super(ptr); }
21 @Override @SuppressWarnings("deprecation")
22 protected void finalize() throws Throwable {
24 if (ptr != 0) { bindings.BumpTransactionEventHandler_free(ptr); }
28 * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
30 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
32 public static BumpTransactionEventHandler of(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.CoinSelectionSource utxo_source, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.Logger logger) {
33 long ret = bindings.BumpTransactionEventHandler_new(broadcaster.ptr, utxo_source.ptr, signer_provider.ptr, logger.ptr);
34 Reference.reachabilityFence(broadcaster);
35 Reference.reachabilityFence(utxo_source);
36 Reference.reachabilityFence(signer_provider);
37 Reference.reachabilityFence(logger);
38 if (ret >= 0 && ret <= 4096) { return null; }
39 org.ldk.structs.BumpTransactionEventHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BumpTransactionEventHandler(null, ret); }
40 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
41 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(broadcaster); };
42 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(utxo_source); };
43 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(signer_provider); };
44 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
49 * Handles all variants of [`BumpTransactionEvent`].
51 public void handle_event(org.ldk.structs.BumpTransactionEvent event) {
52 bindings.BumpTransactionEventHandler_handle_event(this.ptr, event == null ? 0 : event.ptr);
53 Reference.reachabilityFence(this);
54 Reference.reachabilityFence(event);