encodeKey method
Encodes a public key or address bytes into a blockchain address.
Throws AddressConverterException on invalid input.
Implementation
@override
String encodeKey(List<int> pubKey, {List<int>? netVersion, String? hrp}) {
hrp = AddrKeyValidator.getAddrArg<String>(hrp, "hrp");
netVersion = AddrKeyValidator.getAddrArg<List<int>>(
netVersion,
"netVersion",
);
final IPublicKey pubKeyObj = AddrKeyValidator.validateAndGetSecp256k1Key(
pubKey,
);
return BchBech32Encoder.encode(
hrp,
netVersion,
_P2SHAddrUtils.addScriptSig(pubKeyObj),
);
}