6 namespace org { namespace ldk { namespace structs {
10 * Information needed to route a payment across a [`BlindedPath`].
12 public class BlindedPayInfo : CommonBase {
13 internal BlindedPayInfo(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.BlindedPayInfo_free(ptr); }
19 * Base fee charged (in millisatoshi) for the entire blinded path.
21 public int get_fee_base_msat() {
22 int ret = bindings.BlindedPayInfo_get_fee_base_msat(this.ptr);
28 * Base fee charged (in millisatoshi) for the entire blinded path.
30 public void set_fee_base_msat(int val) {
31 bindings.BlindedPayInfo_set_fee_base_msat(this.ptr, val);
37 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
38 * (i.e., 10,000 is 1%).
40 public int get_fee_proportional_millionths() {
41 int ret = bindings.BlindedPayInfo_get_fee_proportional_millionths(this.ptr);
47 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
48 * (i.e., 10,000 is 1%).
50 public void set_fee_proportional_millionths(int val) {
51 bindings.BlindedPayInfo_set_fee_proportional_millionths(this.ptr, val);
57 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
60 public short get_cltv_expiry_delta() {
61 short ret = bindings.BlindedPayInfo_get_cltv_expiry_delta(this.ptr);
67 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
70 public void set_cltv_expiry_delta(short val) {
71 bindings.BlindedPayInfo_set_cltv_expiry_delta(this.ptr, val);
77 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
78 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
79 * seen by the recipient.
81 public long get_htlc_minimum_msat() {
82 long ret = bindings.BlindedPayInfo_get_htlc_minimum_msat(this.ptr);
88 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
89 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
90 * seen by the recipient.
92 public void set_htlc_minimum_msat(long val) {
93 bindings.BlindedPayInfo_set_htlc_minimum_msat(this.ptr, val);
99 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
100 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
101 * seen by the recipient.
103 public long get_htlc_maximum_msat() {
104 long ret = bindings.BlindedPayInfo_get_htlc_maximum_msat(this.ptr);
110 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
111 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
112 * seen by the recipient.
114 public void set_htlc_maximum_msat(long val) {
115 bindings.BlindedPayInfo_set_htlc_maximum_msat(this.ptr, val);
121 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
124 public BlindedHopFeatures get_features() {
125 long ret = bindings.BlindedPayInfo_get_features(this.ptr);
127 if (ret >= 0 && ret <= 4096) { return null; }
128 org.ldk.structs.BlindedHopFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedHopFeatures(null, ret); }
129 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
134 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
137 public void set_features(org.ldk.structs.BlindedHopFeatures val) {
138 bindings.BlindedPayInfo_set_features(this.ptr, val.ptr);
141 if (this != null) { this.ptrs_to.AddLast(val); };
145 * Constructs a new BlindedPayInfo given each field
147 public static BlindedPayInfo of(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, org.ldk.structs.BlindedHopFeatures features_arg) {
148 long ret = bindings.BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg.ptr);
149 GC.KeepAlive(fee_base_msat_arg);
150 GC.KeepAlive(fee_proportional_millionths_arg);
151 GC.KeepAlive(cltv_expiry_delta_arg);
152 GC.KeepAlive(htlc_minimum_msat_arg);
153 GC.KeepAlive(htlc_maximum_msat_arg);
154 GC.KeepAlive(features_arg);
155 if (ret >= 0 && ret <= 4096) { return null; }
156 org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(null, ret); }
157 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
158 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(features_arg); };
162 internal long clone_ptr() {
163 long ret = bindings.BlindedPayInfo_clone_ptr(this.ptr);
169 * Creates a copy of the BlindedPayInfo
171 public BlindedPayInfo clone() {
172 long ret = bindings.BlindedPayInfo_clone(this.ptr);
174 if (ret >= 0 && ret <= 4096) { return null; }
175 org.ldk.structs.BlindedPayInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPayInfo(null, ret); }
176 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
181 * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
184 long ret = bindings.BlindedPayInfo_hash(this.ptr);
189 public override int GetHashCode() {
190 return (int)this.hash();
193 * Checks if two BlindedPayInfos contain equal inner contents.
194 * This ignores pointers and is_owned flags and looks at the values in fields.
195 * Two objects with NULL inner values will be considered "equal" here.
197 public bool eq(org.ldk.structs.BlindedPayInfo b) {
198 bool ret = bindings.BlindedPayInfo_eq(this.ptr, b.ptr);
201 if (this != null) { this.ptrs_to.AddLast(b); };
205 public override bool Equals(object o) {
206 if (!(o is BlindedPayInfo)) return false;
207 return this.eq((BlindedPayInfo)o);
210 * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
212 public byte[] write() {
213 long ret = bindings.BlindedPayInfo_write(this.ptr);
215 if (ret >= 0 && ret <= 4096) { return null; }
216 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
221 * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
223 public static Result_BlindedPayInfoDecodeErrorZ read(byte[] ser) {
224 long ret = bindings.BlindedPayInfo_read(InternalUtils.encodeUint8Array(ser));
226 if (ret >= 0 && ret <= 4096) { return null; }
227 Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret);