1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * A funding_created message to be sent or received from a peer
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class FundingCreated extends CommonBase {
14 FundingCreated(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.FundingCreated_free(ptr); }
22 * A temporary channel ID, until the funding is established
24 public byte[] get_temporary_channel_id() {
25 byte[] ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr);
30 * A temporary channel ID, until the funding is established
32 public void set_temporary_channel_id(byte[] val) {
33 bindings.FundingCreated_set_temporary_channel_id(this.ptr, val);
37 * The funding transaction ID
39 public byte[] get_funding_txid() {
40 byte[] ret = bindings.FundingCreated_get_funding_txid(this.ptr);
45 * The funding transaction ID
47 public void set_funding_txid(byte[] val) {
48 bindings.FundingCreated_set_funding_txid(this.ptr, val);
52 * The specific output index funding this channel
54 public short get_funding_output_index() {
55 short ret = bindings.FundingCreated_get_funding_output_index(this.ptr);
60 * The specific output index funding this channel
62 public void set_funding_output_index(short val) {
63 bindings.FundingCreated_set_funding_output_index(this.ptr, val);
67 * The signature of the channel initiator (funder) on the funding transaction
69 public byte[] get_signature() {
70 byte[] ret = bindings.FundingCreated_get_signature(this.ptr);
75 * The signature of the channel initiator (funder) on the funding transaction
77 public void set_signature(byte[] val) {
78 bindings.FundingCreated_set_signature(this.ptr, val);
82 * Constructs a new FundingCreated given each field
84 public static FundingCreated of(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) {
85 long ret = bindings.FundingCreated_new(temporary_channel_id_arg, funding_txid_arg, funding_output_index_arg, signature_arg);
86 FundingCreated ret_hu_conv = new FundingCreated(null, ret);
87 ret_hu_conv.ptrs_to.add(ret_hu_conv);
92 * Creates a copy of the FundingCreated
94 public FundingCreated clone() {
95 long ret = bindings.FundingCreated_clone(this.ptr);
96 FundingCreated ret_hu_conv = new FundingCreated(null, ret);
97 ret_hu_conv.ptrs_to.add(this);
102 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
104 public byte[] write() {
105 byte[] ret = bindings.FundingCreated_write(this.ptr);
110 * Read a FundingCreated from a byte array, created by FundingCreated_write
112 public static Result_FundingCreatedDecodeErrorZ read(byte[] ser) {
113 long ret = bindings.FundingCreated_read(ser);
114 Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);