1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * Static channel fields used to build transactions given per-commitment fields, organized by
11 * broadcaster/countersignatory.
13 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
14 * as_holder_broadcastable and as_counterparty_broadcastable functions.
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class DirectedChannelTransactionParameters extends CommonBase {
18 DirectedChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); }
19 @Override @SuppressWarnings("deprecation")
20 protected void finalize() throws Throwable {
22 if (ptr != 0) { bindings.DirectedChannelTransactionParameters_free(ptr); }
26 * Get the channel pubkeys for the broadcaster
28 public ChannelPublicKeys broadcaster_pubkeys() {
29 long ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr);
30 if (ret < 1024) { return null; }
31 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
32 ret_hu_conv.ptrs_to.add(this);
37 * Get the channel pubkeys for the countersignatory
39 public ChannelPublicKeys countersignatory_pubkeys() {
40 long ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr);
41 if (ret < 1024) { return null; }
42 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
43 ret_hu_conv.ptrs_to.add(this);
48 * Get the contest delay applicable to the transactions.
49 * Note that the contest delay was selected by the countersignatory.
51 public short contest_delay() {
52 short ret = bindings.DirectedChannelTransactionParameters_contest_delay(this.ptr);
57 * Whether the channel is outbound from the broadcaster.
59 * The boolean representing the side that initiated the channel is
60 * an input to the commitment number obscure factor computation.
62 public boolean is_outbound() {
63 boolean ret = bindings.DirectedChannelTransactionParameters_is_outbound(this.ptr);
68 * The funding outpoint
70 public OutPoint funding_outpoint() {
71 long ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr);
72 if (ret < 1024) { return null; }
73 OutPoint ret_hu_conv = new OutPoint(null, ret);
74 ret_hu_conv.ptrs_to.add(this);