toSuiAddress method

  1. @override
String toSuiAddress()
override

Return the Sui address associated with this Ed25519 public key

Implementation

@override
String toSuiAddress() {
  final tmp = Uint8List(PUBLIC_KEY_SIZE + 1);
  tmp[0] = SIGNATURE_SCHEME_TO_FLAG.Ed25519;
  tmp.setAll(1, toRawBytes());
  final publicKey = Hex.encode(blake2b(tmp));
  return normalizeSuiAddress(publicKey.substring(0, SUI_ADDRESS_LENGTH * 2));
}