fromSeed method

  1. @override
KeyPair fromSeed(
  1. Uint8List seed
)
override

Create a new KeyPair from a given seed.

The seed is used to generate both the private and public keys.

Example:

final seed = Uint8List(32); // Replace with your actual seed
final keyPair = KeyPair.sr25519.fromSeed(seed);

Implementation

@override
KeyPair fromSeed(Uint8List seed) {
  _privateKey = secp256k1.PrivateKey.fromBytes(seed);
  _publicKey = _privateKey.getPublicKey();
  return this;
}