Update auto-generated bindings
[ldk-java] / ts / structs / NodeId.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 NodeId 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.NodeId_free(this.ptr);
19                     }
20                 }
21         public number clone_ptr() {
22                 number ret = bindings.NodeId_clone_ptr(this.ptr);
23                 return ret;
24         }
25
26         public NodeId clone() {
27                 number ret = bindings.NodeId_clone(this.ptr);
28                 const ret_hu_conv: NodeId = new NodeId(null, ret);
29                 ret_hu_conv.ptrs_to.add(this);
30                 return ret_hu_conv;
31         }
32
33         public static NodeId constructor_from_pubkey(Uint8Array pubkey) {
34                 number ret = bindings.NodeId_from_pubkey(InternalUtils.check_arr_len(pubkey, 33));
35                 const ret_hu_conv: NodeId = new NodeId(null, ret);
36                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
37                 return ret_hu_conv;
38         }
39
40         public Uint8Array as_slice() {
41                 Uint8Array ret = bindings.NodeId_as_slice(this.ptr);
42                 return ret;
43         }
44
45         public number hash() {
46                 number ret = bindings.NodeId_hash(this.ptr);
47                 return ret;
48         }
49
50         public Uint8Array write() {
51                 Uint8Array ret = bindings.NodeId_write(this.ptr);
52                 return ret;
53         }
54
55         public static Result_NodeIdDecodeErrorZ constructor_read(Uint8Array ser) {
56                 number ret = bindings.NodeId_read(ser);
57                 Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret);
58                 return ret_hu_conv;
59         }
60
61 }