Update auto-generated bindings to 0.0.103
[ldk-java] / src / main / java / org / ldk / structs / UnsignedChannelAnnouncement.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 import javax.annotation.Nullable;
8
9
10 /**
11  * The unsigned part of a channel_announcement
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class UnsignedChannelAnnouncement extends CommonBase {
15         UnsignedChannelAnnouncement(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.UnsignedChannelAnnouncement_free(ptr); }
20         }
21
22         /**
23          * The advertised channel features
24          */
25         public ChannelFeatures get_features() {
26                 long ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr);
27                 if (ret >= 0 && ret <= 4096) { return null; }
28                 ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); }
29                 ret_hu_conv.ptrs_to.add(this);
30                 return ret_hu_conv;
31         }
32
33         /**
34          * The advertised channel features
35          */
36         public void set_features(ChannelFeatures val) {
37                 bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
38         }
39
40         /**
41          * The genesis hash of the blockchain where the channel is to be opened
42          */
43         public byte[] get_chain_hash() {
44                 byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr);
45                 return ret;
46         }
47
48         /**
49          * The genesis hash of the blockchain where the channel is to be opened
50          */
51         public void set_chain_hash(byte[] val) {
52                 bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, val);
53         }
54
55         /**
56          * The short channel ID
57          */
58         public long get_short_channel_id() {
59                 long ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this.ptr);
60                 return ret;
61         }
62
63         /**
64          * The short channel ID
65          */
66         public void set_short_channel_id(long val) {
67                 bindings.UnsignedChannelAnnouncement_set_short_channel_id(this.ptr, val);
68         }
69
70         /**
71          * One of the two node_ids which are endpoints of this channel
72          */
73         public byte[] get_node_id_1() {
74                 byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr);
75                 return ret;
76         }
77
78         /**
79          * One of the two node_ids which are endpoints of this channel
80          */
81         public void set_node_id_1(byte[] val) {
82                 bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val);
83         }
84
85         /**
86          * The other of the two node_ids which are endpoints of this channel
87          */
88         public byte[] get_node_id_2() {
89                 byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr);
90                 return ret;
91         }
92
93         /**
94          * The other of the two node_ids which are endpoints of this channel
95          */
96         public void set_node_id_2(byte[] val) {
97                 bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val);
98         }
99
100         /**
101          * The funding key for the first node
102          */
103         public byte[] get_bitcoin_key_1() {
104                 byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr);
105                 return ret;
106         }
107
108         /**
109          * The funding key for the first node
110          */
111         public void set_bitcoin_key_1(byte[] val) {
112                 bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val);
113         }
114
115         /**
116          * The funding key for the second node
117          */
118         public byte[] get_bitcoin_key_2() {
119                 byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr);
120                 return ret;
121         }
122
123         /**
124          * The funding key for the second node
125          */
126         public void set_bitcoin_key_2(byte[] val) {
127                 bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val);
128         }
129
130         /**
131          * Creates a copy of the UnsignedChannelAnnouncement
132          */
133         public UnsignedChannelAnnouncement clone() {
134                 long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr);
135                 if (ret >= 0 && ret <= 4096) { return null; }
136                 UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); }
137                 ret_hu_conv.ptrs_to.add(this);
138                 return ret_hu_conv;
139         }
140
141         /**
142          * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
143          */
144         public byte[] write() {
145                 byte[] ret = bindings.UnsignedChannelAnnouncement_write(this.ptr);
146                 return ret;
147         }
148
149         /**
150          * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
151          */
152         public static Result_UnsignedChannelAnnouncementDecodeErrorZ read(byte[] ser) {
153                 long ret = bindings.UnsignedChannelAnnouncement_read(ser);
154                 if (ret >= 0 && ret <= 4096) { return null; }
155                 Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
156                 return ret_hu_conv;
157         }
158
159 }