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 * Information needed for constructing an invoice route hint for this channel.
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class CounterpartyForwardingInfo extends CommonBase {
15 CounterpartyForwardingInfo(Object _dummy, long ptr) { super(ptr); }
16 @Override @SuppressWarnings("deprecation")
17 protected void finalize() throws Throwable {
19 if (ptr != 0) { bindings.CounterpartyForwardingInfo_free(ptr); }
23 * Base routing fee in millisatoshis.
25 public int get_fee_base_msat() {
26 int ret = bindings.CounterpartyForwardingInfo_get_fee_base_msat(this.ptr);
31 * Base routing fee in millisatoshis.
33 public void set_fee_base_msat(int val) {
34 bindings.CounterpartyForwardingInfo_set_fee_base_msat(this.ptr, val);
38 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
40 public int get_fee_proportional_millionths() {
41 int ret = bindings.CounterpartyForwardingInfo_get_fee_proportional_millionths(this.ptr);
46 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
48 public void set_fee_proportional_millionths(int val) {
49 bindings.CounterpartyForwardingInfo_set_fee_proportional_millionths(this.ptr, val);
53 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
54 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
55 * `cltv_expiry_delta` for more details.
57 public short get_cltv_expiry_delta() {
58 short ret = bindings.CounterpartyForwardingInfo_get_cltv_expiry_delta(this.ptr);
63 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
64 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
65 * `cltv_expiry_delta` for more details.
67 public void set_cltv_expiry_delta(short val) {
68 bindings.CounterpartyForwardingInfo_set_cltv_expiry_delta(this.ptr, val);
72 * Constructs a new CounterpartyForwardingInfo given each field
74 public static CounterpartyForwardingInfo of(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg) {
75 long ret = bindings.CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
76 if (ret < 1024) { return null; }
77 CounterpartyForwardingInfo ret_hu_conv = new CounterpartyForwardingInfo(null, ret);
78 ret_hu_conv.ptrs_to.add(ret_hu_conv);
83 * Creates a copy of the CounterpartyForwardingInfo
85 public CounterpartyForwardingInfo clone() {
86 long ret = bindings.CounterpartyForwardingInfo_clone(this.ptr);
87 if (ret < 1024) { return null; }
88 CounterpartyForwardingInfo ret_hu_conv = new CounterpartyForwardingInfo(null, ret);
89 ret_hu_conv.ptrs_to.add(this);