1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * Information needed for constructing an invoice route hint for this channel.
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class CounterpartyForwardingInfo extends CommonBase {
16 CounterpartyForwardingInfo(Object _dummy, long ptr) { super(ptr); }
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
20 if (ptr != 0) { bindings.CounterpartyForwardingInfo_free(ptr); }
24 * Base routing fee in millisatoshis.
26 public int get_fee_base_msat() {
27 int ret = bindings.CounterpartyForwardingInfo_get_fee_base_msat(this.ptr);
28 Reference.reachabilityFence(this);
33 * Base routing fee in millisatoshis.
35 public void set_fee_base_msat(int val) {
36 bindings.CounterpartyForwardingInfo_set_fee_base_msat(this.ptr, val);
37 Reference.reachabilityFence(this);
38 Reference.reachabilityFence(val);
42 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
44 public int get_fee_proportional_millionths() {
45 int ret = bindings.CounterpartyForwardingInfo_get_fee_proportional_millionths(this.ptr);
46 Reference.reachabilityFence(this);
51 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
53 public void set_fee_proportional_millionths(int val) {
54 bindings.CounterpartyForwardingInfo_set_fee_proportional_millionths(this.ptr, val);
55 Reference.reachabilityFence(this);
56 Reference.reachabilityFence(val);
60 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
61 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
62 * `cltv_expiry_delta` for more details.
64 public short get_cltv_expiry_delta() {
65 short ret = bindings.CounterpartyForwardingInfo_get_cltv_expiry_delta(this.ptr);
66 Reference.reachabilityFence(this);
71 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
72 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
73 * `cltv_expiry_delta` for more details.
75 public void set_cltv_expiry_delta(short val) {
76 bindings.CounterpartyForwardingInfo_set_cltv_expiry_delta(this.ptr, val);
77 Reference.reachabilityFence(this);
78 Reference.reachabilityFence(val);
82 * Constructs a new CounterpartyForwardingInfo given each field
84 public static CounterpartyForwardingInfo of(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg) {
85 long ret = bindings.CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
86 Reference.reachabilityFence(fee_base_msat_arg);
87 Reference.reachabilityFence(fee_proportional_millionths_arg);
88 Reference.reachabilityFence(cltv_expiry_delta_arg);
89 if (ret >= 0 && ret <= 4096) { return null; }
90 CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyForwardingInfo(null, ret); }
91 ret_hu_conv.ptrs_to.add(ret_hu_conv);
96 long ret = bindings.CounterpartyForwardingInfo_clone_ptr(this.ptr);
97 Reference.reachabilityFence(this);
102 * Creates a copy of the CounterpartyForwardingInfo
104 public CounterpartyForwardingInfo clone() {
105 long ret = bindings.CounterpartyForwardingInfo_clone(this.ptr);
106 Reference.reachabilityFence(this);
107 if (ret >= 0 && ret <= 4096) { return null; }
108 CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyForwardingInfo(null, ret); }
109 ret_hu_conv.ptrs_to.add(this);