]> git.bitcoin.ninja Git - ldk-java/blob - src/main/java/org/ldk/structs/OpenChannel.java
ce1dd35be1603be7b60e4974819390a9367f3875
[ldk-java] / src / main / java / org / ldk / structs / OpenChannel.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
9 /**
10  * An open_channel message to be sent or received from a peer
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class OpenChannel extends CommonBase {
14         OpenChannel(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.OpenChannel_free(ptr); }
19         }
20
21         /**
22          * The genesis hash of the blockchain where the channel is to be opened
23          */
24         public byte[] get_chain_hash() {
25                 byte[] ret = bindings.OpenChannel_get_chain_hash(this.ptr);
26                 return ret;
27         }
28
29         /**
30          * The genesis hash of the blockchain where the channel is to be opened
31          */
32         public void set_chain_hash(byte[] val) {
33                 bindings.OpenChannel_set_chain_hash(this.ptr, val);
34         }
35
36         /**
37          * A temporary channel ID, until the funding outpoint is announced
38          */
39         public byte[] get_temporary_channel_id() {
40                 byte[] ret = bindings.OpenChannel_get_temporary_channel_id(this.ptr);
41                 return ret;
42         }
43
44         /**
45          * A temporary channel ID, until the funding outpoint is announced
46          */
47         public void set_temporary_channel_id(byte[] val) {
48                 bindings.OpenChannel_set_temporary_channel_id(this.ptr, val);
49         }
50
51         /**
52          * The channel value
53          */
54         public long get_funding_satoshis() {
55                 long ret = bindings.OpenChannel_get_funding_satoshis(this.ptr);
56                 return ret;
57         }
58
59         /**
60          * The channel value
61          */
62         public void set_funding_satoshis(long val) {
63                 bindings.OpenChannel_set_funding_satoshis(this.ptr, val);
64         }
65
66         /**
67          * The amount to push to the counterparty as part of the open, in milli-satoshi
68          */
69         public long get_push_msat() {
70                 long ret = bindings.OpenChannel_get_push_msat(this.ptr);
71                 return ret;
72         }
73
74         /**
75          * The amount to push to the counterparty as part of the open, in milli-satoshi
76          */
77         public void set_push_msat(long val) {
78                 bindings.OpenChannel_set_push_msat(this.ptr, val);
79         }
80
81         /**
82          * The threshold below which outputs on transactions broadcast by sender will be omitted
83          */
84         public long get_dust_limit_satoshis() {
85                 long ret = bindings.OpenChannel_get_dust_limit_satoshis(this.ptr);
86                 return ret;
87         }
88
89         /**
90          * The threshold below which outputs on transactions broadcast by sender will be omitted
91          */
92         public void set_dust_limit_satoshis(long val) {
93                 bindings.OpenChannel_set_dust_limit_satoshis(this.ptr, val);
94         }
95
96         /**
97          * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
98          */
99         public long get_max_htlc_value_in_flight_msat() {
100                 long ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this.ptr);
101                 return ret;
102         }
103
104         /**
105          * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
106          */
107         public void set_max_htlc_value_in_flight_msat(long val) {
108                 bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this.ptr, val);
109         }
110
111         /**
112          * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
113          */
114         public long get_channel_reserve_satoshis() {
115                 long ret = bindings.OpenChannel_get_channel_reserve_satoshis(this.ptr);
116                 return ret;
117         }
118
119         /**
120          * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
121          */
122         public void set_channel_reserve_satoshis(long val) {
123                 bindings.OpenChannel_set_channel_reserve_satoshis(this.ptr, val);
124         }
125
126         /**
127          * The minimum HTLC size incoming to sender, in milli-satoshi
128          */
129         public long get_htlc_minimum_msat() {
130                 long ret = bindings.OpenChannel_get_htlc_minimum_msat(this.ptr);
131                 return ret;
132         }
133
134         /**
135          * The minimum HTLC size incoming to sender, in milli-satoshi
136          */
137         public void set_htlc_minimum_msat(long val) {
138                 bindings.OpenChannel_set_htlc_minimum_msat(this.ptr, val);
139         }
140
141         /**
142          * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
143          */
144         public int get_feerate_per_kw() {
145                 int ret = bindings.OpenChannel_get_feerate_per_kw(this.ptr);
146                 return ret;
147         }
148
149         /**
150          * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
151          */
152         public void set_feerate_per_kw(int val) {
153                 bindings.OpenChannel_set_feerate_per_kw(this.ptr, val);
154         }
155
156         /**
157          * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
158          */
159         public short get_to_self_delay() {
160                 short ret = bindings.OpenChannel_get_to_self_delay(this.ptr);
161                 return ret;
162         }
163
164         /**
165          * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
166          */
167         public void set_to_self_delay(short val) {
168                 bindings.OpenChannel_set_to_self_delay(this.ptr, val);
169         }
170
171         /**
172          * The maximum number of inbound HTLCs towards sender
173          */
174         public short get_max_accepted_htlcs() {
175                 short ret = bindings.OpenChannel_get_max_accepted_htlcs(this.ptr);
176                 return ret;
177         }
178
179         /**
180          * The maximum number of inbound HTLCs towards sender
181          */
182         public void set_max_accepted_htlcs(short val) {
183                 bindings.OpenChannel_set_max_accepted_htlcs(this.ptr, val);
184         }
185
186         /**
187          * The sender's key controlling the funding transaction
188          */
189         public byte[] get_funding_pubkey() {
190                 byte[] ret = bindings.OpenChannel_get_funding_pubkey(this.ptr);
191                 return ret;
192         }
193
194         /**
195          * The sender's key controlling the funding transaction
196          */
197         public void set_funding_pubkey(byte[] val) {
198                 bindings.OpenChannel_set_funding_pubkey(this.ptr, val);
199         }
200
201         /**
202          * Used to derive a revocation key for transactions broadcast by counterparty
203          */
204         public byte[] get_revocation_basepoint() {
205                 byte[] ret = bindings.OpenChannel_get_revocation_basepoint(this.ptr);
206                 return ret;
207         }
208
209         /**
210          * Used to derive a revocation key for transactions broadcast by counterparty
211          */
212         public void set_revocation_basepoint(byte[] val) {
213                 bindings.OpenChannel_set_revocation_basepoint(this.ptr, val);
214         }
215
216         /**
217          * A payment key to sender for transactions broadcast by counterparty
218          */
219         public byte[] get_payment_point() {
220                 byte[] ret = bindings.OpenChannel_get_payment_point(this.ptr);
221                 return ret;
222         }
223
224         /**
225          * A payment key to sender for transactions broadcast by counterparty
226          */
227         public void set_payment_point(byte[] val) {
228                 bindings.OpenChannel_set_payment_point(this.ptr, val);
229         }
230
231         /**
232          * Used to derive a payment key to sender for transactions broadcast by sender
233          */
234         public byte[] get_delayed_payment_basepoint() {
235                 byte[] ret = bindings.OpenChannel_get_delayed_payment_basepoint(this.ptr);
236                 return ret;
237         }
238
239         /**
240          * Used to derive a payment key to sender for transactions broadcast by sender
241          */
242         public void set_delayed_payment_basepoint(byte[] val) {
243                 bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, val);
244         }
245
246         /**
247          * Used to derive an HTLC payment key to sender
248          */
249         public byte[] get_htlc_basepoint() {
250                 byte[] ret = bindings.OpenChannel_get_htlc_basepoint(this.ptr);
251                 return ret;
252         }
253
254         /**
255          * Used to derive an HTLC payment key to sender
256          */
257         public void set_htlc_basepoint(byte[] val) {
258                 bindings.OpenChannel_set_htlc_basepoint(this.ptr, val);
259         }
260
261         /**
262          * The first to-be-broadcast-by-sender transaction's per commitment point
263          */
264         public byte[] get_first_per_commitment_point() {
265                 byte[] ret = bindings.OpenChannel_get_first_per_commitment_point(this.ptr);
266                 return ret;
267         }
268
269         /**
270          * The first to-be-broadcast-by-sender transaction's per commitment point
271          */
272         public void set_first_per_commitment_point(byte[] val) {
273                 bindings.OpenChannel_set_first_per_commitment_point(this.ptr, val);
274         }
275
276         /**
277          * Channel flags
278          */
279         public byte get_channel_flags() {
280                 byte ret = bindings.OpenChannel_get_channel_flags(this.ptr);
281                 return ret;
282         }
283
284         /**
285          * Channel flags
286          */
287         public void set_channel_flags(byte val) {
288                 bindings.OpenChannel_set_channel_flags(this.ptr, val);
289         }
290
291         /**
292          * Creates a copy of the OpenChannel
293          */
294         public OpenChannel clone() {
295                 long ret = bindings.OpenChannel_clone(this.ptr);
296                 OpenChannel ret_hu_conv = new OpenChannel(null, ret);
297                 ret_hu_conv.ptrs_to.add(this);
298                 return ret_hu_conv;
299         }
300
301         /**
302          * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
303          */
304         public byte[] write() {
305                 byte[] ret = bindings.OpenChannel_write(this.ptr);
306                 return ret;
307         }
308
309         /**
310          * Read a OpenChannel from a byte array, created by OpenChannel_write
311          */
312         public static Result_OpenChannelDecodeErrorZ constructor_read(byte[] ser) {
313                 long ret = bindings.OpenChannel_read(ser);
314                 Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
315                 return ret_hu_conv;
316         }
317
318 }