6 namespace org { namespace ldk { namespace structs {
10 * Information needed for constructing an invoice route hint for this channel.
12 public class CounterpartyForwardingInfo : CommonBase {
13 internal CounterpartyForwardingInfo(object _dummy, long ptr) : base(ptr) { }
14 ~CounterpartyForwardingInfo() {
15 if (ptr != 0) { bindings.CounterpartyForwardingInfo_free(ptr); }
19 * Base routing fee in millisatoshis.
21 public int get_fee_base_msat() {
22 int ret = bindings.CounterpartyForwardingInfo_get_fee_base_msat(this.ptr);
28 * Base routing fee in millisatoshis.
30 public void set_fee_base_msat(int val) {
31 bindings.CounterpartyForwardingInfo_set_fee_base_msat(this.ptr, val);
37 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
39 public int get_fee_proportional_millionths() {
40 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);
55 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
56 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
57 * `cltv_expiry_delta` for more details.
59 public short get_cltv_expiry_delta() {
60 short ret = bindings.CounterpartyForwardingInfo_get_cltv_expiry_delta(this.ptr);
66 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
67 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
68 * `cltv_expiry_delta` for more details.
70 public void set_cltv_expiry_delta(short val) {
71 bindings.CounterpartyForwardingInfo_set_cltv_expiry_delta(this.ptr, val);
77 * Constructs a new CounterpartyForwardingInfo given each field
79 public static CounterpartyForwardingInfo of(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg) {
80 long ret = bindings.CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
81 GC.KeepAlive(fee_base_msat_arg);
82 GC.KeepAlive(fee_proportional_millionths_arg);
83 GC.KeepAlive(cltv_expiry_delta_arg);
84 if (ret >= 0 && ret <= 4096) { return null; }
85 org.ldk.structs.CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyForwardingInfo(null, ret); }
86 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
90 internal long clone_ptr() {
91 long ret = bindings.CounterpartyForwardingInfo_clone_ptr(this.ptr);
97 * Creates a copy of the CounterpartyForwardingInfo
99 public CounterpartyForwardingInfo clone() {
100 long ret = bindings.CounterpartyForwardingInfo_clone(this.ptr);
102 if (ret >= 0 && ret <= 4096) { return null; }
103 org.ldk.structs.CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyForwardingInfo(null, ret); }
104 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
109 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
111 public byte[] write() {
112 byte[] ret = bindings.CounterpartyForwardingInfo_write(this.ptr);
118 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
120 public static Result_CounterpartyForwardingInfoDecodeErrorZ read(byte[] ser) {
121 long ret = bindings.CounterpartyForwardingInfo_read(ser);
123 if (ret >= 0 && ret <= 4096) { return null; }
124 Result_CounterpartyForwardingInfoDecodeErrorZ ret_hu_conv = Result_CounterpartyForwardingInfoDecodeErrorZ.constr_from_ptr(ret);