3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class BestBlock extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.BestBlock_free(this.ptr);
21 public BestBlock clone() {
22 number ret = bindings.BestBlock_clone(this.ptr);
23 const ret_hu_conv: BestBlock = new BestBlock(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public static BestBlock constructor_from_genesis(LDKNetwork network) {
29 number ret = bindings.BestBlock_from_genesis(network);
30 const ret_hu_conv: BestBlock = new BestBlock(null, ret);
31 ret_hu_conv.ptrs_to.add(ret_hu_conv);
35 public static BestBlock constructor_new(Uint8Array block_hash, number height) {
36 number ret = bindings.BestBlock_new(block_hash, height);
37 const ret_hu_conv: BestBlock = new BestBlock(null, ret);
38 ret_hu_conv.ptrs_to.add(ret_hu_conv);
42 public Uint8Array block_hash() {
43 Uint8Array ret = bindings.BestBlock_block_hash(this.ptr);
47 public number height() {
48 number ret = bindings.BestBlock_height(this.ptr);