1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * An update_fulfill_htlc message to be sent or received from a peer
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class UpdateFulfillHTLC extends CommonBase {
14 UpdateFulfillHTLC(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.UpdateFulfillHTLC_free(ptr); }
24 public byte[] get_channel_id() {
25 byte[] ret = bindings.UpdateFulfillHTLC_get_channel_id(this.ptr);
32 public void set_channel_id(byte[] val) {
33 bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, val);
39 public long get_htlc_id() {
40 long ret = bindings.UpdateFulfillHTLC_get_htlc_id(this.ptr);
47 public void set_htlc_id(long val) {
48 bindings.UpdateFulfillHTLC_set_htlc_id(this.ptr, val);
52 * The pre-image of the payment hash, allowing HTLC redemption
54 public byte[] get_payment_preimage() {
55 byte[] ret = bindings.UpdateFulfillHTLC_get_payment_preimage(this.ptr);
60 * The pre-image of the payment hash, allowing HTLC redemption
62 public void set_payment_preimage(byte[] val) {
63 bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, val);
67 * Constructs a new UpdateFulfillHTLC given each field
69 public static UpdateFulfillHTLC constructor_new(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) {
70 long ret = bindings.UpdateFulfillHTLC_new(channel_id_arg, htlc_id_arg, payment_preimage_arg);
71 UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret);
72 ret_hu_conv.ptrs_to.add(ret_hu_conv);
77 * Creates a copy of the UpdateFulfillHTLC
79 public UpdateFulfillHTLC clone() {
80 long ret = bindings.UpdateFulfillHTLC_clone(this.ptr);
81 UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret);
82 ret_hu_conv.ptrs_to.add(this);
87 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
89 public byte[] write() {
90 byte[] ret = bindings.UpdateFulfillHTLC_write(this.ptr);
95 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
97 public static Result_UpdateFulfillHTLCDecodeErrorZ constructor_read(byte[] ser) {
98 long ret = bindings.UpdateFulfillHTLC_read(ser);
99 Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);