Bindings updates
[ldk-java] / ts / structs / UserConfig.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 UserConfig 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.UserConfig_free(this.ptr);
19                     }
20                 }
21         public UserConfig clone() {
22                 number ret = bindings.UserConfig_clone(this.ptr);
23                 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
24                 return ret_hu_conv;
25         }
26
27         public ChannelHandshakeConfig get_own_channel_config() {
28                 number ret = bindings.UserConfig_get_own_channel_config(this.ptr);
29                 const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret);
30                 return ret_hu_conv;
31         }
32
33         public void set_own_channel_config(ChannelHandshakeConfig val) {
34                 bindings.UserConfig_set_own_channel_config(this.ptr, val == null ? 0 : val.ptr & ~1);
35                 this.ptrs_to.add(val);
36         }
37
38         public ChannelHandshakeLimits get_peer_channel_config_limits() {
39                 number ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr);
40                 const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret);
41                 return ret_hu_conv;
42         }
43
44         public void set_peer_channel_config_limits(ChannelHandshakeLimits val) {
45                 bindings.UserConfig_set_peer_channel_config_limits(this.ptr, val == null ? 0 : val.ptr & ~1);
46                 this.ptrs_to.add(val);
47         }
48
49         public ChannelConfig get_channel_options() {
50                 number ret = bindings.UserConfig_get_channel_options(this.ptr);
51                 const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret);
52                 return ret_hu_conv;
53         }
54
55         public void set_channel_options(ChannelConfig val) {
56                 bindings.UserConfig_set_channel_options(this.ptr, val == null ? 0 : val.ptr & ~1);
57                 this.ptrs_to.add(val);
58         }
59
60         public static UserConfig constructor_new(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg) {
61                 number ret = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1);
62                 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
63                 ret_hu_conv.ptrs_to.add(own_channel_config_arg);
64                 ret_hu_conv.ptrs_to.add(peer_channel_config_limits_arg);
65                 ret_hu_conv.ptrs_to.add(channel_options_arg);
66                 return ret_hu_conv;
67         }
68
69         public static UserConfig constructor_default() {
70                 number ret = bindings.UserConfig_default();
71                 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
72                 return ret_hu_conv;
73         }
74
75 }