]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/NodeInfo.ts
Merge pull request #69 from TheBlueMatt/main
[ldk-java] / ts / structs / NodeInfo.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 NodeInfo 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.NodeInfo_free(this.ptr);
19                     }
20                 }
21         public void set_channels(number[] val) {
22                 bindings.NodeInfo_set_channels(this.ptr, val);
23         }
24
25         public RoutingFees get_lowest_inbound_channel_fees() {
26                 number ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr);
27                 const ret_hu_conv: RoutingFees = new RoutingFees(null, ret);
28                 ret_hu_conv.ptrs_to.add(this);
29                 return ret_hu_conv;
30         }
31
32         public void set_lowest_inbound_channel_fees(RoutingFees val) {
33                 bindings.NodeInfo_set_lowest_inbound_channel_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
34         }
35
36         public NodeAnnouncementInfo get_announcement_info() {
37                 number ret = bindings.NodeInfo_get_announcement_info(this.ptr);
38                 const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret);
39                 ret_hu_conv.ptrs_to.add(this);
40                 return ret_hu_conv;
41         }
42
43         public void set_announcement_info(NodeAnnouncementInfo val) {
44                 bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr & ~1);
45         }
46
47         public static NodeInfo constructor_new(number[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeAnnouncementInfo announcement_info_arg) {
48                 number ret = bindings.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg == null ? 0 : lowest_inbound_channel_fees_arg.ptr & ~1, announcement_info_arg == null ? 0 : announcement_info_arg.ptr & ~1);
49                 const ret_hu_conv: NodeInfo = new NodeInfo(null, ret);
50                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
51                 return ret_hu_conv;
52         }
53
54         public number clone_ptr() {
55                 number ret = bindings.NodeInfo_clone_ptr(this.ptr);
56                 return ret;
57         }
58
59         public NodeInfo clone() {
60                 number ret = bindings.NodeInfo_clone(this.ptr);
61                 const ret_hu_conv: NodeInfo = new NodeInfo(null, ret);
62                 ret_hu_conv.ptrs_to.add(this);
63                 return ret_hu_conv;
64         }
65
66         public Uint8Array write() {
67                 Uint8Array ret = bindings.NodeInfo_write(this.ptr);
68                 return ret;
69         }
70
71         public static Result_NodeInfoDecodeErrorZ constructor_read(Uint8Array ser) {
72                 number ret = bindings.NodeInfo_read(ser);
73                 Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
74                 return ret_hu_conv;
75         }
76
77 }