Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public addressFromBytes(bytes: Buffer): Address {
if (bytes.length === 8) {
return `${toBigIntBE(bytes)}R` as Address;
} else {
return bech32.encode(
bytes.slice(0, 4).toString('ascii'),
bytes.slice(4)
) as Address;
}
}