Update auto-generated bindings to 0.0.103
[ldk-java] / ts / structs / Payee.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 Payee 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.Payee_free(this.ptr);
19                     }
20                 }
21         public Uint8Array get_pubkey() {
22                 Uint8Array ret = bindings.Payee_get_pubkey(this.ptr);
23                 return ret;
24         }
25
26         public void set_pubkey(Uint8Array val) {
27                 bindings.Payee_set_pubkey(this.ptr, val);
28         }
29
30         public InvoiceFeatures get_features() {
31                 number ret = bindings.Payee_get_features(this.ptr);
32                 const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
33                 ret_hu_conv.ptrs_to.add(this);
34                 return ret_hu_conv;
35         }
36
37         public void set_features(InvoiceFeatures val) {
38                 bindings.Payee_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
39         }
40
41         public RouteHint[] get_route_hints() {
42                 number[] ret = bindings.Payee_get_route_hints(this.ptr);
43                 RouteHint[] ret_conv_11_arr = new RouteHint[ret.length];
44                 for (int l = 0; l < ret.length; l++) {
45                         number ret_conv_11 = ret[l];
46                         const ret_conv_11_hu_conv: RouteHint = new RouteHint(null, ret_conv_11);
47                         ret_conv_11_hu_conv.ptrs_to.add(this);
48                         ret_conv_11_arr[l] = ret_conv_11_hu_conv;
49                 }
50                 return ret_conv_11_arr;
51         }
52
53         public void set_route_hints(RouteHint[] val) {
54                 bindings.Payee_set_route_hints(this.ptr, val != null ? Arrays.stream(val).map(val_conv_11 -> val_conv_11 == null ? 0 : val_conv_11.ptr & ~1).toArray(number[]::new) : null);
55         }
56
57         public Option_u64Z get_expiry_time() {
58                 number ret = bindings.Payee_get_expiry_time(this.ptr);
59                 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
60                 ret_hu_conv.ptrs_to.add(this);
61                 return ret_hu_conv;
62         }
63
64         public void set_expiry_time(Option_u64Z val) {
65                 bindings.Payee_set_expiry_time(this.ptr, val.ptr);
66         }
67
68         public static Payee constructor_new(Uint8Array pubkey_arg, InvoiceFeatures features_arg, RouteHint[] route_hints_arg, Option_u64Z expiry_time_arg) {
69                 number ret = bindings.Payee_new(pubkey_arg, features_arg == null ? 0 : features_arg.ptr & ~1, route_hints_arg != null ? Arrays.stream(route_hints_arg).map(route_hints_arg_conv_11 -> route_hints_arg_conv_11 == null ? 0 : route_hints_arg_conv_11.ptr & ~1).toArray(number[]::new) : null, expiry_time_arg.ptr);
70                 const ret_hu_conv: Payee = new Payee(null, ret);
71                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
72                 return ret_hu_conv;
73         }
74
75         public Payee clone() {
76                 number ret = bindings.Payee_clone(this.ptr);
77                 const ret_hu_conv: Payee = new Payee(null, ret);
78                 ret_hu_conv.ptrs_to.add(this);
79                 return ret_hu_conv;
80         }
81
82         public number hash() {
83                 number ret = bindings.Payee_hash(this.ptr);
84                 return ret;
85         }
86
87         public boolean eq(Payee b) {
88                 boolean ret = bindings.Payee_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
89                 this.ptrs_to.add(b);
90                 return ret;
91         }
92
93         public Uint8Array write() {
94                 Uint8Array ret = bindings.Payee_write(this.ptr);
95                 return ret;
96         }
97
98         public static Result_PayeeDecodeErrorZ constructor_read(Uint8Array ser) {
99                 number ret = bindings.Payee_read(ser);
100                 Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
101                 return ret_hu_conv;
102         }
103
104         public static Payee constructor_from_node_id(Uint8Array pubkey) {
105                 number ret = bindings.Payee_from_node_id(pubkey);
106                 const ret_hu_conv: Payee = new Payee(null, ret);
107                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
108                 return ret_hu_conv;
109         }
110
111         public static Payee constructor_for_keysend(Uint8Array pubkey) {
112                 number ret = bindings.Payee_for_keysend(pubkey);
113                 const ret_hu_conv: Payee = new Payee(null, ret);
114                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
115                 return ret_hu_conv;
116         }
117
118 }