]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/NetworkGraph.ts
Update auto-generate bindings (incl new RL clone methods)
[ldk-java] / ts / structs / NetworkGraph.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 NetworkGraph 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.NetworkGraph_free(this.ptr);
19                     }
20                 }
21         public NetworkGraph clone() {
22                 number ret = bindings.NetworkGraph_clone(this.ptr);
23                 const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret);
24                 ret_hu_conv.ptrs_to.add(this);
25                 return ret_hu_conv;
26         }
27
28         public Uint8Array write() {
29                 Uint8Array ret = bindings.NetworkGraph_write(this.ptr);
30                 return ret;
31         }
32
33         public static Result_NetworkGraphDecodeErrorZ constructor_read(Uint8Array ser) {
34                 number ret = bindings.NetworkGraph_read(ser);
35                 Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
36                 return ret_hu_conv;
37         }
38
39         public static NetworkGraph constructor_new(Uint8Array genesis_hash) {
40                 number ret = bindings.NetworkGraph_new(genesis_hash);
41                 const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret);
42                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
43                 return ret_hu_conv;
44         }
45
46         public ReadOnlyNetworkGraph read_only() {
47                 number ret = bindings.NetworkGraph_read_only(this.ptr);
48                 const ret_hu_conv: ReadOnlyNetworkGraph = new ReadOnlyNetworkGraph(null, ret);
49                 ret_hu_conv.ptrs_to.add(this);
50                 return ret_hu_conv;
51         }
52
53         public Result_NoneLightningErrorZ update_node_from_announcement(NodeAnnouncement msg) {
54                 number ret = bindings.NetworkGraph_update_node_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
55                 Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
56                 this.ptrs_to.add(msg);
57                 return ret_hu_conv;
58         }
59
60         public Result_NoneLightningErrorZ update_node_from_unsigned_announcement(UnsignedNodeAnnouncement msg) {
61                 number ret = bindings.NetworkGraph_update_node_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
62                 Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
63                 this.ptrs_to.add(msg);
64                 return ret_hu_conv;
65         }
66
67         public Result_NoneLightningErrorZ update_channel_from_announcement(ChannelAnnouncement msg, Option_AccessZ chain_access) {
68                 number ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access.ptr);
69                 Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
70                 this.ptrs_to.add(msg);
71                 return ret_hu_conv;
72         }
73
74         public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(UnsignedChannelAnnouncement msg, Option_AccessZ chain_access) {
75                 number ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access.ptr);
76                 Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
77                 this.ptrs_to.add(msg);
78                 return ret_hu_conv;
79         }
80
81         public void close_channel_from_update(number short_channel_id, boolean is_permanent) {
82                 bindings.NetworkGraph_close_channel_from_update(this.ptr, short_channel_id, is_permanent);
83         }
84
85         public void fail_node(Uint8Array _node_id, boolean is_permanent) {
86                 bindings.NetworkGraph_fail_node(this.ptr, _node_id, is_permanent);
87         }
88
89         public Result_NoneLightningErrorZ update_channel(ChannelUpdate msg) {
90                 number ret = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : msg.ptr & ~1);
91                 Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
92                 this.ptrs_to.add(msg);
93                 return ret_hu_conv;
94         }
95
96         public Result_NoneLightningErrorZ update_channel_unsigned(UnsignedChannelUpdate msg) {
97                 number ret = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg == null ? 0 : msg.ptr & ~1);
98                 Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
99                 this.ptrs_to.add(msg);
100                 return ret_hu_conv;
101         }
102
103 }