[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / BlindedPayInfo.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * Information needed to route a payment across a [`BlindedPath`].
11  */
12 public class BlindedPayInfo : CommonBase {
13         internal BlindedPayInfo(object _dummy, long ptr) : base(ptr) { }
14         ~BlindedPayInfo() {
15                 if (ptr != 0) { bindings.BlindedPayInfo_free(ptr); }
16         }
17
18         /**
19          * Base fee charged (in millisatoshi) for the entire blinded path.
20          */
21         public int get_fee_base_msat() {
22                 int ret = bindings.BlindedPayInfo_get_fee_base_msat(this.ptr);
23                 GC.KeepAlive(this);
24                 return ret;
25         }
26
27         /**
28          * Base fee charged (in millisatoshi) for the entire blinded path.
29          */
30         public void set_fee_base_msat(int val) {
31                 bindings.BlindedPayInfo_set_fee_base_msat(this.ptr, val);
32                 GC.KeepAlive(this);
33                 GC.KeepAlive(val);
34         }
35
36         /**
37          * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
38          * (i.e., 10,000 is 1%).
39          */
40         public int get_fee_proportional_millionths() {
41                 int ret = bindings.BlindedPayInfo_get_fee_proportional_millionths(this.ptr);
42                 GC.KeepAlive(this);
43                 return ret;
44         }
45
46         /**
47          * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
48          * (i.e., 10,000 is 1%).
49          */
50         public void set_fee_proportional_millionths(int val) {
51                 bindings.BlindedPayInfo_set_fee_proportional_millionths(this.ptr, val);
52                 GC.KeepAlive(this);
53                 GC.KeepAlive(val);
54         }
55
56         /**
57          * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
58          * path.
59          */
60         public short get_cltv_expiry_delta() {
61                 short ret = bindings.BlindedPayInfo_get_cltv_expiry_delta(this.ptr);
62                 GC.KeepAlive(this);
63                 return ret;
64         }
65
66         /**
67          * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
68          * path.
69          */
70         public void set_cltv_expiry_delta(short val) {
71                 bindings.BlindedPayInfo_set_cltv_expiry_delta(this.ptr, val);
72                 GC.KeepAlive(this);
73                 GC.KeepAlive(val);
74         }
75
76         /**
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.
80          */
81         public long get_htlc_minimum_msat() {
82                 long ret = bindings.BlindedPayInfo_get_htlc_minimum_msat(this.ptr);
83                 GC.KeepAlive(this);
84                 return ret;
85         }
86
87         /**
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.
91          */
92         public void set_htlc_minimum_msat(long val) {
93                 bindings.BlindedPayInfo_set_htlc_minimum_msat(this.ptr, val);
94                 GC.KeepAlive(this);
95                 GC.KeepAlive(val);
96         }
97
98         /**
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.
102          */
103         public long get_htlc_maximum_msat() {
104                 long ret = bindings.BlindedPayInfo_get_htlc_maximum_msat(this.ptr);
105                 GC.KeepAlive(this);
106                 return ret;
107         }
108
109         /**
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.
113          */
114         public void set_htlc_maximum_msat(long val) {
115                 bindings.BlindedPayInfo_set_htlc_maximum_msat(this.ptr, val);
116                 GC.KeepAlive(this);
117                 GC.KeepAlive(val);
118         }
119
120         /**
121          * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
122          * onion payload.
123          */
124         public BlindedHopFeatures get_features() {
125                 long ret = bindings.BlindedPayInfo_get_features(this.ptr);
126                 GC.KeepAlive(this);
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); };
130                 return ret_hu_conv;
131         }
132
133         /**
134          * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
135          * onion payload.
136          */
137         public void set_features(org.ldk.structs.BlindedHopFeatures val) {
138                 bindings.BlindedPayInfo_set_features(this.ptr, val == null ? 0 : val.ptr);
139                 GC.KeepAlive(this);
140                 GC.KeepAlive(val);
141                 if (this != null) { this.ptrs_to.AddLast(val); };
142         }
143
144         /**
145          * Constructs a new BlindedPayInfo given each field
146          */
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 == null ? 0 : 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); };
159                 return ret_hu_conv;
160         }
161
162         internal long clone_ptr() {
163                 long ret = bindings.BlindedPayInfo_clone_ptr(this.ptr);
164                 GC.KeepAlive(this);
165                 return ret;
166         }
167
168         /**
169          * Creates a copy of the BlindedPayInfo
170          */
171         public BlindedPayInfo clone() {
172                 long ret = bindings.BlindedPayInfo_clone(this.ptr);
173                 GC.KeepAlive(this);
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); };
177                 return ret_hu_conv;
178         }
179
180         /**
181          * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
182          */
183         public long hash() {
184                 long ret = bindings.BlindedPayInfo_hash(this.ptr);
185                 GC.KeepAlive(this);
186                 return ret;
187         }
188
189         public override int GetHashCode() {
190                 return (int)this.hash();
191         }
192         /**
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.
196          */
197         public bool eq(org.ldk.structs.BlindedPayInfo b) {
198                 bool ret = bindings.BlindedPayInfo_eq(this.ptr, b == null ? 0 : b.ptr);
199                 GC.KeepAlive(this);
200                 GC.KeepAlive(b);
201                 if (this != null) { this.ptrs_to.AddLast(b); };
202                 return ret;
203         }
204
205         public override bool Equals(object o) {
206                 if (!(o is BlindedPayInfo)) return false;
207                 return this.eq((BlindedPayInfo)o);
208         }
209         /**
210          * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
211          */
212         public byte[] write() {
213                 long ret = bindings.BlindedPayInfo_write(this.ptr);
214                 GC.KeepAlive(this);
215                 if (ret >= 0 && ret <= 4096) { return null; }
216                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
217                 return ret_conv;
218         }
219
220         /**
221          * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
222          */
223         public static Result_BlindedPayInfoDecodeErrorZ read(byte[] ser) {
224                 long ret = bindings.BlindedPayInfo_read(InternalUtils.encodeUint8Array(ser));
225                 GC.KeepAlive(ser);
226                 if (ret >= 0 && ret <= 4096) { return null; }
227                 Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret);
228                 return ret_hu_conv;
229         }
230
231 }
232 } } }