addWallet method
dynamic
addWallet(
{ - required SecureStore secureStore,
- String? seedPhrase,
- String? walletId,
})
Implementation
addWallet({
required SecureStore secureStore,
String? seedPhrase,
String? walletId,
}) async {
seedPhrase = seedPhrase ?? WalletService.newSeedPhrase();
final walletWithoutAccount = await WalletService.addWallet(
secureStore: secureStore,
seedPhrase: seedPhrase,
walletId: walletId,
walletName: "Wallet ${state.wallets.length + 1}",
);
final (walletWithAccount, account) = await WalletService.addAccount(
secureStore: secureStore,
wallet: walletWithoutAccount,
seedPhrase: seedPhrase,
);
updateWallet(wallet: walletWithAccount, accountId: account.id);
}