]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/NetGraphMsgHandler.ts
bindings updates
[ldk-java] / ts / structs / NetGraphMsgHandler.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 NetGraphMsgHandler 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.NetGraphMsgHandler_free(this.ptr);
19                     }
20                 }
21         public static NetGraphMsgHandler constructor_new(Uint8Array genesis_hash, Access chain_access, Logger logger) {
22                 number ret = bindings.NetGraphMsgHandler_new(genesis_hash, chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr);
23                 const ret_hu_conv: NetGraphMsgHandler = new NetGraphMsgHandler(null, ret);
24                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
25                 ret_hu_conv.ptrs_to.add(chain_access);
26                 ret_hu_conv.ptrs_to.add(logger);
27                 return ret_hu_conv;
28         }
29
30         public static NetGraphMsgHandler constructor_from_net_graph(Access chain_access, Logger logger, Uint8Array network_graph_genesis_hash) {
31                 number ret = bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, bindings.NetworkGraph_new(network_graph_genesis_hash));
32                 const ret_hu_conv: NetGraphMsgHandler = new NetGraphMsgHandler(null, ret);
33                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
34                 ret_hu_conv.ptrs_to.add(chain_access);
35                 ret_hu_conv.ptrs_to.add(logger);
36                 return ret_hu_conv;
37         }
38
39         public LockedNetworkGraph read_locked_graph() {
40                 number ret = bindings.NetGraphMsgHandler_read_locked_graph(this.ptr);
41                 const ret_hu_conv: LockedNetworkGraph = new LockedNetworkGraph(null, ret);
42                 ret_hu_conv.ptrs_to.add(this);
43                 return ret_hu_conv;
44         }
45
46         public RoutingMessageHandler as_RoutingMessageHandler() {
47                 number ret = bindings.NetGraphMsgHandler_as_RoutingMessageHandler(this.ptr);
48                 RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
49                 ret_hu_conv.ptrs_to.add(this);
50                 return ret_hu_conv;
51         }
52
53         public MessageSendEventsProvider as_MessageSendEventsProvider() {
54                 number ret = bindings.NetGraphMsgHandler_as_MessageSendEventsProvider(this.ptr);
55                 MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
56                 ret_hu_conv.ptrs_to.add(this);
57                 return ret_hu_conv;
58         }
59
60 }