1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
11 * A funding_created message to be sent or received from a peer
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 {
19 if (ptr != 0) { bindings.FundingCreated_free(ptr); }
23 * A temporary channel ID, until the funding is established
25 public byte[] get_temporary_channel_id() {
26 byte[] ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr);
31 * A temporary channel ID, until the funding is established
33 public void set_temporary_channel_id(byte[] val) {
34 bindings.FundingCreated_set_temporary_channel_id(this.ptr, val);
38 * The funding transaction ID
40 public byte[] get_funding_txid() {
41 byte[] ret = bindings.FundingCreated_get_funding_txid(this.ptr);
46 * The funding transaction ID
48 public void set_funding_txid(byte[] val) {
49 bindings.FundingCreated_set_funding_txid(this.ptr, val);
53 * The specific output index funding this channel
55 public short get_funding_output_index() {
56 short ret = bindings.FundingCreated_get_funding_output_index(this.ptr);
61 * The specific output index funding this channel
63 public void set_funding_output_index(short val) {
64 bindings.FundingCreated_set_funding_output_index(this.ptr, val);
68 * The signature of the channel initiator (funder) on the initial commitment transaction
70 public byte[] get_signature() {
71 byte[] ret = bindings.FundingCreated_get_signature(this.ptr);
76 * The signature of the channel initiator (funder) on the initial commitment transaction
78 public void set_signature(byte[] val) {
79 bindings.FundingCreated_set_signature(this.ptr, val);
83 * Constructs a new FundingCreated given each field
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 < 1024) { return null; }
88 FundingCreated ret_hu_conv = new FundingCreated(null, ret);
89 ret_hu_conv.ptrs_to.add(ret_hu_conv);
94 * Creates a copy of the FundingCreated
96 public FundingCreated clone() {
97 long ret = bindings.FundingCreated_clone(this.ptr);
98 if (ret < 1024) { return null; }
99 FundingCreated ret_hu_conv = new FundingCreated(null, ret);
100 ret_hu_conv.ptrs_to.add(this);
105 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
107 public byte[] write() {
108 byte[] ret = bindings.FundingCreated_write(this.ptr);
113 * Read a FundingCreated from a byte array, created by FundingCreated_write
115 public static Result_FundingCreatedDecodeErrorZ read(byte[] ser) {
116 long ret = bindings.FundingCreated_read(ser);
117 if (ret < 1024) { return null; }
118 Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);