3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class NodeAnnouncement extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.NodeAnnouncement_free(this.ptr);
21 public NodeAnnouncement clone() {
22 number ret = bindings.NodeAnnouncement_clone(this.ptr);
23 const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public Uint8Array get_signature() {
29 Uint8Array ret = bindings.NodeAnnouncement_get_signature(this.ptr);
33 public void set_signature(Uint8Array val) {
34 bindings.NodeAnnouncement_set_signature(this.ptr, val);
37 public UnsignedNodeAnnouncement get_contents() {
38 number ret = bindings.NodeAnnouncement_get_contents(this.ptr);
39 const ret_hu_conv: UnsignedNodeAnnouncement = new UnsignedNodeAnnouncement(null, ret);
40 ret_hu_conv.ptrs_to.add(this);
44 public void set_contents(UnsignedNodeAnnouncement val) {
45 bindings.NodeAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1);
46 this.ptrs_to.add(val);
49 public static NodeAnnouncement constructor_new(Uint8Array signature_arg, UnsignedNodeAnnouncement contents_arg) {
50 number ret = bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
51 const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret);
52 ret_hu_conv.ptrs_to.add(ret_hu_conv);
53 ret_hu_conv.ptrs_to.add(contents_arg);
57 public Uint8Array write() {
58 Uint8Array ret = bindings.NodeAnnouncement_write(this.ptr);
62 public static NodeAnnouncement constructor_read(Uint8Array ser) {
63 number ret = bindings.NodeAnnouncement_read(ser);
64 const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret);
65 ret_hu_conv.ptrs_to.add(ret_hu_conv);