]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/UserConfig.ts
Merge pull request #69 from TheBlueMatt/main
[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 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);
25                 return ret_hu_conv;
26         }
27
28         public void set_own_channel_config(ChannelHandshakeConfig val) {
29                 bindings.UserConfig_set_own_channel_config(this.ptr, val == null ? 0 : val.ptr & ~1);
30         }
31
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);
36                 return ret_hu_conv;
37         }
38
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);
41         }
42
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);
47                 return ret_hu_conv;
48         }
49
50         public void set_channel_options(ChannelConfig val) {
51                 bindings.UserConfig_set_channel_options(this.ptr, val == null ? 0 : val.ptr & ~1);
52         }
53
54         public boolean get_accept_forwards_to_priv_channels() {
55                 boolean ret = bindings.UserConfig_get_accept_forwards_to_priv_channels(this.ptr);
56                 return ret;
57         }
58
59         public void set_accept_forwards_to_priv_channels(boolean val) {
60                 bindings.UserConfig_set_accept_forwards_to_priv_channels(this.ptr, val);
61         }
62
63         public boolean get_accept_inbound_channels() {
64                 boolean ret = bindings.UserConfig_get_accept_inbound_channels(this.ptr);
65                 return ret;
66         }
67
68         public void set_accept_inbound_channels(boolean val) {
69                 bindings.UserConfig_set_accept_inbound_channels(this.ptr, val);
70         }
71
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);
76                 return ret_hu_conv;
77         }
78
79         public number clone_ptr() {
80                 number ret = bindings.UserConfig_clone_ptr(this.ptr);
81                 return ret;
82         }
83
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);
88                 return ret_hu_conv;
89         }
90
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);
95                 return ret_hu_conv;
96         }
97
98 }