Bindings updates
[ldk-java] / ts / structs / ChannelUpdate.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 ChannelUpdate 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.ChannelUpdate_free(this.ptr);
19                     }
20                 }
21         public ChannelUpdate clone() {
22                 number ret = bindings.ChannelUpdate_clone(this.ptr);
23                 const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret);
24                 ret_hu_conv.ptrs_to.add(this);
25                 return ret_hu_conv;
26         }
27
28         public Uint8Array get_signature() {
29                 Uint8Array ret = bindings.ChannelUpdate_get_signature(this.ptr);
30                 return ret;
31         }
32
33         public void set_signature(Uint8Array val) {
34                 bindings.ChannelUpdate_set_signature(this.ptr, val);
35         }
36
37         public UnsignedChannelUpdate get_contents() {
38                 number ret = bindings.ChannelUpdate_get_contents(this.ptr);
39                 const ret_hu_conv: UnsignedChannelUpdate = new UnsignedChannelUpdate(null, ret);
40                 ret_hu_conv.ptrs_to.add(this);
41                 return ret_hu_conv;
42         }
43
44         public void set_contents(UnsignedChannelUpdate val) {
45                 bindings.ChannelUpdate_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1);
46                 this.ptrs_to.add(val);
47         }
48
49         public static ChannelUpdate constructor_new(Uint8Array signature_arg, UnsignedChannelUpdate contents_arg) {
50                 number ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
51                 const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret);
52                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
53                 ret_hu_conv.ptrs_to.add(contents_arg);
54                 return ret_hu_conv;
55         }
56
57         public Uint8Array write() {
58                 Uint8Array ret = bindings.ChannelUpdate_write(this.ptr);
59                 return ret;
60         }
61
62         public static ChannelUpdate constructor_read(Uint8Array ser) {
63                 number ret = bindings.ChannelUpdate_read(ser);
64                 const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret);
65                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
66                 return ret_hu_conv;
67         }
68
69 }