]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/KeysManager.ts
bindings updates
[ldk-java] / ts / structs / KeysManager.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 KeysManager 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.KeysManager_free(this.ptr);
19                     }
20                 }
21         public static KeysManager constructor_new(Uint8Array seed, LDKNetwork network, number starting_time_secs, number starting_time_nanos) {
22                 number ret = bindings.KeysManager_new(seed, network, starting_time_secs, starting_time_nanos);
23                 const ret_hu_conv: KeysManager = new KeysManager(null, ret);
24                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
25                 return ret_hu_conv;
26         }
27
28         public InMemoryChannelKeys derive_channel_keys(number channel_value_satoshis, number params_1, number params_2) {
29                 number ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params_1, params_2);
30                 const ret_hu_conv: InMemoryChannelKeys = new InMemoryChannelKeys(null, ret);
31                 ret_hu_conv.ptrs_to.add(this);
32                 return ret_hu_conv;
33         }
34
35         public KeysInterface as_KeysInterface() {
36                 number ret = bindings.KeysManager_as_KeysInterface(this.ptr);
37                 KeysInterface ret_hu_conv = new KeysInterface(null, ret);
38                 ret_hu_conv.ptrs_to.add(this);
39                 return ret_hu_conv;
40         }
41
42 }