fix: sentry 3334937784
This commit is contained in:
parent
eaf81aa701
commit
b546078c8f
|
@ -409,10 +409,7 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
? 'currentWallet'.tr()
|
||||
: '${'wallet'.tr()} ${scanedValidWalletNumber + 1}';
|
||||
await sub.importAccount(
|
||||
mnemonic: '',
|
||||
fromMnemonic: true,
|
||||
derivePath: '//$derivationNbr',
|
||||
password: pin.text);
|
||||
derivePath: '//$derivationNbr', password: pin.text);
|
||||
|
||||
WalletData myWallet = WalletData(
|
||||
version: dataVersion,
|
||||
|
@ -448,8 +445,7 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
"${addressData.address!}: ${balance['transferableBalance']} $currencyName");
|
||||
if (balance['transferableBalance'] != 0) {
|
||||
String walletName = 'myRootWallet'.tr();
|
||||
await sub.importAccount(
|
||||
mnemonic: '', fromMnemonic: true, password: pin.text);
|
||||
await sub.importAccount(password: pin.text);
|
||||
|
||||
WalletData myWallet = WalletData(
|
||||
version: dataVersion,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
|
@ -30,9 +29,6 @@ class SubstrateSdk with ChangeNotifier {
|
|||
String transactionStatus = '';
|
||||
int ss58 = 42;
|
||||
|
||||
TextEditingController jsonKeystore = TextEditingController();
|
||||
TextEditingController keystorePassword = TextEditingController();
|
||||
|
||||
/////////////////////////////////////
|
||||
////////// 1: API METHODS ///////////
|
||||
/////////////////////////////////////
|
||||
|
@ -374,40 +370,18 @@ class SubstrateSdk with ChangeNotifier {
|
|||
|
||||
Future<String> importAccount(
|
||||
{String mnemonic = '',
|
||||
bool fromMnemonic = false,
|
||||
String derivePath = '',
|
||||
String password = ''}) async {
|
||||
// toy exercise immense month enter answer table prefer speed cycle gold phone
|
||||
final clipboardData = await Clipboard.getData(Clipboard.kTextPlain);
|
||||
if (mnemonic != '') {
|
||||
fromMnemonic = true;
|
||||
generatedMnemonic = mnemonic;
|
||||
} else if (clipboardData!.text!.split(' ').length == 12) {
|
||||
fromMnemonic = true;
|
||||
generatedMnemonic = clipboardData.text!;
|
||||
}
|
||||
|
||||
if (password == '') {
|
||||
password = keystorePassword.text;
|
||||
}
|
||||
|
||||
final KeyType keytype;
|
||||
final String keyToImport;
|
||||
if (fromMnemonic) {
|
||||
keytype = KeyType.mnemonic;
|
||||
keyToImport = generatedMnemonic;
|
||||
} else {
|
||||
keytype = KeyType.keystore;
|
||||
keyToImport = jsonKeystore.text.replaceAll("'", "\\'");
|
||||
}
|
||||
required String password}) async {
|
||||
const keytype = KeyType.mnemonic;
|
||||
if (mnemonic != '') generatedMnemonic = mnemonic;
|
||||
|
||||
importIsLoading = true;
|
||||
notifyListeners();
|
||||
if (clipboardData?.text != null) jsonKeystore.text = clipboardData!.text!;
|
||||
var json = await sdk.api.keyring
|
||||
|
||||
final json = await sdk.api.keyring
|
||||
.importAccount(keyring,
|
||||
keyType: keytype,
|
||||
key: keyToImport,
|
||||
key: generatedMnemonic,
|
||||
name: derivePath,
|
||||
password: password,
|
||||
derivePath: derivePath,
|
||||
|
@ -543,7 +517,6 @@ class SubstrateSdk with ChangeNotifier {
|
|||
|
||||
return await importAccount(
|
||||
mnemonic: generatedMnemonic,
|
||||
fromMnemonic: true,
|
||||
derivePath: '//$number',
|
||||
password: password);
|
||||
}
|
||||
|
@ -558,7 +531,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
final List seedList = seedMap!['seed'].split('//');
|
||||
generatedMnemonic = seedList[0];
|
||||
|
||||
return await importAccount(fromMnemonic: true, password: password);
|
||||
return await importAccount(password: password);
|
||||
}
|
||||
|
||||
Future<bool> isMnemonicValid(String mnemonic) async {
|
||||
|
|
|
@ -203,7 +203,6 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
}
|
||||
if (!isAlive) {
|
||||
final address = await sub.importAccount(
|
||||
fromMnemonic: true,
|
||||
mnemonic: generateWalletProvider.generatedMnemonic!,
|
||||
derivePath: '//2',
|
||||
password: generateWalletProvider.pin.text);
|
||||
|
|
Loading…
Reference in New Issue