deriveKeypairFromMnemonic static method

Future<Ed25519HDKeyPair> deriveKeypairFromMnemonic(
  1. String mnemonic,
  2. int account,
  3. int change
)

Derives a Solana keypair from a mnemonic seed phrase

Uses the standard Solana derivation path: m/44'/501'/0'/0' This matches Phantom wallet and other standard Solana wallets

mnemonic - The mnemonic seed phrase (12 or 24 words) account - Optional account index (defaults to 0) change - Optional change index (defaults to 0) Returns an Ed25519HDKeyPair derived from the mnemonic

Implementation

static Future<solana.Ed25519HDKeyPair> deriveKeypairFromMnemonic(
  String mnemonic,
  int account,
  int change,
) async {
  return await solana.Ed25519HDKeyPair.fromMnemonic(
    mnemonic,
    account: account,
    change: change,
  );
}