Update auto-generated bindings to 0.0.103
[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, val);
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, val);
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, val);
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(temporary_channel_id_arg, funding_txid_arg, funding_output_index_arg, signature_arg);
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         /**
94          * Creates a copy of the FundingCreated
95          */
96         public FundingCreated clone() {
97                 long ret = bindings.FundingCreated_clone(this.ptr);
98                 if (ret >= 0 && ret <= 4096) { return null; }
99                 FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingCreated(null, ret); }
100                 ret_hu_conv.ptrs_to.add(this);
101                 return ret_hu_conv;
102         }
103
104         /**
105          * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
106          */
107         public byte[] write() {
108                 byte[] ret = bindings.FundingCreated_write(this.ptr);
109                 return ret;
110         }
111
112         /**
113          * Read a FundingCreated from a byte array, created by FundingCreated_write
114          */
115         public static Result_FundingCreatedDecodeErrorZ read(byte[] ser) {
116                 long ret = bindings.FundingCreated_read(ser);
117                 if (ret >= 0 && ret <= 4096) { return null; }
118                 Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
119                 return ret_hu_conv;
120         }
121
122 }