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