1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * Information about an HTLC as it appears in a commitment transaction
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class HTLCOutputInCommitment extends CommonBase {
14 HTLCOutputInCommitment(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.HTLCOutputInCommitment_free(ptr); }
22 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
23 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
24 * need to compare this value to whether the commitment transaction in question is that of
25 * the counterparty or our own.
27 public boolean get_offered() {
28 boolean ret = bindings.HTLCOutputInCommitment_get_offered(this.ptr);
33 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
34 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
35 * need to compare this value to whether the commitment transaction in question is that of
36 * the counterparty or our own.
38 public void set_offered(boolean val) {
39 bindings.HTLCOutputInCommitment_set_offered(this.ptr, val);
43 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
44 * this divided by 1000.
46 public long get_amount_msat() {
47 long ret = bindings.HTLCOutputInCommitment_get_amount_msat(this.ptr);
52 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
53 * this divided by 1000.
55 public void set_amount_msat(long val) {
56 bindings.HTLCOutputInCommitment_set_amount_msat(this.ptr, val);
60 * The CLTV lock-time at which this HTLC expires.
62 public int get_cltv_expiry() {
63 int ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this.ptr);
68 * The CLTV lock-time at which this HTLC expires.
70 public void set_cltv_expiry(int val) {
71 bindings.HTLCOutputInCommitment_set_cltv_expiry(this.ptr, val);
75 * The hash of the preimage which unlocks this HTLC.
77 public byte[] get_payment_hash() {
78 byte[] ret = bindings.HTLCOutputInCommitment_get_payment_hash(this.ptr);
83 * The hash of the preimage which unlocks this HTLC.
85 public void set_payment_hash(byte[] val) {
86 bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val);
90 * Creates a copy of the HTLCOutputInCommitment
92 public HTLCOutputInCommitment clone() {
93 long ret = bindings.HTLCOutputInCommitment_clone(this.ptr);
94 HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret);
95 ret_hu_conv.ptrs_to.add(this);
100 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
102 public byte[] write() {
103 byte[] ret = bindings.HTLCOutputInCommitment_write(this.ptr);
108 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
110 public static Result_HTLCOutputInCommitmentDecodeErrorZ constructor_read(byte[] ser) {
111 long ret = bindings.HTLCOutputInCommitment_read(ser);
112 Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);