addWallet static method

Future<Wallet> addWallet({
  1. required SecureStore secureStore,
  2. required String seedPhrase,
  3. String? walletId,
  4. int accountId = 0,
  5. String walletName = 'Wallet',
  6. WalletType walletType = WalletType.openZeppelin,
})

Implementation

static Future<Wallet> addWallet({
  required SecureStore secureStore,
  required String seedPhrase,
  String? walletId,
  int accountId = 0,
  String walletName = 'Wallet',
  WalletType walletType = WalletType.openZeppelin,
}) async {
  walletId = walletId ?? WalletService.newWalletId();

  await secureStore.storeSecret(
    key: seedPhraseKey(walletId),
    secret: seedPhrase,
  );

  return Wallet(
    id: walletId,
    name: walletName,
    type: walletType,
    secureStoreType: secureStore.type,
  );
}