Update auto-generated bindings
[ldk-java] / ts / structs / DirectionalChannelInfo.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 DirectionalChannelInfo 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.DirectionalChannelInfo_free(this.ptr);
19                     }
20                 }
21         public number get_last_update() {
22                 number ret = bindings.DirectionalChannelInfo_get_last_update(this.ptr);
23                 return ret;
24         }
25
26         public void set_last_update(number val) {
27                 bindings.DirectionalChannelInfo_set_last_update(this.ptr, val);
28         }
29
30         public boolean get_enabled() {
31                 boolean ret = bindings.DirectionalChannelInfo_get_enabled(this.ptr);
32                 return ret;
33         }
34
35         public void set_enabled(boolean val) {
36                 bindings.DirectionalChannelInfo_set_enabled(this.ptr, val);
37         }
38
39         public number get_cltv_expiry_delta() {
40                 number ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this.ptr);
41                 return ret;
42         }
43
44         public void set_cltv_expiry_delta(number val) {
45                 bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this.ptr, val);
46         }
47
48         public number get_htlc_minimum_msat() {
49                 number ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this.ptr);
50                 return ret;
51         }
52
53         public void set_htlc_minimum_msat(number val) {
54                 bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val);
55         }
56
57         public Option_u64Z get_htlc_maximum_msat() {
58                 number ret = bindings.DirectionalChannelInfo_get_htlc_maximum_msat(this.ptr);
59                 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
60                 ret_hu_conv.ptrs_to.add(this);
61                 return ret_hu_conv;
62         }
63
64         public void set_htlc_maximum_msat(Option_u64Z val) {
65                 bindings.DirectionalChannelInfo_set_htlc_maximum_msat(this.ptr, val.ptr);
66         }
67
68         public RoutingFees get_fees() {
69                 number ret = bindings.DirectionalChannelInfo_get_fees(this.ptr);
70                 const ret_hu_conv: RoutingFees = new RoutingFees(null, ret);
71                 ret_hu_conv.ptrs_to.add(this);
72                 return ret_hu_conv;
73         }
74
75         public void set_fees(RoutingFees val) {
76                 bindings.DirectionalChannelInfo_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
77                 this.ptrs_to.add(val);
78         }
79
80         public ChannelUpdate get_last_update_message() {
81                 number ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr);
82                 const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret);
83                 ret_hu_conv.ptrs_to.add(this);
84                 return ret_hu_conv;
85         }
86
87         public void set_last_update_message(ChannelUpdate val) {
88                 bindings.DirectionalChannelInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr & ~1);
89                 this.ptrs_to.add(val);
90         }
91
92         public static DirectionalChannelInfo constructor_new(number last_update_arg, boolean enabled_arg, number cltv_expiry_delta_arg, number htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg, RoutingFees fees_arg, ChannelUpdate last_update_message_arg) {
93                 number ret = bindings.DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg.ptr, fees_arg == null ? 0 : fees_arg.ptr & ~1, last_update_message_arg == null ? 0 : last_update_message_arg.ptr & ~1);
94                 const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret);
95                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
96                 ret_hu_conv.ptrs_to.add(fees_arg);
97                 ret_hu_conv.ptrs_to.add(last_update_message_arg);
98                 return ret_hu_conv;
99         }
100
101         public DirectionalChannelInfo clone() {
102                 number ret = bindings.DirectionalChannelInfo_clone(this.ptr);
103                 const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret);
104                 ret_hu_conv.ptrs_to.add(this);
105                 return ret_hu_conv;
106         }
107
108         public Uint8Array write() {
109                 Uint8Array ret = bindings.DirectionalChannelInfo_write(this.ptr);
110                 return ret;
111         }
112
113         public static Result_DirectionalChannelInfoDecodeErrorZ constructor_read(Uint8Array ser) {
114                 number ret = bindings.DirectionalChannelInfo_read(ser);
115                 Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
116                 return ret_hu_conv;
117         }
118
119 }