X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FNetAddress.ts;h=2910201adc8213475e89a9cfd404fb73f48bbb8a;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=3de3d2eff2ff75d90a671cfda2a192739ef4e1d6;hpb=acecce750cf1159a51f9d1a4dbfd717520739e92;p=ldk-java diff --git a/ts/structs/NetAddress.ts b/ts/structs/NetAddress.ts index 3de3d2ef..2910201a 100644 --- a/ts/structs/NetAddress.ts +++ b/ts/structs/NetAddress.ts @@ -65,4 +65,56 @@ export class OnionV3 extends NetAddress { this.version = obj.version; this.port = obj.port; } +} + public number clone_ptr() { + number ret = bindings.NetAddress_clone_ptr(this.ptr); + return ret; + } + + public NetAddress clone() { + number ret = bindings.NetAddress_clone(this.ptr); + NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public static NetAddress constructor_ipv4(Uint8Array addr, number port) { + number ret = bindings.NetAddress_ipv4(InternalUtils.check_arr_len(addr, 4), port); + NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static NetAddress constructor_ipv6(Uint8Array addr, number port) { + number ret = bindings.NetAddress_ipv6(InternalUtils.check_arr_len(addr, 16), port); + NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static NetAddress constructor_onion_v2(Uint8Array addr, number port) { + number ret = bindings.NetAddress_onion_v2(InternalUtils.check_arr_len(addr, 10), port); + NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static NetAddress constructor_onion_v3(Uint8Array ed25519_pubkey, number checksum, number version, number port) { + number ret = bindings.NetAddress_onion_v3(InternalUtils.check_arr_len(ed25519_pubkey, 32), checksum, version, port); + NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public Uint8Array write() { + Uint8Array ret = bindings.NetAddress_write(this.ptr); + return ret; + } + + public static Result_NetAddressDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.NetAddress_read(ser); + Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + }