Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / ChannelDetails.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  * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class ChannelDetails extends CommonBase {
14         ChannelDetails(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.ChannelDetails_free(ptr); }
19         }
20
21         /**
22          * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
23          * thereafter this is the txid of the funding transaction xor the funding transaction output).
24          * Note that this means this value is *not* persistent - it can change once during the
25          * lifetime of the channel.
26          */
27         public byte[] get_channel_id() {
28                 byte[] ret = bindings.ChannelDetails_get_channel_id(this.ptr);
29                 return ret;
30         }
31
32         /**
33          * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
34          * thereafter this is the txid of the funding transaction xor the funding transaction output).
35          * Note that this means this value is *not* persistent - it can change once during the
36          * lifetime of the channel.
37          */
38         public void set_channel_id(byte[] val) {
39                 bindings.ChannelDetails_set_channel_id(this.ptr, val);
40         }
41
42         /**
43          * The position of the funding transaction in the chain. None if the funding transaction has
44          * not yet been confirmed and the channel fully opened.
45          */
46         public Option_u64Z get_short_channel_id() {
47                 long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
48                 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
49                 ret_hu_conv.ptrs_to.add(this);
50                 return ret_hu_conv;
51         }
52
53         /**
54          * The position of the funding transaction in the chain. None if the funding transaction has
55          * not yet been confirmed and the channel fully opened.
56          */
57         public void set_short_channel_id(Option_u64Z val) {
58                 bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
59         }
60
61         /**
62          * The node_id of our counterparty
63          */
64         public byte[] get_remote_network_id() {
65                 byte[] ret = bindings.ChannelDetails_get_remote_network_id(this.ptr);
66                 return ret;
67         }
68
69         /**
70          * The node_id of our counterparty
71          */
72         public void set_remote_network_id(byte[] val) {
73                 bindings.ChannelDetails_set_remote_network_id(this.ptr, val);
74         }
75
76         /**
77          * The Features the channel counterparty provided upon last connection.
78          * Useful for routing as it is the most up-to-date copy of the counterparty's features and
79          * many routing-relevant features are present in the init context.
80          */
81         public InitFeatures get_counterparty_features() {
82                 long ret = bindings.ChannelDetails_get_counterparty_features(this.ptr);
83                 InitFeatures ret_hu_conv = new InitFeatures(null, ret);
84                 ret_hu_conv.ptrs_to.add(this);
85                 return ret_hu_conv;
86         }
87
88         /**
89          * The Features the channel counterparty provided upon last connection.
90          * Useful for routing as it is the most up-to-date copy of the counterparty's features and
91          * many routing-relevant features are present in the init context.
92          */
93         public void set_counterparty_features(InitFeatures val) {
94                 bindings.ChannelDetails_set_counterparty_features(this.ptr, val == null ? 0 : val.ptr & ~1);
95                 this.ptrs_to.add(val);
96         }
97
98         /**
99          * The value, in satoshis, of this channel as appears in the funding output
100          */
101         public long get_channel_value_satoshis() {
102                 long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
103                 return ret;
104         }
105
106         /**
107          * The value, in satoshis, of this channel as appears in the funding output
108          */
109         public void set_channel_value_satoshis(long val) {
110                 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
111         }
112
113         /**
114          * The user_id passed in to create_channel, or 0 if the channel was inbound.
115          */
116         public long get_user_id() {
117                 long ret = bindings.ChannelDetails_get_user_id(this.ptr);
118                 return ret;
119         }
120
121         /**
122          * The user_id passed in to create_channel, or 0 if the channel was inbound.
123          */
124         public void set_user_id(long val) {
125                 bindings.ChannelDetails_set_user_id(this.ptr, val);
126         }
127
128         /**
129          * The available outbound capacity for sending HTLCs to the remote peer. This does not include
130          * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
131          * available for inclusion in new outbound HTLCs). This further does not include any pending
132          * outgoing HTLCs which are awaiting some other resolution to be sent.
133          */
134         public long get_outbound_capacity_msat() {
135                 long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
136                 return ret;
137         }
138
139         /**
140          * The available outbound capacity for sending HTLCs to the remote peer. This does not include
141          * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
142          * available for inclusion in new outbound HTLCs). This further does not include any pending
143          * outgoing HTLCs which are awaiting some other resolution to be sent.
144          */
145         public void set_outbound_capacity_msat(long val) {
146                 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
147         }
148
149         /**
150          * The available inbound capacity for the remote peer to send HTLCs to us. This does not
151          * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
152          * available for inclusion in new inbound HTLCs).
153          * Note that there are some corner cases not fully handled here, so the actual available
154          * inbound capacity may be slightly higher than this.
155          */
156         public long get_inbound_capacity_msat() {
157                 long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
158                 return ret;
159         }
160
161         /**
162          * The available inbound capacity for the remote peer to send HTLCs to us. This does not
163          * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
164          * available for inclusion in new inbound HTLCs).
165          * Note that there are some corner cases not fully handled here, so the actual available
166          * inbound capacity may be slightly higher than this.
167          */
168         public void set_inbound_capacity_msat(long val) {
169                 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
170         }
171
172         /**
173          * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
174          * the peer is connected, and (c) no monitor update failure is pending resolution.
175          */
176         public boolean get_is_live() {
177                 boolean ret = bindings.ChannelDetails_get_is_live(this.ptr);
178                 return ret;
179         }
180
181         /**
182          * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
183          * the peer is connected, and (c) no monitor update failure is pending resolution.
184          */
185         public void set_is_live(boolean val) {
186                 bindings.ChannelDetails_set_is_live(this.ptr, val);
187         }
188
189         /**
190          * Creates a copy of the ChannelDetails
191          */
192         public ChannelDetails clone() {
193                 long ret = bindings.ChannelDetails_clone(this.ptr);
194                 ChannelDetails ret_hu_conv = new ChannelDetails(null, ret);
195                 ret_hu_conv.ptrs_to.add(this);
196                 return ret_hu_conv;
197         }
198
199 }