]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/RouteHop.ts
Merge pull request #17 from TheBlueMatt/main
[ldk-java] / ts / structs / RouteHop.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 RouteHop 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.RouteHop_free(this.ptr);
19                     }
20                 }
21         public Uint8Array get_pubkey() {
22                 Uint8Array ret = bindings.RouteHop_get_pubkey(this.ptr);
23                 return ret;
24         }
25
26         public void set_pubkey(Uint8Array val) {
27                 bindings.RouteHop_set_pubkey(this.ptr, val);
28         }
29
30         public NodeFeatures get_node_features() {
31                 number ret = bindings.RouteHop_get_node_features(this.ptr);
32                 const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret);
33                 ret_hu_conv.ptrs_to.add(this);
34                 return ret_hu_conv;
35         }
36
37         public void set_node_features(NodeFeatures val) {
38                 bindings.RouteHop_set_node_features(this.ptr, val == null ? 0 : val.ptr & ~1);
39                 this.ptrs_to.add(val);
40         }
41
42         public number get_short_channel_id() {
43                 number ret = bindings.RouteHop_get_short_channel_id(this.ptr);
44                 return ret;
45         }
46
47         public void set_short_channel_id(number val) {
48                 bindings.RouteHop_set_short_channel_id(this.ptr, val);
49         }
50
51         public ChannelFeatures get_channel_features() {
52                 number ret = bindings.RouteHop_get_channel_features(this.ptr);
53                 const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret);
54                 ret_hu_conv.ptrs_to.add(this);
55                 return ret_hu_conv;
56         }
57
58         public void set_channel_features(ChannelFeatures val) {
59                 bindings.RouteHop_set_channel_features(this.ptr, val == null ? 0 : val.ptr & ~1);
60                 this.ptrs_to.add(val);
61         }
62
63         public number get_fee_msat() {
64                 number ret = bindings.RouteHop_get_fee_msat(this.ptr);
65                 return ret;
66         }
67
68         public void set_fee_msat(number val) {
69                 bindings.RouteHop_set_fee_msat(this.ptr, val);
70         }
71
72         public number get_cltv_expiry_delta() {
73                 number ret = bindings.RouteHop_get_cltv_expiry_delta(this.ptr);
74                 return ret;
75         }
76
77         public void set_cltv_expiry_delta(number val) {
78                 bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val);
79         }
80
81         public static RouteHop constructor_new(Uint8Array pubkey_arg, NodeFeatures node_features_arg, number short_channel_id_arg, ChannelFeatures channel_features_arg, number fee_msat_arg, number cltv_expiry_delta_arg) {
82                 number ret = bindings.RouteHop_new(pubkey_arg, node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg);
83                 const ret_hu_conv: RouteHop = new RouteHop(null, ret);
84                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
85                 ret_hu_conv.ptrs_to.add(node_features_arg);
86                 ret_hu_conv.ptrs_to.add(channel_features_arg);
87                 return ret_hu_conv;
88         }
89
90         public RouteHop clone() {
91                 number ret = bindings.RouteHop_clone(this.ptr);
92                 const ret_hu_conv: RouteHop = new RouteHop(null, ret);
93                 ret_hu_conv.ptrs_to.add(this);
94                 return ret_hu_conv;
95         }
96
97 }