Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / FundingCreated.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  * A funding_created message to be sent or received from a peer
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class FundingCreated extends CommonBase {
15         FundingCreated(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.FundingCreated_free(ptr); }
20         }
21
22         /**
23          * A temporary channel ID, until the funding is established
24          */
25         public byte[] get_temporary_channel_id() {
26                 byte[] ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr);
27                 return ret;
28         }
29
30         /**
31          * A temporary channel ID, until the funding is established
32          */
33         public void set_temporary_channel_id(byte[] val) {
34                 bindings.FundingCreated_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
35         }
36
37         /**
38          * The funding transaction ID
39          */
40         public byte[] get_funding_txid() {
41                 byte[] ret = bindings.FundingCreated_get_funding_txid(this.ptr);
42                 return ret;
43         }
44
45         /**
46          * The funding transaction ID
47          */
48         public void set_funding_txid(byte[] val) {
49                 bindings.FundingCreated_set_funding_txid(this.ptr, InternalUtils.check_arr_len(val, 32));
50         }
51
52         /**
53          * The specific output index funding this channel
54          */
55         public short get_funding_output_index() {
56                 short ret = bindings.FundingCreated_get_funding_output_index(this.ptr);
57                 return ret;
58         }
59
60         /**
61          * The specific output index funding this channel
62          */
63         public void set_funding_output_index(short val) {
64                 bindings.FundingCreated_set_funding_output_index(this.ptr, val);
65         }
66
67         /**
68          * The signature of the channel initiator (funder) on the initial commitment transaction
69          */
70         public byte[] get_signature() {
71                 byte[] ret = bindings.FundingCreated_get_signature(this.ptr);
72                 return ret;
73         }
74
75         /**
76          * The signature of the channel initiator (funder) on the initial commitment transaction
77          */
78         public void set_signature(byte[] val) {
79                 bindings.FundingCreated_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
80         }
81
82         /**
83          * Constructs a new FundingCreated given each field
84          */
85         public static FundingCreated of(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) {
86                 long ret = bindings.FundingCreated_new(InternalUtils.check_arr_len(temporary_channel_id_arg, 32), InternalUtils.check_arr_len(funding_txid_arg, 32), funding_output_index_arg, InternalUtils.check_arr_len(signature_arg, 64));
87                 if (ret >= 0 && ret <= 4096) { return null; }
88                 FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingCreated(null, ret); }
89                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
90                 return ret_hu_conv;
91         }
92
93         long clone_ptr() {
94                 long ret = bindings.FundingCreated_clone_ptr(this.ptr);
95                 return ret;
96         }
97
98         /**
99          * Creates a copy of the FundingCreated
100          */
101         public FundingCreated clone() {
102                 long ret = bindings.FundingCreated_clone(this.ptr);
103                 if (ret >= 0 && ret <= 4096) { return null; }
104                 FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingCreated(null, ret); }
105                 ret_hu_conv.ptrs_to.add(this);
106                 return ret_hu_conv;
107         }
108
109         /**
110          * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
111          */
112         public byte[] write() {
113                 byte[] ret = bindings.FundingCreated_write(this.ptr);
114                 return ret;
115         }
116
117         /**
118          * Read a FundingCreated from a byte array, created by FundingCreated_write
119          */
120         public static Result_FundingCreatedDecodeErrorZ read(byte[] ser) {
121                 long ret = bindings.FundingCreated_read(ser);
122                 if (ret >= 0 && ret <= 4096) { return null; }
123                 Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
124                 return ret_hu_conv;
125         }
126
127 }