1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * A closing_signed message to be sent or received from a peer
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class ClosingSigned extends CommonBase {
14 ClosingSigned(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.ClosingSigned_free(ptr); }
24 public byte[] get_channel_id() {
25 byte[] ret = bindings.ClosingSigned_get_channel_id(this.ptr);
32 public void set_channel_id(byte[] val) {
33 bindings.ClosingSigned_set_channel_id(this.ptr, val);
37 * The proposed total fee for the closing transaction
39 public long get_fee_satoshis() {
40 long ret = bindings.ClosingSigned_get_fee_satoshis(this.ptr);
45 * The proposed total fee for the closing transaction
47 public void set_fee_satoshis(long val) {
48 bindings.ClosingSigned_set_fee_satoshis(this.ptr, val);
52 * A signature on the closing transaction
54 public byte[] get_signature() {
55 byte[] ret = bindings.ClosingSigned_get_signature(this.ptr);
60 * A signature on the closing transaction
62 public void set_signature(byte[] val) {
63 bindings.ClosingSigned_set_signature(this.ptr, val);
67 * Constructs a new ClosingSigned given each field
69 public static ClosingSigned of(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg) {
70 long ret = bindings.ClosingSigned_new(channel_id_arg, fee_satoshis_arg, signature_arg);
71 ClosingSigned ret_hu_conv = new ClosingSigned(null, ret);
72 ret_hu_conv.ptrs_to.add(ret_hu_conv);
77 * Creates a copy of the ClosingSigned
79 public ClosingSigned clone() {
80 long ret = bindings.ClosingSigned_clone(this.ptr);
81 ClosingSigned ret_hu_conv = new ClosingSigned(null, ret);
82 ret_hu_conv.ptrs_to.add(this);
87 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
89 public byte[] write() {
90 byte[] ret = bindings.ClosingSigned_write(this.ptr);
95 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
97 public static Result_ClosingSignedDecodeErrorZ read(byte[] ser) {
98 long ret = bindings.ClosingSigned_read(ser);
99 Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);