fromMnemonic static method

Future<SigningKey> fromMnemonic(
  1. String mnemonic
)

Creates a SigningKey from a mnemonic phrase.

The mnemonic is used to derive a seed, which is then used to create the signing key.

  • Parameter mnemonic: The mnemonic phrase.
  • Returns: A Future that completes with the SigningKey.

Implementation

static Future<SigningKey> fromMnemonic(final String mnemonic) async {
  final bip44 = Bip44.fromMnemonic(mnemonic);
  return SigningKey._(
    ed25519.SigningKey.fromSeed(
      Uint8List.fromList(
        await bip44.deriveKey(),
      ),
    ),
  );
}