importMnemonic method
Import a BIP39 mnemonic phrase as a 1-of-1 wallet.
The mnemonic's wordlist language is auto-detected (English, Japanese, Korean, Spanish, Chinese Simplified / Traditional, French, Italian, or Czech). Stored as decoded entropy + the detected language tag, so the same backup can be re-rendered in any other BIP39 language later for display — the seed derivation is always done in the original language to keep the wallet's address stable (BIP39 PBKDF2 is sensitive to the literal mnemonic string).
The wallet is signable immediately and promotable via promote.
mnemonic: 12, 15, 18, 21, or 24 BIP39 words separated by spaces.passphrase: optional BIP39 passphrase ('' = none).curve,name,keys: same semantics as importPrivateKey.
Implementation
Future<Wallet> importMnemonic({
required String mnemonic,
String passphrase = '',
required String curve,
required String name,
required List<KeyDescription> keys,
}) async {
final data = await _conn.request('Wallet:importMnemonic', 'POST', {
'Mnemonic': mnemonic,
'Passphrase': passphrase,
'Curve': curve,
'Name': name,
'Keys': keys.map((k) => k.toJson()).toList(),
});
return Wallet.fromJson(data as Map<String, dynamic>);
}