encodeKey method

  1. @override
String encodeKey(
  1. List<int> pubKey, {
  2. int? ss58Format,
})
override

Encodes pubKey (blake2b-256 hashed) as an SS58 address using ss58Format.

Implementation

@override
String encodeKey(List<int> pubKey, {int? ss58Format}) {
  ss58Format = AddrKeyValidator.getAddrArg<int>(ss58Format, "ss58Format");
  final key = AddrKeyValidator.validateAndGetSecp256k1Key(pubKey);
  return _SubstrateAddrUtils.encode(
    QuickCrypto.blake2b256Hash(key.toBytes(mode: CryptoKeyEncoding.base)),
    ss58Format,
  );
}