3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class UnsignedNodeAnnouncement extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.UnsignedNodeAnnouncement_free(this.ptr);
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);
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);
33 public number get_timestamp() {
34 number ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr);
38 public void set_timestamp(number val) {
39 bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val);
42 public Uint8Array get_node_id() {
43 Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr);
47 public void set_node_id(Uint8Array val) {
48 bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val);
51 public Uint8Array get_rgb() {
52 Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr);
56 public void set_rgb(Uint8Array val) {
57 bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, val);
60 public Uint8Array get_alias() {
61 Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr);
65 public void set_alias(Uint8Array val) {
66 bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val);
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 */;
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);
81 public Uint8Array write() {
82 Uint8Array ret = bindings.UnsignedNodeAnnouncement_write(this.ptr);
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);