X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FRouteHop.ts;h=b3ba3d73695b8e7667bebbf0be8c9bc8401253b6;hb=f95cc8ba7d61d65aa37e6448e6a083edc6e72fc1;hp=6a943251a6123b289cc2177e1bf8998e85818796;hpb=acecce750cf1159a51f9d1a4dbfd717520739e92;p=ldk-java diff --git a/ts/structs/RouteHop.ts b/ts/structs/RouteHop.ts index 6a943251..b3ba3d73 100644 --- a/ts/structs/RouteHop.ts +++ b/ts/structs/RouteHop.ts @@ -18,12 +18,6 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.RouteHop_free(this.ptr); } } - public RouteHop clone() { - number ret = bindings.RouteHop_clone(this.ptr); - const ret_hu_conv: RouteHop = new RouteHop(null, ret); - return ret_hu_conv; - } - public Uint8Array get_pubkey() { Uint8Array ret = bindings.RouteHop_get_pubkey(this.ptr); return ret; @@ -36,12 +30,12 @@ import * as bindings from '../bindings' // TODO: figure out location public NodeFeatures get_node_features() { number ret = bindings.RouteHop_get_node_features(this.ptr); const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } public void set_node_features(NodeFeatures val) { bindings.RouteHop_set_node_features(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } public number get_short_channel_id() { @@ -56,12 +50,12 @@ import * as bindings from '../bindings' // TODO: figure out location public ChannelFeatures get_channel_features() { number ret = bindings.RouteHop_get_channel_features(this.ptr); const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } public void set_channel_features(ChannelFeatures val) { bindings.RouteHop_set_channel_features(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } public number get_fee_msat() { @@ -85,8 +79,36 @@ import * as bindings from '../bindings' // TODO: figure out location 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) { 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); const ret_hu_conv: RouteHop = new RouteHop(null, ret); - ret_hu_conv.ptrs_to.add(node_features_arg); - ret_hu_conv.ptrs_to.add(channel_features_arg); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public RouteHop clone() { + number ret = bindings.RouteHop_clone(this.ptr); + const ret_hu_conv: RouteHop = new RouteHop(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public number hash() { + number ret = bindings.RouteHop_hash(this.ptr); + return ret; + } + + public boolean eq(RouteHop b) { + boolean ret = bindings.RouteHop_eq(this.ptr, b == null ? 0 : b.ptr & ~1); + this.ptrs_to.add(b); + return ret; + } + + public Uint8Array write() { + Uint8Array ret = bindings.RouteHop_write(this.ptr); + return ret; + } + + public static Result_RouteHopDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.RouteHop_read(ser); + Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }