]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/FilesystemPersister.ts
Support new cloned upstream API instead of clone
[ldk-java] / ts / structs / FilesystemPersister.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 FilesystemPersister 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.FilesystemPersister_free(this.ptr);
19                     }
20                 }
21         public static FilesystemPersister constructor_new(String path_to_channel_data) {
22                 number ret = bindings.FilesystemPersister_new(path_to_channel_data);
23                 const ret_hu_conv: FilesystemPersister = new FilesystemPersister(null, ret);
24                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
25                 return ret_hu_conv;
26         }
27
28         public String get_data_dir() {
29                 String ret = bindings.FilesystemPersister_get_data_dir(this.ptr);
30                 return ret;
31         }
32
33         public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ read_channelmonitors(KeysInterface keys_manager) {
34                 number ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, keys_manager == null ? 0 : keys_manager.ptr);
35                 Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
36                 this.ptrs_to.add(keys_manager);
37                 return ret_hu_conv;
38         }
39
40         public Persist as_Persist() {
41                 number ret = bindings.FilesystemPersister_as_Persist(this.ptr);
42                 Persist ret_hu_conv = new Persist(null, ret);
43                 ret_hu_conv.ptrs_to.add(this);
44                 return ret_hu_conv;
45         }
46
47 }