Update auto-generated bindings
[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(Uint8Array 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 Uint8Array get_data_dir() {
29                 Uint8Array ret = bindings.FilesystemPersister_get_data_dir(this.ptr);
30                 return ret;
31         }
32
33         public static Result_NoneErrorZ constructor_persist_manager(Uint8Array data_dir, ChannelManager manager) {
34                 number ret = bindings.FilesystemPersister_persist_manager(data_dir, manager == null ? 0 : manager.ptr & ~1);
35                 Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
36                 ret_hu_conv.ptrs_to.add(manager);
37                 return ret_hu_conv;
38         }
39
40         public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ read_channelmonitors(KeysInterface keys_manager) {
41                 number ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, keys_manager == null ? 0 : keys_manager.ptr);
42                 Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
43                 this.ptrs_to.add(keys_manager);
44                 return ret_hu_conv;
45         }
46
47         public Persist as_Persist() {
48                 number ret = bindings.FilesystemPersister_as_Persist(this.ptr);
49                 Persist ret_hu_conv = new Persist(null, ret);
50                 ret_hu_conv.ptrs_to.add(this);
51                 return ret_hu_conv;
52         }
53
54 }