3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class RouteHop extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.RouteHop_free(this.ptr);
21 public Uint8Array get_pubkey() {
22 Uint8Array ret = bindings.RouteHop_get_pubkey(this.ptr);
26 public void set_pubkey(Uint8Array val) {
27 bindings.RouteHop_set_pubkey(this.ptr, val);
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);
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);
42 public number get_short_channel_id() {
43 number ret = bindings.RouteHop_get_short_channel_id(this.ptr);
47 public void set_short_channel_id(number val) {
48 bindings.RouteHop_set_short_channel_id(this.ptr, val);
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);
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);
63 public number get_fee_msat() {
64 number ret = bindings.RouteHop_get_fee_msat(this.ptr);
68 public void set_fee_msat(number val) {
69 bindings.RouteHop_set_fee_msat(this.ptr, val);
72 public number get_cltv_expiry_delta() {
73 number ret = bindings.RouteHop_get_cltv_expiry_delta(this.ptr);
77 public void set_cltv_expiry_delta(number val) {
78 bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val);
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);
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);