3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class ChainParameters extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.ChainParameters_free(this.ptr);
21 public LDKNetwork get_network() {
22 LDKNetwork ret = bindings.ChainParameters_get_network(this.ptr);
26 public void set_network(LDKNetwork val) {
27 bindings.ChainParameters_set_network(this.ptr, val);
30 public Uint8Array get_latest_hash() {
31 Uint8Array ret = bindings.ChainParameters_get_latest_hash(this.ptr);
35 public void set_latest_hash(Uint8Array val) {
36 bindings.ChainParameters_set_latest_hash(this.ptr, val);
39 public number get_latest_height() {
40 number ret = bindings.ChainParameters_get_latest_height(this.ptr);
44 public void set_latest_height(number val) {
45 bindings.ChainParameters_set_latest_height(this.ptr, val);
48 public static ChainParameters constructor_new(LDKNetwork network_arg, Uint8Array latest_hash_arg, number latest_height_arg) {
49 number ret = bindings.ChainParameters_new(network_arg, latest_hash_arg, latest_height_arg);
50 const ret_hu_conv: ChainParameters = new ChainParameters(null, ret);
51 ret_hu_conv.ptrs_to.add(ret_hu_conv);