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_signed message to be sent or received from a peer
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class FundingSigned extends CommonBase {
15 FundingSigned(Object _dummy, long ptr) { super(ptr); }
16 @Override @SuppressWarnings("deprecation")
17 protected void finalize() throws Throwable {
19 if (ptr != 0) { bindings.FundingSigned_free(ptr); }
25 public byte[] get_channel_id() {
26 byte[] ret = bindings.FundingSigned_get_channel_id(this.ptr);
33 public void set_channel_id(byte[] val) {
34 bindings.FundingSigned_set_channel_id(this.ptr, val);
38 * The signature of the channel acceptor (fundee) on the initial commitment transaction
40 public byte[] get_signature() {
41 byte[] ret = bindings.FundingSigned_get_signature(this.ptr);
46 * The signature of the channel acceptor (fundee) on the initial commitment transaction
48 public void set_signature(byte[] val) {
49 bindings.FundingSigned_set_signature(this.ptr, val);
53 * Constructs a new FundingSigned given each field
55 public static FundingSigned of(byte[] channel_id_arg, byte[] signature_arg) {
56 long ret = bindings.FundingSigned_new(channel_id_arg, signature_arg);
57 if (ret < 1024) { return null; }
58 FundingSigned ret_hu_conv = new FundingSigned(null, ret);
59 ret_hu_conv.ptrs_to.add(ret_hu_conv);
64 * Creates a copy of the FundingSigned
66 public FundingSigned clone() {
67 long ret = bindings.FundingSigned_clone(this.ptr);
68 if (ret < 1024) { return null; }
69 FundingSigned ret_hu_conv = new FundingSigned(null, ret);
70 ret_hu_conv.ptrs_to.add(this);
75 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
77 public byte[] write() {
78 byte[] ret = bindings.FundingSigned_write(this.ptr);
83 * Read a FundingSigned from a byte array, created by FundingSigned_write
85 public static Result_FundingSignedDecodeErrorZ read(byte[] ser) {
86 long ret = bindings.FundingSigned_read(ser);
87 if (ret < 1024) { return null; }
88 Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);