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 * Static channel fields used to build transactions given per-commitment fields, organized by
13 * broadcaster/countersignatory.
15 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
16 * as_holder_broadcastable and as_counterparty_broadcastable functions.
18 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
19 public class DirectedChannelTransactionParameters extends CommonBase {
20 DirectedChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); }
21 @Override @SuppressWarnings("deprecation")
22 protected void finalize() throws Throwable {
24 if (ptr != 0) { bindings.DirectedChannelTransactionParameters_free(ptr); }
28 * Get the channel pubkeys for the broadcaster
30 public ChannelPublicKeys broadcaster_pubkeys() {
31 long ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr);
32 Reference.reachabilityFence(this);
33 if (ret >= 0 && ret <= 4096) { return null; }
34 org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); }
35 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
40 * Get the channel pubkeys for the countersignatory
42 public ChannelPublicKeys countersignatory_pubkeys() {
43 long ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr);
44 Reference.reachabilityFence(this);
45 if (ret >= 0 && ret <= 4096) { return null; }
46 org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); }
47 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
52 * Get the contest delay applicable to the transactions.
53 * Note that the contest delay was selected by the countersignatory.
55 public short contest_delay() {
56 short ret = bindings.DirectedChannelTransactionParameters_contest_delay(this.ptr);
57 Reference.reachabilityFence(this);
62 * Whether the channel is outbound from the broadcaster.
64 * The boolean representing the side that initiated the channel is
65 * an input to the commitment number obscure factor computation.
67 public boolean is_outbound() {
68 boolean ret = bindings.DirectedChannelTransactionParameters_is_outbound(this.ptr);
69 Reference.reachabilityFence(this);
74 * The funding outpoint
76 public OutPoint funding_outpoint() {
77 long ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr);
78 Reference.reachabilityFence(this);
79 if (ret >= 0 && ret <= 4096) { return null; }
80 org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
81 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
86 * Whether to use anchors for this channel
88 public ChannelTypeFeatures channel_type_features() {
89 long ret = bindings.DirectedChannelTransactionParameters_channel_type_features(this.ptr);
90 Reference.reachabilityFence(this);
91 if (ret >= 0 && ret <= 4096) { return null; }
92 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
93 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };