]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/NodeAnnouncement.ts
Merge pull request #24 from TheBlueMatt/main
[ldk-java] / ts / structs / NodeAnnouncement.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 NodeAnnouncement 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.NodeAnnouncement_free(this.ptr);
19                     }
20                 }
21         public Uint8Array get_signature() {
22                 Uint8Array ret = bindings.NodeAnnouncement_get_signature(this.ptr);
23                 return ret;
24         }
25
26         public void set_signature(Uint8Array val) {
27                 bindings.NodeAnnouncement_set_signature(this.ptr, val);
28         }
29
30         public UnsignedNodeAnnouncement get_contents() {
31                 number ret = bindings.NodeAnnouncement_get_contents(this.ptr);
32                 const ret_hu_conv: UnsignedNodeAnnouncement = new UnsignedNodeAnnouncement(null, ret);
33                 ret_hu_conv.ptrs_to.add(this);
34                 return ret_hu_conv;
35         }
36
37         public void set_contents(UnsignedNodeAnnouncement val) {
38                 bindings.NodeAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1);
39                 this.ptrs_to.add(val);
40         }
41
42         public static NodeAnnouncement constructor_new(Uint8Array signature_arg, UnsignedNodeAnnouncement contents_arg) {
43                 number ret = bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
44                 const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret);
45                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
46                 ret_hu_conv.ptrs_to.add(contents_arg);
47                 return ret_hu_conv;
48         }
49
50         public NodeAnnouncement clone() {
51                 number ret = bindings.NodeAnnouncement_clone(this.ptr);
52                 const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret);
53                 ret_hu_conv.ptrs_to.add(this);
54                 return ret_hu_conv;
55         }
56
57         public Uint8Array write() {
58                 Uint8Array ret = bindings.NodeAnnouncement_write(this.ptr);
59                 return ret;
60         }
61
62         public static Result_NodeAnnouncementDecodeErrorZ constructor_read(Uint8Array ser) {
63                 number ret = bindings.NodeAnnouncement_read(ser);
64                 Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
65                 return ret_hu_conv;
66         }
67
68 }