]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/NodeAnnouncementInfo.ts
Merge pull request #2 from TheBlueMatt/main
[ldk-java] / ts / structs / NodeAnnouncementInfo.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 NodeAnnouncementInfo 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.NodeAnnouncementInfo_free(this.ptr);
19                     }
20                 }
21         public NodeFeatures get_features() {
22                 number ret = bindings.NodeAnnouncementInfo_get_features(this.ptr);
23                 const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret);
24                 ret_hu_conv.ptrs_to.add(this);
25                 return ret_hu_conv;
26         }
27
28         public void set_features(NodeFeatures val) {
29                 bindings.NodeAnnouncementInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
30                 this.ptrs_to.add(val);
31         }
32
33         public number get_last_update() {
34                 number ret = bindings.NodeAnnouncementInfo_get_last_update(this.ptr);
35                 return ret;
36         }
37
38         public void set_last_update(number val) {
39                 bindings.NodeAnnouncementInfo_set_last_update(this.ptr, val);
40         }
41
42         public Uint8Array get_rgb() {
43                 Uint8Array ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr);
44                 return ret;
45         }
46
47         public void set_rgb(Uint8Array val) {
48                 bindings.NodeAnnouncementInfo_set_rgb(this.ptr, val);
49         }
50
51         public Uint8Array get_alias() {
52                 Uint8Array ret = bindings.NodeAnnouncementInfo_get_alias(this.ptr);
53                 return ret;
54         }
55
56         public void set_alias(Uint8Array val) {
57                 bindings.NodeAnnouncementInfo_set_alias(this.ptr, val);
58         }
59
60         public void set_addresses(NetAddress[] val) {
61                 bindings.NodeAnnouncementInfo_set_addresses(this.ptr, Arrays.stream(val).map(val_conv_12 -> val_conv_12.ptr).toArray(number[]::new));
62                 /* TODO 2 NetAddress  */;
63         }
64
65         public NodeAnnouncement get_announcement_message() {
66                 number ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr);
67                 const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret);
68                 ret_hu_conv.ptrs_to.add(this);
69                 return ret_hu_conv;
70         }
71
72         public void set_announcement_message(NodeAnnouncement val) {
73                 bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
74                 this.ptrs_to.add(val);
75         }
76
77         public static NodeAnnouncementInfo constructor_new(NodeFeatures features_arg, number last_update_arg, Uint8Array rgb_arg, Uint8Array alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) {
78                 number ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, Arrays.stream(addresses_arg).map(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray(number[]::new), announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
79                 const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret);
80                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
81                 ret_hu_conv.ptrs_to.add(features_arg);
82                 /* TODO 2 NetAddress  */;
83                 ret_hu_conv.ptrs_to.add(announcement_message_arg);
84                 return ret_hu_conv;
85         }
86
87         public NodeAnnouncementInfo clone() {
88                 number ret = bindings.NodeAnnouncementInfo_clone(this.ptr);
89                 const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret);
90                 ret_hu_conv.ptrs_to.add(this);
91                 return ret_hu_conv;
92         }
93
94         public Uint8Array write() {
95                 Uint8Array ret = bindings.NodeAnnouncementInfo_write(this.ptr);
96                 return ret;
97         }
98
99         public static Result_NodeAnnouncementInfoDecodeErrorZ constructor_read(Uint8Array ser) {
100                 number ret = bindings.NodeAnnouncementInfo_read(ser);
101                 Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
102                 return ret_hu_conv;
103         }
104
105 }