Update auto-generated bindings
[ldk-java] / ts / structs / BestBlock.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 BestBlock 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.BestBlock_free(this.ptr);
19                     }
20                 }
21         public number clone_ptr() {
22                 number ret = bindings.BestBlock_clone_ptr(this.ptr);
23                 return ret;
24         }
25
26         public BestBlock clone() {
27                 number ret = bindings.BestBlock_clone(this.ptr);
28                 const ret_hu_conv: BestBlock = new BestBlock(null, ret);
29                 ret_hu_conv.ptrs_to.add(this);
30                 return ret_hu_conv;
31         }
32
33         public static BestBlock constructor_from_genesis(Network network) {
34                 number ret = bindings.BestBlock_from_genesis(network);
35                 const ret_hu_conv: BestBlock = new BestBlock(null, ret);
36                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
37                 return ret_hu_conv;
38         }
39
40         public static BestBlock constructor_new(Uint8Array block_hash, number height) {
41                 number ret = bindings.BestBlock_new(InternalUtils.check_arr_len(block_hash, 32), height);
42                 const ret_hu_conv: BestBlock = new BestBlock(null, ret);
43                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
44                 return ret_hu_conv;
45         }
46
47         public Uint8Array block_hash() {
48                 Uint8Array ret = bindings.BestBlock_block_hash(this.ptr);
49                 return ret;
50         }
51
52         public number height() {
53                 number ret = bindings.BestBlock_height(this.ptr);
54                 return ret;
55         }
56
57 }