Update auto-generated bindings
[ldk-java] / ts / structs / RawInvoice.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 RawInvoice 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.RawInvoice_free(this.ptr);
19                     }
20                 }
21         public RawDataPart get_data() {
22                 number ret = bindings.RawInvoice_get_data(this.ptr);
23                 const ret_hu_conv: RawDataPart = new RawDataPart(null, ret);
24                 ret_hu_conv.ptrs_to.add(this);
25                 return ret_hu_conv;
26         }
27
28         public void set_data(RawDataPart val) {
29                 bindings.RawInvoice_set_data(this.ptr, val == null ? 0 : val.ptr & ~1);
30         }
31
32         public boolean eq(RawInvoice b) {
33                 boolean ret = bindings.RawInvoice_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
34                 this.ptrs_to.add(b);
35                 return ret;
36         }
37
38         public number clone_ptr() {
39                 number ret = bindings.RawInvoice_clone_ptr(this.ptr);
40                 return ret;
41         }
42
43         public RawInvoice clone() {
44                 number ret = bindings.RawInvoice_clone(this.ptr);
45                 const ret_hu_conv: RawInvoice = new RawInvoice(null, ret);
46                 ret_hu_conv.ptrs_to.add(this);
47                 return ret_hu_conv;
48         }
49
50         public Uint8Array hash() {
51                 Uint8Array ret = bindings.RawInvoice_hash(this.ptr);
52                 return ret;
53         }
54
55         public Sha256 payment_hash() {
56                 number ret = bindings.RawInvoice_payment_hash(this.ptr);
57                 const ret_hu_conv: Sha256 = new Sha256(null, ret);
58                 ret_hu_conv.ptrs_to.add(this);
59                 return ret_hu_conv;
60         }
61
62         public Description description() {
63                 number ret = bindings.RawInvoice_description(this.ptr);
64                 const ret_hu_conv: Description = new Description(null, ret);
65                 ret_hu_conv.ptrs_to.add(this);
66                 return ret_hu_conv;
67         }
68
69         public PayeePubKey payee_pub_key() {
70                 number ret = bindings.RawInvoice_payee_pub_key(this.ptr);
71                 const ret_hu_conv: PayeePubKey = new PayeePubKey(null, ret);
72                 ret_hu_conv.ptrs_to.add(this);
73                 return ret_hu_conv;
74         }
75
76         public Sha256 description_hash() {
77                 number ret = bindings.RawInvoice_description_hash(this.ptr);
78                 const ret_hu_conv: Sha256 = new Sha256(null, ret);
79                 ret_hu_conv.ptrs_to.add(this);
80                 return ret_hu_conv;
81         }
82
83         public ExpiryTime expiry_time() {
84                 number ret = bindings.RawInvoice_expiry_time(this.ptr);
85                 const ret_hu_conv: ExpiryTime = new ExpiryTime(null, ret);
86                 ret_hu_conv.ptrs_to.add(this);
87                 return ret_hu_conv;
88         }
89
90         public MinFinalCltvExpiry min_final_cltv_expiry() {
91                 number ret = bindings.RawInvoice_min_final_cltv_expiry(this.ptr);
92                 const ret_hu_conv: MinFinalCltvExpiry = new MinFinalCltvExpiry(null, ret);
93                 ret_hu_conv.ptrs_to.add(this);
94                 return ret_hu_conv;
95         }
96
97         public Uint8Array payment_secret() {
98                 Uint8Array ret = bindings.RawInvoice_payment_secret(this.ptr);
99                 return ret;
100         }
101
102         public InvoiceFeatures features() {
103                 number ret = bindings.RawInvoice_features(this.ptr);
104                 const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
105                 ret_hu_conv.ptrs_to.add(this);
106                 return ret_hu_conv;
107         }
108
109         public PrivateRoute[] private_routes() {
110                 number[] ret = bindings.RawInvoice_private_routes(this.ptr);
111                 PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret.length];
112                 for (int o = 0; o < ret.length; o++) {
113                         number ret_conv_14 = ret[o];
114                         const ret_conv_14_hu_conv: PrivateRoute = new PrivateRoute(null, ret_conv_14);
115                         ret_conv_14_hu_conv.ptrs_to.add(this);
116                         ret_conv_14_arr[o] = ret_conv_14_hu_conv;
117                 }
118                 return ret_conv_14_arr;
119         }
120
121         public Option_u64Z amount_pico_btc() {
122                 number ret = bindings.RawInvoice_amount_pico_btc(this.ptr);
123                 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
124                 ret_hu_conv.ptrs_to.add(this);
125                 return ret_hu_conv;
126         }
127
128         public Currency currency() {
129                 Currency ret = bindings.RawInvoice_currency(this.ptr);
130                 return ret;
131         }
132
133 }