3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class NodeInfo extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.NodeInfo_free(this.ptr);
21 public NodeInfo clone() {
22 number ret = bindings.NodeInfo_clone(this.ptr);
23 const ret_hu_conv: NodeInfo = new NodeInfo(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public void set_channels(number[] val) {
29 bindings.NodeInfo_set_channels(this.ptr, val);
32 public RoutingFees get_lowest_inbound_channel_fees() {
33 number ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr);
34 const ret_hu_conv: RoutingFees = new RoutingFees(null, ret);
35 ret_hu_conv.ptrs_to.add(this);
39 public void set_lowest_inbound_channel_fees(RoutingFees val) {
40 bindings.NodeInfo_set_lowest_inbound_channel_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
41 this.ptrs_to.add(val);
44 public NodeAnnouncementInfo get_announcement_info() {
45 number ret = bindings.NodeInfo_get_announcement_info(this.ptr);
46 const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret);
47 ret_hu_conv.ptrs_to.add(this);
51 public void set_announcement_info(NodeAnnouncementInfo val) {
52 bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr & ~1);
53 this.ptrs_to.add(val);
56 public static NodeInfo constructor_new(number[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeAnnouncementInfo announcement_info_arg) {
57 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);
58 const ret_hu_conv: NodeInfo = new NodeInfo(null, ret);
59 ret_hu_conv.ptrs_to.add(ret_hu_conv);
60 ret_hu_conv.ptrs_to.add(lowest_inbound_channel_fees_arg);
61 ret_hu_conv.ptrs_to.add(announcement_info_arg);
65 public Uint8Array write() {
66 Uint8Array ret = bindings.NodeInfo_write(this.ptr);
70 public static Result_NodeInfoDecodeErrorZ constructor_read(Uint8Array ser) {
71 number ret = bindings.NodeInfo_read(ser);
72 Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);