Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / Invoice.java
index e848a21837f9c1b0fb191171cfcceeb5408e37b0..8817ed413f5c9b086fab29047c8559b744d948dc 100644 (file)
@@ -35,13 +35,18 @@ public class Invoice extends CommonBase {
                return ret;
        }
 
+       long clone_ptr() {
+               long ret = bindings.Invoice_clone_ptr(this.ptr);
+               return ret;
+       }
+
        /**
         * Creates a copy of the Invoice
         */
        public Invoice clone() {
                long ret = bindings.Invoice_clone(this.ptr);
-               if (ret < 1024) { return null; }
-               Invoice ret_hu_conv = new Invoice(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Invoice(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -51,8 +56,8 @@ public class Invoice extends CommonBase {
         */
        public SignedRawInvoice into_signed_raw() {
                long ret = bindings.Invoice_into_signed_raw(this.ptr);
-               if (ret < 1024) { return null; }
-               SignedRawInvoice ret_hu_conv = new SignedRawInvoice(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new SignedRawInvoice(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                ;
                return ret_hu_conv;
@@ -63,7 +68,7 @@ public class Invoice extends CommonBase {
         */
        public Result_NoneSemanticErrorZ check_signature() {
                long ret = bindings.Invoice_check_signature(this.ptr);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -92,7 +97,7 @@ public class Invoice extends CommonBase {
         */
        public static Result_InvoiceSemanticErrorZ from_signed(SignedRawInvoice signed_invoice) {
                long ret = bindings.Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr & ~1);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -140,8 +145,8 @@ public class Invoice extends CommonBase {
        @Nullable
        public InvoiceFeatures features() {
                long ret = bindings.Invoice_features(this.ptr);
-               if (ret < 1024) { return null; }
-               InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -162,6 +167,14 @@ public class Invoice extends CommonBase {
                return ret;
        }
 
+       /**
+        * Returns whether the invoice has expired.
+        */
+       public boolean is_expired() {
+               boolean ret = bindings.Invoice_is_expired(this.ptr);
+               return ret;
+       }
+
        /**
         * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
         * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
@@ -179,7 +192,7 @@ public class Invoice extends CommonBase {
                PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret.length];
                for (int o = 0; o < ret.length; o++) {
                        long ret_conv_14 = ret[o];
-                       PrivateRoute ret_conv_14_hu_conv = new PrivateRoute(null, ret_conv_14);
+                       PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new PrivateRoute(null, ret_conv_14); }
                        ret_conv_14_hu_conv.ptrs_to.add(this);
                        ret_conv_14_arr[o] = ret_conv_14_hu_conv;
                }
@@ -194,7 +207,7 @@ public class Invoice extends CommonBase {
                RouteHint[] ret_conv_11_arr = new RouteHint[ret.length];
                for (int l = 0; l < ret.length; l++) {
                        long ret_conv_11 = ret[l];
-                       RouteHint ret_conv_11_hu_conv = new RouteHint(null, ret_conv_11);
+                       RouteHint ret_conv_11_hu_conv = null; if (ret_conv_11 < 0 || ret_conv_11 > 4096) { ret_conv_11_hu_conv = new RouteHint(null, ret_conv_11); }
                        ret_conv_11_hu_conv.ptrs_to.add(this);
                        ret_conv_11_arr[l] = ret_conv_11_hu_conv;
                }
@@ -210,11 +223,11 @@ public class Invoice extends CommonBase {
        }
 
        /**
-        * Returns the amount if specified in the invoice as pico <currency>.
+        * Returns the amount if specified in the invoice as millisatoshis.
         */
-       public Option_u64Z amount_pico_btc() {
-               long ret = bindings.Invoice_amount_pico_btc(this.ptr);
-               if (ret < 1024) { return null; }
+       public Option_u64Z amount_milli_satoshis() {
+               long ret = bindings.Invoice_amount_milli_satoshis(this.ptr);
+               if (ret >= 0 && ret <= 4096) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -225,7 +238,7 @@ public class Invoice extends CommonBase {
         */
        public static Result_InvoiceNoneZ from_str(java.lang.String s) {
                long ret = bindings.Invoice_from_str(s);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret <= 4096) { return null; }
                Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }