6 namespace org { namespace ldk { namespace structs {
10 * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
11 * but without the signature information.
12 * Decoding and encoding should not lead to information loss but may lead to different hashes.
14 * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
16 public class RawBolt11Invoice : CommonBase {
17 internal RawBolt11Invoice(object _dummy, long ptr) : base(ptr) { }
19 if (ptr != 0) { bindings.RawBolt11Invoice_free(ptr); }
25 public RawDataPart get_data() {
26 long ret = bindings.RawBolt11Invoice_get_data(this.ptr);
28 if (ret >= 0 && ret <= 4096) { return null; }
29 org.ldk.structs.RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawDataPart(null, ret); }
30 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
37 public void set_data(org.ldk.structs.RawDataPart val) {
38 bindings.RawBolt11Invoice_set_data(this.ptr, val == null ? 0 : val.ptr);
41 if (this != null) { this.ptrs_to.AddLast(val); };
45 * Checks if two RawBolt11Invoices contain equal inner contents.
46 * This ignores pointers and is_owned flags and looks at the values in fields.
47 * Two objects with NULL inner values will be considered "equal" here.
49 public bool eq(org.ldk.structs.RawBolt11Invoice b) {
50 bool ret = bindings.RawBolt11Invoice_eq(this.ptr, b == null ? 0 : b.ptr);
53 if (this != null) { this.ptrs_to.AddLast(b); };
57 public override bool Equals(object o) {
58 if (!(o is RawBolt11Invoice)) return false;
59 return this.eq((RawBolt11Invoice)o);
61 internal long clone_ptr() {
62 long ret = bindings.RawBolt11Invoice_clone_ptr(this.ptr);
68 * Creates a copy of the RawBolt11Invoice
70 public RawBolt11Invoice clone() {
71 long ret = bindings.RawBolt11Invoice_clone(this.ptr);
73 if (ret >= 0 && ret <= 4096) { return null; }
74 org.ldk.structs.RawBolt11Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawBolt11Invoice(null, ret); }
75 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
80 * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
83 long ret = bindings.RawBolt11Invoice_hash(this.ptr);
88 public override int GetHashCode() {
89 return (int)this.hash();
92 * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
94 public byte[] signable_hash() {
95 byte[] ret = bindings.RawBolt11Invoice_signable_hash(this.ptr);
101 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
103 public Sha256 payment_hash() {
104 long ret = bindings.RawBolt11Invoice_payment_hash(this.ptr);
106 if (ret >= 0 && ret <= 4096) { return null; }
107 org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(null, ret); }
108 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
113 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
115 public Description description() {
116 long ret = bindings.RawBolt11Invoice_description(this.ptr);
118 if (ret >= 0 && ret <= 4096) { return null; }
119 org.ldk.structs.Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Description(null, ret); }
120 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
125 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
127 public PayeePubKey payee_pub_key() {
128 long ret = bindings.RawBolt11Invoice_payee_pub_key(this.ptr);
130 if (ret >= 0 && ret <= 4096) { return null; }
131 org.ldk.structs.PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PayeePubKey(null, ret); }
132 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
137 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
139 public Sha256 description_hash() {
140 long ret = bindings.RawBolt11Invoice_description_hash(this.ptr);
142 if (ret >= 0 && ret <= 4096) { return null; }
143 org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(null, ret); }
144 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
149 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
151 public ExpiryTime expiry_time() {
152 long ret = bindings.RawBolt11Invoice_expiry_time(this.ptr);
154 if (ret >= 0 && ret <= 4096) { return null; }
155 org.ldk.structs.ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpiryTime(null, ret); }
156 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
161 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
163 public MinFinalCltvExpiryDelta min_final_cltv_expiry_delta() {
164 long ret = bindings.RawBolt11Invoice_min_final_cltv_expiry_delta(this.ptr);
166 if (ret >= 0 && ret <= 4096) { return null; }
167 org.ldk.structs.MinFinalCltvExpiryDelta ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MinFinalCltvExpiryDelta(null, ret); }
168 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
172 public Option_PaymentSecretZ payment_secret() {
173 long ret = bindings.RawBolt11Invoice_payment_secret(this.ptr);
175 if (ret >= 0 && ret <= 4096) { return null; }
176 org.ldk.structs.Option_PaymentSecretZ ret_hu_conv = org.ldk.structs.Option_PaymentSecretZ.constr_from_ptr(ret);
177 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
181 public Option_CVec_u8ZZ payment_metadata() {
182 long ret = bindings.RawBolt11Invoice_payment_metadata(this.ptr);
184 if (ret >= 0 && ret <= 4096) { return null; }
185 org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret);
186 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
191 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
193 public Bolt11InvoiceFeatures features() {
194 long ret = bindings.RawBolt11Invoice_features(this.ptr);
196 if (ret >= 0 && ret <= 4096) { return null; }
197 org.ldk.structs.Bolt11InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt11InvoiceFeatures(null, ret); }
198 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
202 public PrivateRoute[] private_routes() {
203 long[] ret = bindings.RawBolt11Invoice_private_routes(this.ptr);
205 int ret_conv_14_len = ret.Length;
206 PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret_conv_14_len];
207 for (int o = 0; o < ret_conv_14_len; o++) {
208 long ret_conv_14 = ret[o];
209 org.ldk.structs.PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new org.ldk.structs.PrivateRoute(null, ret_conv_14); }
210 if (ret_conv_14_hu_conv != null) { ret_conv_14_hu_conv.ptrs_to.AddLast(this); };
211 ret_conv_14_arr[o] = ret_conv_14_hu_conv;
213 return ret_conv_14_arr;
216 public Option_u64Z amount_pico_btc() {
217 long ret = bindings.RawBolt11Invoice_amount_pico_btc(this.ptr);
219 if (ret >= 0 && ret <= 4096) { return null; }
220 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
221 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
225 public Currency currency() {
226 Currency ret = bindings.RawBolt11Invoice_currency(this.ptr);