Update auto-updated Java files
[ldk-java] / src / main / java / org / ldk / structs / DirectedChannelTransactionParameters.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * Static channel fields used to build transactions given per-commitment fields, organized by
13  * broadcaster/countersignatory.
14  * 
15  * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
16  * as_holder_broadcastable and as_counterparty_broadcastable functions.
17  */
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 {
23                 super.finalize();
24                 if (ptr != 0) { bindings.DirectedChannelTransactionParameters_free(ptr); }
25         }
26
27         /**
28          * Get the channel pubkeys for the broadcaster
29          */
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                 ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); }
35                 ret_hu_conv.ptrs_to.add(this);
36                 return ret_hu_conv;
37         }
38
39         /**
40          * Get the channel pubkeys for the countersignatory
41          */
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                 ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); }
47                 ret_hu_conv.ptrs_to.add(this);
48                 return ret_hu_conv;
49         }
50
51         /**
52          * Get the contest delay applicable to the transactions.
53          * Note that the contest delay was selected by the countersignatory.
54          */
55         public short contest_delay() {
56                 short ret = bindings.DirectedChannelTransactionParameters_contest_delay(this.ptr);
57                 Reference.reachabilityFence(this);
58                 return ret;
59         }
60
61         /**
62          * Whether the channel is outbound from the broadcaster.
63          * 
64          * The boolean representing the side that initiated the channel is
65          * an input to the commitment number obscure factor computation.
66          */
67         public boolean is_outbound() {
68                 boolean ret = bindings.DirectedChannelTransactionParameters_is_outbound(this.ptr);
69                 Reference.reachabilityFence(this);
70                 return ret;
71         }
72
73         /**
74          * The funding outpoint
75          */
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                 OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
81                 ret_hu_conv.ptrs_to.add(this);
82                 return ret_hu_conv;
83         }
84
85         /**
86          * Whether to use anchors for this channel
87          */
88         public boolean opt_anchors() {
89                 boolean ret = bindings.DirectedChannelTransactionParameters_opt_anchors(this.ptr);
90                 Reference.reachabilityFence(this);
91                 return ret;
92         }
93
94 }