encodeSingleKey method

String encodeSingleKey(
  1. IPublicKey pubKey
)

This method is used to create an Aptos SingleKey address from (ED25519, Sec256k1) public key.

Implementation

String encodeSingleKey(IPublicKey pubKey) {
  final addressBytes = AptosAddressUtils.encodeSingleKey(pubKey);

  /// Concatenate the address prefix and the hash bytes, removing leading zeros
  return BytesUtils.toHexString(addressBytes,
      prefix: CoinsConf.aptos.params.addrPrefix);
}