X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FOutPoint.ts;h=e2fedfc62f7db40dd615340334bed3f70fe089dc;hb=ebbb6f57d6b5072730fd50ef3a011db1d6577ad9;hp=1ceb657f476c0ff29cb440501094351df4c546af;hpb=acecce750cf1159a51f9d1a4dbfd717520739e92;p=ldk-java diff --git a/ts/structs/OutPoint.ts b/ts/structs/OutPoint.ts index 1ceb657f..e2fedfc6 100644 --- a/ts/structs/OutPoint.ts +++ b/ts/structs/OutPoint.ts @@ -18,12 +18,6 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.OutPoint_free(this.ptr); } } - public OutPoint clone() { - number ret = bindings.OutPoint_clone(this.ptr); - const ret_hu_conv: OutPoint = new OutPoint(null, ret); - return ret_hu_conv; - } - public Uint8Array get_txid() { Uint8Array ret = bindings.OutPoint_get_txid(this.ptr); return ret; @@ -45,9 +39,28 @@ import * as bindings from '../bindings' // TODO: figure out location public static OutPoint constructor_new(Uint8Array txid_arg, number index_arg) { number ret = bindings.OutPoint_new(txid_arg, index_arg); const ret_hu_conv: OutPoint = new OutPoint(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public OutPoint clone() { + number ret = bindings.OutPoint_clone(this.ptr); + const ret_hu_conv: OutPoint = new OutPoint(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public boolean eq(OutPoint b) { + boolean ret = bindings.OutPoint_eq(this.ptr, b == null ? 0 : b.ptr & ~1); + this.ptrs_to.add(b); + return ret; + } + + public number hash() { + number ret = bindings.OutPoint_hash(this.ptr); + return ret; + } + public Uint8Array to_channel_id() { Uint8Array ret = bindings.OutPoint_to_channel_id(this.ptr); return ret; @@ -58,9 +71,9 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } - public static OutPoint constructor_read(Uint8Array ser) { + public static Result_OutPointDecodeErrorZ constructor_read(Uint8Array ser) { number ret = bindings.OutPoint_read(ser); - const ret_hu_conv: OutPoint = new OutPoint(null, ret); + Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }