45cf099abb6c445e9290b4bc70bc32d28e08ed1f
[ldk-java] / ts / structs / ChannelTransactionParameters.ts
1
2 import CommonBase from './CommonBase';
3 import * as bindings from '../bindings' // TODO: figure out location
4
5 public class ChannelTransactionParameters extends CommonBase {
6         ChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); }
7         @Override @SuppressWarnings("deprecation")
8         protected void finalize() throws Throwable {
9                 super.finalize();
10                 if (ptr != 0) { bindings.ChannelTransactionParameters_free(ptr); }
11         }
12
13         public ChannelTransactionParameters clone() {
14                 uint32_t ret = bindings.ChannelTransactionParameters_clone(this.ptr);
15                 ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
16                 return ret_hu_conv;
17         }
18
19         public ChannelPublicKeys get_holder_pubkeys() {
20                 uint32_t ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr);
21                 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
22                 return ret_hu_conv;
23         }
24
25         public void set_holder_pubkeys(ChannelPublicKeys val) {
26                 bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val == null ? 0 : val.ptr & ~1);
27                 this.ptrs_to.add(val);
28         }
29
30         public short get_holder_selected_contest_delay() {
31                 short ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr);
32                 return ret;
33         }
34
35         public void set_holder_selected_contest_delay(short val) {
36                 bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val);
37         }
38
39         public boolean get_is_outbound_from_holder() {
40                 boolean ret = bindings.ChannelTransactionParameters_get_is_outbound_from_holder(this.ptr);
41                 return ret;
42         }
43
44         public void set_is_outbound_from_holder(boolean val) {
45                 bindings.ChannelTransactionParameters_set_is_outbound_from_holder(this.ptr, val);
46         }
47
48         public CounterpartyChannelTransactionParameters get_counterparty_parameters() {
49                 uint32_t ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr);
50                 CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret);
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                 uint32_t ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr);
61                 OutPoint ret_hu_conv = new OutPoint(null, ret);
62                 return ret_hu_conv;
63         }
64
65         public void set_funding_outpoint(OutPoint val) {
66                 bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
67                 this.ptrs_to.add(val);
68         }
69
70         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) {
71                 uint32_t 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);
72                 ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
73                 ret_hu_conv.ptrs_to.add(holder_pubkeys_arg);
74                 ret_hu_conv.ptrs_to.add(counterparty_parameters_arg);
75                 ret_hu_conv.ptrs_to.add(funding_outpoint_arg);
76                 return ret_hu_conv;
77         }
78
79         public boolean is_populated() {
80                 boolean ret = bindings.ChannelTransactionParameters_is_populated(this.ptr);
81                 return ret;
82         }
83
84         public DirectedChannelTransactionParameters as_holder_broadcastable() {
85                 uint32_t ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr);
86                 DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret);
87                 return ret_hu_conv;
88         }
89
90         public DirectedChannelTransactionParameters as_counterparty_broadcastable() {
91                 uint32_t ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr);
92                 DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret);
93                 return ret_hu_conv;
94         }
95
96         public byte[] write() {
97                 byte[] ret = bindings.ChannelTransactionParameters_write(this.ptr);
98                 return ret;
99         }
100
101         public static ChannelTransactionParameters constructor_read(byte[] ser) {
102                 uint32_t ret = bindings.ChannelTransactionParameters_read(ser);
103                 ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
104                 return ret_hu_conv;
105         }
106
107 }