1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * An update_add_htlc message to be sent or received from a peer
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class UpdateAddHTLC extends CommonBase {
14 UpdateAddHTLC(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.UpdateAddHTLC_free(ptr); }
24 public byte[] get_channel_id() {
25 byte[] ret = bindings.UpdateAddHTLC_get_channel_id(this.ptr);
32 public void set_channel_id(byte[] val) {
33 bindings.UpdateAddHTLC_set_channel_id(this.ptr, val);
39 public long get_htlc_id() {
40 long ret = bindings.UpdateAddHTLC_get_htlc_id(this.ptr);
47 public void set_htlc_id(long val) {
48 bindings.UpdateAddHTLC_set_htlc_id(this.ptr, val);
52 * The HTLC value in milli-satoshi
54 public long get_amount_msat() {
55 long ret = bindings.UpdateAddHTLC_get_amount_msat(this.ptr);
60 * The HTLC value in milli-satoshi
62 public void set_amount_msat(long val) {
63 bindings.UpdateAddHTLC_set_amount_msat(this.ptr, val);
67 * The payment hash, the pre-image of which controls HTLC redemption
69 public byte[] get_payment_hash() {
70 byte[] ret = bindings.UpdateAddHTLC_get_payment_hash(this.ptr);
75 * The payment hash, the pre-image of which controls HTLC redemption
77 public void set_payment_hash(byte[] val) {
78 bindings.UpdateAddHTLC_set_payment_hash(this.ptr, val);
82 * The expiry height of the HTLC
84 public int get_cltv_expiry() {
85 int ret = bindings.UpdateAddHTLC_get_cltv_expiry(this.ptr);
90 * The expiry height of the HTLC
92 public void set_cltv_expiry(int val) {
93 bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val);
97 * Creates a copy of the UpdateAddHTLC
99 public UpdateAddHTLC clone() {
100 long ret = bindings.UpdateAddHTLC_clone(this.ptr);
101 UpdateAddHTLC ret_hu_conv = new UpdateAddHTLC(null, ret);
102 ret_hu_conv.ptrs_to.add(this);
107 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
109 public byte[] write() {
110 byte[] ret = bindings.UpdateAddHTLC_write(this.ptr);
115 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
117 public static Result_UpdateAddHTLCDecodeErrorZ constructor_read(byte[] ser) {
118 long ret = bindings.UpdateAddHTLC_read(ser);
119 Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);