Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static deserializeWireBase({ reader }: DeserializeWireBaseOptions): NetworkAddress {
const timestamp = reader.readUInt32LE();
const services = reader.readUInt64LE();
const address = Address6.fromByteArray([...reader.readBytes(16)]) as Address6 | undefined | null;
const port = reader.readUInt16BE();
const canonical = address == undefined ? '' : (address.canonicalForm() as string | undefined | null);
return new this({
timestamp,
services,
host: canonical == undefined ? '' : canonical,
port,
});
}