deriveAccountInBackground function
Account.fromMnemonic in a background isolate (returns the private key hex; rebuild the account with
Account.fromPrivateKey — the Account object itself is not sendable).
Implementation
Future<Account> deriveAccountInBackground(String mnemonic,
{String passphrase = ''}) async {
final priv = await Isolate.run(() =>
Account.fromMnemonic(mnemonic, passphrase: passphrase).privateKeyHex);
return Account.fromPrivateKey(priv);
}