Update auto-generated bindings
[ldk-java] / ts / structs / Invoice.ts
1
2             
3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
5
6
7
8             export default class Invoice extends CommonBase {
9                 constructor(_dummy: object, ptr: number) {
10                     super(ptr);
11                 }
12
13                 
14                 protected finalize() {
15                     super.finalize();
16
17                     if (this.ptr != 0) {
18                         bindings.Invoice_free(this.ptr);
19                     }
20                 }
21         public boolean eq(Invoice b) {
22                 boolean ret = bindings.Invoice_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
23                 this.ptrs_to.add(b);
24                 return ret;
25         }
26
27         public number clone_ptr() {
28                 number ret = bindings.Invoice_clone_ptr(this.ptr);
29                 return ret;
30         }
31
32         public Invoice clone() {
33                 number ret = bindings.Invoice_clone(this.ptr);
34                 const ret_hu_conv: Invoice = new Invoice(null, ret);
35                 ret_hu_conv.ptrs_to.add(this);
36                 return ret_hu_conv;
37         }
38
39         public SignedRawInvoice into_signed_raw() {
40                 number ret = bindings.Invoice_into_signed_raw(this.ptr);
41                 const ret_hu_conv: SignedRawInvoice = new SignedRawInvoice(null, ret);
42                 ret_hu_conv.ptrs_to.add(this);
43                 return ret_hu_conv;
44         }
45
46         public Result_NoneSemanticErrorZ check_signature() {
47                 number ret = bindings.Invoice_check_signature(this.ptr);
48                 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
49                 return ret_hu_conv;
50         }
51
52         public static Result_InvoiceSemanticErrorZ constructor_from_signed(SignedRawInvoice signed_invoice) {
53                 number ret = bindings.Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr & ~1);
54                 Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
55                 return ret_hu_conv;
56         }
57
58         public number timestamp() {
59                 number ret = bindings.Invoice_timestamp(this.ptr);
60                 return ret;
61         }
62
63         public Uint8Array payment_hash() {
64                 Uint8Array ret = bindings.Invoice_payment_hash(this.ptr);
65                 return ret;
66         }
67
68         public Uint8Array payee_pub_key() {
69                 Uint8Array ret = bindings.Invoice_payee_pub_key(this.ptr);
70                 return ret;
71         }
72
73         public Uint8Array payment_secret() {
74                 Uint8Array ret = bindings.Invoice_payment_secret(this.ptr);
75                 return ret;
76         }
77
78         public InvoiceFeatures features() {
79                 number ret = bindings.Invoice_features(this.ptr);
80                 const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
81                 ret_hu_conv.ptrs_to.add(this);
82                 return ret_hu_conv;
83         }
84
85         public Uint8Array recover_payee_pub_key() {
86                 Uint8Array ret = bindings.Invoice_recover_payee_pub_key(this.ptr);
87                 return ret;
88         }
89
90         public number expiry_time() {
91                 number ret = bindings.Invoice_expiry_time(this.ptr);
92                 return ret;
93         }
94
95         public boolean is_expired() {
96                 boolean ret = bindings.Invoice_is_expired(this.ptr);
97                 return ret;
98         }
99
100         public number min_final_cltv_expiry() {
101                 number ret = bindings.Invoice_min_final_cltv_expiry(this.ptr);
102                 return ret;
103         }
104
105         public PrivateRoute[] private_routes() {
106                 number[] ret = bindings.Invoice_private_routes(this.ptr);
107                 PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret.length];
108                 for (int o = 0; o < ret.length; o++) {
109                         number ret_conv_14 = ret[o];
110                         const ret_conv_14_hu_conv: PrivateRoute = new PrivateRoute(null, ret_conv_14);
111                         ret_conv_14_hu_conv.ptrs_to.add(this);
112                         ret_conv_14_arr[o] = ret_conv_14_hu_conv;
113                 }
114                 return ret_conv_14_arr;
115         }
116
117         public RouteHint[] route_hints() {
118                 number[] ret = bindings.Invoice_route_hints(this.ptr);
119                 RouteHint[] ret_conv_11_arr = new RouteHint[ret.length];
120                 for (int l = 0; l < ret.length; l++) {
121                         number ret_conv_11 = ret[l];
122                         const ret_conv_11_hu_conv: RouteHint = new RouteHint(null, ret_conv_11);
123                         ret_conv_11_hu_conv.ptrs_to.add(this);
124                         ret_conv_11_arr[l] = ret_conv_11_hu_conv;
125                 }
126                 return ret_conv_11_arr;
127         }
128
129         public Currency currency() {
130                 Currency ret = bindings.Invoice_currency(this.ptr);
131                 return ret;
132         }
133
134         public Option_u64Z amount_milli_satoshis() {
135                 number ret = bindings.Invoice_amount_milli_satoshis(this.ptr);
136                 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
137                 ret_hu_conv.ptrs_to.add(this);
138                 return ret_hu_conv;
139         }
140
141         public static Result_InvoiceNoneZ constructor_from_str(String s) {
142                 number ret = bindings.Invoice_from_str(s);
143                 Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
144                 return ret_hu_conv;
145         }
146
147         public String to_str() {
148                 String ret = bindings.Invoice_to_str(this.ptr);
149                 return ret;
150         }
151
152 }