3a9d901671094b34bd2aba6154c1ae0baf56d6d9
[ldk-java] / ts / structs / ChannelTransactionParameters.ts
1
2             
3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
5
6
7
8             export default class ChannelTransactionParameters extends CommonBase {
9                 constructor(_dummy: object, ptr: number) {
10                     super(ptr);
11                 }
12
13                 
14                 protected finalize() {
15                     super.finalize();
16
17                     if (this.ptr != 0) {
18                         bindings.ChannelTransactionParameters_free(this.ptr);
19                     }
20                 }
21         public ChannelTransactionParameters clone() {
22                 number ret = bindings.ChannelTransactionParameters_clone(this.ptr);
23                 const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret);
24                 ret_hu_conv.ptrs_to.add(this);
25                 return ret_hu_conv;
26         }
27
28         public ChannelPublicKeys get_holder_pubkeys() {
29                 number ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr);
30                 const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret);
31                 ret_hu_conv.ptrs_to.add(this);
32                 return ret_hu_conv;
33         }
34
35         public void set_holder_pubkeys(ChannelPublicKeys val) {
36                 bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val == null ? 0 : val.ptr & ~1);
37                 this.ptrs_to.add(val);
38         }
39
40         public number get_holder_selected_contest_delay() {
41                 number ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr);
42                 return ret;
43         }
44
45         public void set_holder_selected_contest_delay(number val) {
46                 bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val);
47         }
48
49         public boolean get_is_outbound_from_holder() {
50                 boolean ret = bindings.ChannelTransactionParameters_get_is_outbound_from_holder(this.ptr);
51                 return ret;
52         }
53
54         public void set_is_outbound_from_holder(boolean val) {
55                 bindings.ChannelTransactionParameters_set_is_outbound_from_holder(this.ptr, val);
56         }
57
58         public CounterpartyChannelTransactionParameters get_counterparty_parameters() {
59                 number ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr);
60                 const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret);
61                 ret_hu_conv.ptrs_to.add(this);
62                 return ret_hu_conv;
63         }
64
65         public void set_counterparty_parameters(CounterpartyChannelTransactionParameters val) {
66                 bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : val.ptr & ~1);
67                 this.ptrs_to.add(val);
68         }
69
70         public OutPoint get_funding_outpoint() {
71                 number ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr);
72                 const ret_hu_conv: OutPoint = new OutPoint(null, ret);
73                 ret_hu_conv.ptrs_to.add(this);
74                 return ret_hu_conv;
75         }
76
77         public void set_funding_outpoint(OutPoint val) {
78                 bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
79                 this.ptrs_to.add(val);
80         }
81
82         public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, number holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) {
83                 number 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);
84                 const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret);
85                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
86                 ret_hu_conv.ptrs_to.add(holder_pubkeys_arg);
87                 ret_hu_conv.ptrs_to.add(counterparty_parameters_arg);
88                 ret_hu_conv.ptrs_to.add(funding_outpoint_arg);
89                 return ret_hu_conv;
90         }
91
92         public boolean is_populated() {
93                 boolean ret = bindings.ChannelTransactionParameters_is_populated(this.ptr);
94                 return ret;
95         }
96
97         public DirectedChannelTransactionParameters as_holder_broadcastable() {
98                 number ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr);
99                 const ret_hu_conv: DirectedChannelTransactionParameters = new DirectedChannelTransactionParameters(null, ret);
100                 ret_hu_conv.ptrs_to.add(this);
101                 return ret_hu_conv;
102         }
103
104         public DirectedChannelTransactionParameters as_counterparty_broadcastable() {
105                 number ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr);
106                 const ret_hu_conv: DirectedChannelTransactionParameters = new DirectedChannelTransactionParameters(null, ret);
107                 ret_hu_conv.ptrs_to.add(this);
108                 return ret_hu_conv;
109         }
110
111         public Uint8Array write() {
112                 Uint8Array ret = bindings.ChannelTransactionParameters_write(this.ptr);
113                 return ret;
114         }
115
116         public static ChannelTransactionParameters constructor_read(Uint8Array ser) {
117                 number ret = bindings.ChannelTransactionParameters_read(ser);
118                 const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret);
119                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
120                 return ret_hu_conv;
121         }
122
123 }