1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * A commitment_signed message to be sent or received from a peer
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class CommitmentSigned extends CommonBase {
14 CommitmentSigned(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.CommitmentSigned_free(ptr); }
24 public byte[] get_channel_id() {
25 byte[] ret = bindings.CommitmentSigned_get_channel_id(this.ptr);
32 public void set_channel_id(byte[] val) {
33 bindings.CommitmentSigned_set_channel_id(this.ptr, val);
37 * A signature on the commitment transaction
39 public byte[] get_signature() {
40 byte[] ret = bindings.CommitmentSigned_get_signature(this.ptr);
45 * A signature on the commitment transaction
47 public void set_signature(byte[] val) {
48 bindings.CommitmentSigned_set_signature(this.ptr, val);
52 * Signatures on the HTLC transactions
54 public void set_htlc_signatures(byte[][] val) {
55 bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val);
59 * Constructs a new CommitmentSigned given each field
61 public static CommitmentSigned of(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) {
62 long ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg);
63 CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
64 ret_hu_conv.ptrs_to.add(ret_hu_conv);
69 * Creates a copy of the CommitmentSigned
71 public CommitmentSigned clone() {
72 long ret = bindings.CommitmentSigned_clone(this.ptr);
73 CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
74 ret_hu_conv.ptrs_to.add(this);
79 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
81 public byte[] write() {
82 byte[] ret = bindings.CommitmentSigned_write(this.ptr);
87 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
89 public static Result_CommitmentSignedDecodeErrorZ read(byte[] ser) {
90 long ret = bindings.CommitmentSigned_read(ser);
91 Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);