ed25519AccountFromHex static method

Ed25519Account ed25519AccountFromHex(
  1. HexInput hex
)

Deserializes an Ed25519Account from hex.

Throws a StateError if the account is not an Ed25519Account.

Implementation

static Ed25519Account ed25519AccountFromHex(HexInput hex) {
  final account = fromHex(hex);
  if (account is! Ed25519Account) {
    throw StateError('Deserialization of Ed25519Account failed');
  }
  return account;
}