addAccount static method
Implementation
static Future<(Wallet, Account)> addAccount({
required SecureStore secureStore,
required Wallet wallet,
required String seedPhrase,
}) async {
final accountId = wallet.newAccountId;
final privateKey = await WalletService.derivePrivateKey(
seedPhrase: seedPhrase,
derivationIndex: accountId,
);
await secureStore.storeSecret(
key: privateKeyKey(wallet.id, accountId),
secret: privateKey.toHexString(),
);
final accountAddress = await WalletService.computeAddress(
privateKey: privateKey,
);
return wallet.addAccount(
accountAddress: accountAddress,
accountId: accountId,
);
}