encodeKey method
This method is used to create an Aptos SingleKey
address from Sec256k1
public key.
Implementation
@override
String encodeKey(List<int> pubKey, [Map<String, dynamic> kwargs = const {}]) {
final publicKey = AddrKeyValidator.validateAndGetSecp256k1Key(pubKey);
final addressBytes = AptosAddressUtils.encodeSingleKey(publicKey);
/// Concatenate the address prefix and the hash bytes, removing leading zeros
return BytesUtils.toHexString(addressBytes,
prefix: CoinsConf.aptos.params.addrPrefix);
}