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 revoke_and_ack message to be sent or received from a peer
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class RevokeAndACK extends CommonBase {
15 RevokeAndACK(Object _dummy, long ptr) { super(ptr); }
16 @Override @SuppressWarnings("deprecation")
17 protected void finalize() throws Throwable {
19 if (ptr != 0) { bindings.RevokeAndACK_free(ptr); }
25 public byte[] get_channel_id() {
26 byte[] ret = bindings.RevokeAndACK_get_channel_id(this.ptr);
33 public void set_channel_id(byte[] val) {
34 bindings.RevokeAndACK_set_channel_id(this.ptr, val);
38 * The secret corresponding to the per-commitment point
40 public byte[] get_per_commitment_secret() {
41 byte[] ret = bindings.RevokeAndACK_get_per_commitment_secret(this.ptr);
46 * The secret corresponding to the per-commitment point
48 public void set_per_commitment_secret(byte[] val) {
49 bindings.RevokeAndACK_set_per_commitment_secret(this.ptr, val);
53 * The next sender-broadcast commitment transaction's per-commitment point
55 public byte[] get_next_per_commitment_point() {
56 byte[] ret = bindings.RevokeAndACK_get_next_per_commitment_point(this.ptr);
61 * The next sender-broadcast commitment transaction's per-commitment point
63 public void set_next_per_commitment_point(byte[] val) {
64 bindings.RevokeAndACK_set_next_per_commitment_point(this.ptr, val);
68 * Constructs a new RevokeAndACK given each field
70 public static RevokeAndACK of(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg) {
71 long ret = bindings.RevokeAndACK_new(channel_id_arg, per_commitment_secret_arg, next_per_commitment_point_arg);
72 if (ret < 1024) { return null; }
73 RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret);
74 ret_hu_conv.ptrs_to.add(ret_hu_conv);
79 * Creates a copy of the RevokeAndACK
81 public RevokeAndACK clone() {
82 long ret = bindings.RevokeAndACK_clone(this.ptr);
83 if (ret < 1024) { return null; }
84 RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret);
85 ret_hu_conv.ptrs_to.add(this);
90 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
92 public byte[] write() {
93 byte[] ret = bindings.RevokeAndACK_write(this.ptr);
98 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
100 public static Result_RevokeAndACKDecodeErrorZ read(byte[] ser) {
101 long ret = bindings.RevokeAndACK_read(ser);
102 if (ret < 1024) { return null; }
103 Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);