]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/ChainParameters.ts
Merge pull request #14 from TheBlueMatt/2021-03-fix-enums
[ldk-java] / ts / structs / ChainParameters.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 ChainParameters 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.ChainParameters_free(this.ptr);
19                     }
20                 }
21         public LDKNetwork get_network() {
22                 LDKNetwork ret = bindings.ChainParameters_get_network(this.ptr);
23                 return ret;
24         }
25
26         public void set_network(LDKNetwork val) {
27                 bindings.ChainParameters_set_network(this.ptr, val);
28         }
29
30         public Uint8Array get_latest_hash() {
31                 Uint8Array ret = bindings.ChainParameters_get_latest_hash(this.ptr);
32                 return ret;
33         }
34
35         public void set_latest_hash(Uint8Array val) {
36                 bindings.ChainParameters_set_latest_hash(this.ptr, val);
37         }
38
39         public number get_latest_height() {
40                 number ret = bindings.ChainParameters_get_latest_height(this.ptr);
41                 return ret;
42         }
43
44         public void set_latest_height(number val) {
45                 bindings.ChainParameters_set_latest_height(this.ptr, val);
46         }
47
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);
52                 return ret_hu_conv;
53         }
54
55 }