]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/UnsignedNodeAnnouncement.ts
Use uint64_t instead of long for pointers represented in C
[ldk-java] / ts / structs / UnsignedNodeAnnouncement.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 UnsignedNodeAnnouncement 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.UnsignedNodeAnnouncement_free(this.ptr);
19                     }
20                 }
21         public NodeFeatures get_features() {
22                 number ret = bindings.UnsignedNodeAnnouncement_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.UnsignedNodeAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
30                 this.ptrs_to.add(val);
31         }
32
33         public number get_timestamp() {
34                 number ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr);
35                 return ret;
36         }
37
38         public void set_timestamp(number val) {
39                 bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val);
40         }
41
42         public Uint8Array get_node_id() {
43                 Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr);
44                 return ret;
45         }
46
47         public void set_node_id(Uint8Array val) {
48                 bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val);
49         }
50
51         public Uint8Array get_rgb() {
52                 Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr);
53                 return ret;
54         }
55
56         public void set_rgb(Uint8Array val) {
57                 bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, val);
58         }
59
60         public Uint8Array get_alias() {
61                 Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr);
62                 return ret;
63         }
64
65         public void set_alias(Uint8Array val) {
66                 bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val);
67         }
68
69         public void set_addresses(NetAddress[] val) {
70                 bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).map(val_conv_12 -> val_conv_12.ptr).toArray(number[]::new));
71                 /* TODO 2 NetAddress  */;
72         }
73
74         public UnsignedNodeAnnouncement clone() {
75                 number ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr);
76                 const ret_hu_conv: UnsignedNodeAnnouncement = new UnsignedNodeAnnouncement(null, ret);
77                 ret_hu_conv.ptrs_to.add(this);
78                 return ret_hu_conv;
79         }
80
81         public Uint8Array write() {
82                 Uint8Array ret = bindings.UnsignedNodeAnnouncement_write(this.ptr);
83                 return ret;
84         }
85
86         public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor_read(Uint8Array ser) {
87                 number ret = bindings.UnsignedNodeAnnouncement_read(ser);
88                 Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
89                 return ret_hu_conv;
90         }
91
92 }