Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / ChannelAnnouncement.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  * A channel_announcement message to be sent or received from a peer
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class ChannelAnnouncement extends CommonBase {
14         ChannelAnnouncement(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.ChannelAnnouncement_free(ptr); }
19         }
20
21         /**
22          * Authentication of the announcement by the first public node
23          */
24         public byte[] get_node_signature_1() {
25                 byte[] ret = bindings.ChannelAnnouncement_get_node_signature_1(this.ptr);
26                 return ret;
27         }
28
29         /**
30          * Authentication of the announcement by the first public node
31          */
32         public void set_node_signature_1(byte[] val) {
33                 bindings.ChannelAnnouncement_set_node_signature_1(this.ptr, val);
34         }
35
36         /**
37          * Authentication of the announcement by the second public node
38          */
39         public byte[] get_node_signature_2() {
40                 byte[] ret = bindings.ChannelAnnouncement_get_node_signature_2(this.ptr);
41                 return ret;
42         }
43
44         /**
45          * Authentication of the announcement by the second public node
46          */
47         public void set_node_signature_2(byte[] val) {
48                 bindings.ChannelAnnouncement_set_node_signature_2(this.ptr, val);
49         }
50
51         /**
52          * Proof of funding UTXO ownership by the first public node
53          */
54         public byte[] get_bitcoin_signature_1() {
55                 byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_1(this.ptr);
56                 return ret;
57         }
58
59         /**
60          * Proof of funding UTXO ownership by the first public node
61          */
62         public void set_bitcoin_signature_1(byte[] val) {
63                 bindings.ChannelAnnouncement_set_bitcoin_signature_1(this.ptr, val);
64         }
65
66         /**
67          * Proof of funding UTXO ownership by the second public node
68          */
69         public byte[] get_bitcoin_signature_2() {
70                 byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_2(this.ptr);
71                 return ret;
72         }
73
74         /**
75          * Proof of funding UTXO ownership by the second public node
76          */
77         public void set_bitcoin_signature_2(byte[] val) {
78                 bindings.ChannelAnnouncement_set_bitcoin_signature_2(this.ptr, val);
79         }
80
81         /**
82          * The actual announcement
83          */
84         public UnsignedChannelAnnouncement get_contents() {
85                 long ret = bindings.ChannelAnnouncement_get_contents(this.ptr);
86                 UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret);
87                 ret_hu_conv.ptrs_to.add(this);
88                 return ret_hu_conv;
89         }
90
91         /**
92          * The actual announcement
93          */
94         public void set_contents(UnsignedChannelAnnouncement val) {
95                 bindings.ChannelAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1);
96                 this.ptrs_to.add(val);
97         }
98
99         /**
100          * Constructs a new ChannelAnnouncement given each field
101          */
102         public static ChannelAnnouncement of(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) {
103                 long ret = bindings.ChannelAnnouncement_new(node_signature_1_arg, node_signature_2_arg, bitcoin_signature_1_arg, bitcoin_signature_2_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
104                 ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret);
105                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
106                 ret_hu_conv.ptrs_to.add(contents_arg);
107                 return ret_hu_conv;
108         }
109
110         /**
111          * Creates a copy of the ChannelAnnouncement
112          */
113         public ChannelAnnouncement clone() {
114                 long ret = bindings.ChannelAnnouncement_clone(this.ptr);
115                 ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret);
116                 ret_hu_conv.ptrs_to.add(this);
117                 return ret_hu_conv;
118         }
119
120         /**
121          * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
122          */
123         public byte[] write() {
124                 byte[] ret = bindings.ChannelAnnouncement_write(this.ptr);
125                 return ret;
126         }
127
128         /**
129          * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
130          */
131         public static Result_ChannelAnnouncementDecodeErrorZ read(byte[] ser) {
132                 long ret = bindings.ChannelAnnouncement_read(ser);
133                 Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
134                 return ret_hu_conv;
135         }
136
137 }