a64af1735bba87cdeb038d5612cf647bb3130c93
[ldk-java] / src / main / java / org / ldk / structs / ChannelTransactionParameters.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
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class ChannelTransactionParameters extends CommonBase {
10         ChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); }
11         @Override @SuppressWarnings("deprecation")
12         protected void finalize() throws Throwable {
13                 super.finalize();
14                 if (ptr != 0) { bindings.ChannelTransactionParameters_free(ptr); }
15         }
16
17         public ChannelPublicKeys get_holder_pubkeys() {
18                 long ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr);
19                 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
20                 ret_hu_conv.ptrs_to.add(this);
21                 return ret_hu_conv;
22         }
23
24         public void set_holder_pubkeys(ChannelPublicKeys val) {
25                 bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val == null ? 0 : val.ptr & ~1);
26                 this.ptrs_to.add(val);
27         }
28
29         public short get_holder_selected_contest_delay() {
30                 short ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr);
31                 return ret;
32         }
33
34         public void set_holder_selected_contest_delay(short val) {
35                 bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val);
36         }
37
38         public boolean get_is_outbound_from_holder() {
39                 boolean ret = bindings.ChannelTransactionParameters_get_is_outbound_from_holder(this.ptr);
40                 return ret;
41         }
42
43         public void set_is_outbound_from_holder(boolean val) {
44                 bindings.ChannelTransactionParameters_set_is_outbound_from_holder(this.ptr, val);
45         }
46
47         public CounterpartyChannelTransactionParameters get_counterparty_parameters() {
48                 long ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr);
49                 CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret);
50                 ret_hu_conv.ptrs_to.add(this);
51                 return ret_hu_conv;
52         }
53
54         public void set_counterparty_parameters(CounterpartyChannelTransactionParameters val) {
55                 bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : val.ptr & ~1);
56                 this.ptrs_to.add(val);
57         }
58
59         public OutPoint get_funding_outpoint() {
60                 long ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr);
61                 OutPoint ret_hu_conv = new OutPoint(null, ret);
62                 ret_hu_conv.ptrs_to.add(this);
63                 return ret_hu_conv;
64         }
65
66         public void set_funding_outpoint(OutPoint val) {
67                 bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
68                 this.ptrs_to.add(val);
69         }
70
71         public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) {
72                 long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1);
73                 ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
74                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
75                 ret_hu_conv.ptrs_to.add(holder_pubkeys_arg);
76                 ret_hu_conv.ptrs_to.add(counterparty_parameters_arg);
77                 ret_hu_conv.ptrs_to.add(funding_outpoint_arg);
78                 return ret_hu_conv;
79         }
80
81         public ChannelTransactionParameters clone() {
82                 long ret = bindings.ChannelTransactionParameters_clone(this.ptr);
83                 ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
84                 ret_hu_conv.ptrs_to.add(this);
85                 return ret_hu_conv;
86         }
87
88         public boolean is_populated() {
89                 boolean ret = bindings.ChannelTransactionParameters_is_populated(this.ptr);
90                 return ret;
91         }
92
93         public DirectedChannelTransactionParameters as_holder_broadcastable() {
94                 long ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr);
95                 DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret);
96                 ret_hu_conv.ptrs_to.add(this);
97                 return ret_hu_conv;
98         }
99
100         public DirectedChannelTransactionParameters as_counterparty_broadcastable() {
101                 long ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr);
102                 DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret);
103                 ret_hu_conv.ptrs_to.add(this);
104                 return ret_hu_conv;
105         }
106
107         public byte[] write() {
108                 byte[] ret = bindings.ChannelTransactionParameters_write(this.ptr);
109                 return ret;
110         }
111
112         public static Result_ChannelTransactionParametersDecodeErrorZ constructor_read(byte[] ser) {
113                 long ret = bindings.ChannelTransactionParameters_read(ser);
114                 Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
115                 return ret_hu_conv;
116         }
117
118 }