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 Invoice clone() {
28                 number ret = bindings.Invoice_clone(this.ptr);
29                 const ret_hu_conv: Invoice = new Invoice(null, ret);
30                 ret_hu_conv.ptrs_to.add(this);
31                 return ret_hu_conv;
32         }
33
34         public SignedRawInvoice into_signed_raw() {
35                 number ret = bindings.Invoice_into_signed_raw(this.ptr);
36                 const ret_hu_conv: SignedRawInvoice = new SignedRawInvoice(null, ret);
37                 ret_hu_conv.ptrs_to.add(this);
38                 return ret_hu_conv;
39         }
40
41         public Result_NoneSemanticErrorZ check_signature() {
42                 number ret = bindings.Invoice_check_signature(this.ptr);
43                 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
44                 return ret_hu_conv;
45         }
46
47         public static Result_InvoiceSemanticErrorZ constructor_from_signed(SignedRawInvoice signed_invoice) {
48                 number ret = bindings.Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr & ~1);
49                 Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
50                 ret_hu_conv.ptrs_to.add(signed_invoice);
51                 return ret_hu_conv;
52         }
53
54         public number timestamp() {
55                 number ret = bindings.Invoice_timestamp(this.ptr);
56                 return ret;
57         }
58
59         public Uint8Array payment_hash() {
60                 Uint8Array ret = bindings.Invoice_payment_hash(this.ptr);
61                 return ret;
62         }
63
64         public Uint8Array payee_pub_key() {
65                 Uint8Array ret = bindings.Invoice_payee_pub_key(this.ptr);
66                 return ret;
67         }
68
69         public Uint8Array payment_secret() {
70                 Uint8Array ret = bindings.Invoice_payment_secret(this.ptr);
71                 return ret;
72         }
73
74         public InvoiceFeatures features() {
75                 number ret = bindings.Invoice_features(this.ptr);
76                 const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
77                 ret_hu_conv.ptrs_to.add(this);
78                 return ret_hu_conv;
79         }
80
81         public Uint8Array recover_payee_pub_key() {
82                 Uint8Array ret = bindings.Invoice_recover_payee_pub_key(this.ptr);
83                 return ret;
84         }
85
86         public number expiry_time() {
87                 number ret = bindings.Invoice_expiry_time(this.ptr);
88                 return ret;
89         }
90
91         public number min_final_cltv_expiry() {
92                 number ret = bindings.Invoice_min_final_cltv_expiry(this.ptr);
93                 return ret;
94         }
95
96         public PrivateRoute[] private_routes() {
97                 number[] ret = bindings.Invoice_private_routes(this.ptr);
98                 PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret.length];
99                 for (int o = 0; o < ret.length; o++) {
100                         number ret_conv_14 = ret[o];
101                         const ret_conv_14_hu_conv: PrivateRoute = new PrivateRoute(null, ret_conv_14);
102                         ret_conv_14_hu_conv.ptrs_to.add(this);
103                         ret_conv_14_arr[o] = ret_conv_14_hu_conv;
104                 }
105                 return ret_conv_14_arr;
106         }
107
108         public RouteHint[] route_hints() {
109                 number[] ret = bindings.Invoice_route_hints(this.ptr);
110                 RouteHint[] ret_conv_11_arr = new RouteHint[ret.length];
111                 for (int l = 0; l < ret.length; l++) {
112                         number ret_conv_11 = ret[l];
113                         const ret_conv_11_hu_conv: RouteHint = new RouteHint(null, ret_conv_11);
114                         ret_conv_11_hu_conv.ptrs_to.add(this);
115                         ret_conv_11_arr[l] = ret_conv_11_hu_conv;
116                 }
117                 return ret_conv_11_arr;
118         }
119
120         public Currency currency() {
121                 Currency ret = bindings.Invoice_currency(this.ptr);
122                 return ret;
123         }
124
125         public Option_u64Z amount_pico_btc() {
126                 number ret = bindings.Invoice_amount_pico_btc(this.ptr);
127                 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
128                 ret_hu_conv.ptrs_to.add(this);
129                 return ret_hu_conv;
130         }
131
132         public static Result_InvoiceNoneZ constructor_from_str(String s) {
133                 number ret = bindings.Invoice_from_str(s);
134                 Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
135                 return ret_hu_conv;
136         }
137
138         public String to_str() {
139                 String ret = bindings.Invoice_to_str(this.ptr);
140                 return ret;
141         }
142
143 }