3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class UserConfig extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.UserConfig_free(this.ptr);
21 public ChannelHandshakeConfig get_own_channel_config() {
22 number ret = bindings.UserConfig_get_own_channel_config(this.ptr);
23 const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public void set_own_channel_config(ChannelHandshakeConfig val) {
29 bindings.UserConfig_set_own_channel_config(this.ptr, val == null ? 0 : val.ptr & ~1);
32 public ChannelHandshakeLimits get_peer_channel_config_limits() {
33 number ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr);
34 const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret);
35 ret_hu_conv.ptrs_to.add(this);
39 public void set_peer_channel_config_limits(ChannelHandshakeLimits val) {
40 bindings.UserConfig_set_peer_channel_config_limits(this.ptr, val == null ? 0 : val.ptr & ~1);
43 public ChannelConfig get_channel_options() {
44 number ret = bindings.UserConfig_get_channel_options(this.ptr);
45 const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret);
46 ret_hu_conv.ptrs_to.add(this);
50 public void set_channel_options(ChannelConfig val) {
51 bindings.UserConfig_set_channel_options(this.ptr, val == null ? 0 : val.ptr & ~1);
54 public boolean get_accept_forwards_to_priv_channels() {
55 boolean ret = bindings.UserConfig_get_accept_forwards_to_priv_channels(this.ptr);
59 public void set_accept_forwards_to_priv_channels(boolean val) {
60 bindings.UserConfig_set_accept_forwards_to_priv_channels(this.ptr, val);
63 public boolean get_accept_inbound_channels() {
64 boolean ret = bindings.UserConfig_get_accept_inbound_channels(this.ptr);
68 public void set_accept_inbound_channels(boolean val) {
69 bindings.UserConfig_set_accept_inbound_channels(this.ptr, val);
72 public static UserConfig constructor_new(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg) {
73 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, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg);
74 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
75 ret_hu_conv.ptrs_to.add(ret_hu_conv);
79 public number clone_ptr() {
80 number ret = bindings.UserConfig_clone_ptr(this.ptr);
84 public UserConfig clone() {
85 number ret = bindings.UserConfig_clone(this.ptr);
86 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
87 ret_hu_conv.ptrs_to.add(this);
91 public static UserConfig constructor_default() {
92 number ret = bindings.UserConfig_default();
93 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
94 ret_hu_conv.ptrs_to.add(ret_hu_conv);