mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
Add passphrase support for Eth, Polygon, and Tron (#1719)
* Add passphrase support for Eth, Polygon, and Tron * move passphrase to advanced settings even for restore
This commit is contained in:
parent
fc14bf4e2b
commit
4b4d8a4840
29 changed files with 249 additions and 154 deletions
|
@ -27,6 +27,7 @@ class EthereumWallet extends EVMChainWallet {
|
|||
super.initialBalance,
|
||||
super.privateKey,
|
||||
required super.encryptionFileUtils,
|
||||
super.passphrase,
|
||||
}) : super(nativeCurrency: CryptoCurrency.eth);
|
||||
|
||||
@override
|
||||
|
@ -150,8 +151,9 @@ class EthereumWallet extends EVMChainWallet {
|
|||
if (!hasKeysFile) {
|
||||
final mnemonic = data!['mnemonic'] as String?;
|
||||
final privateKey = data['private_key'] as String?;
|
||||
final passphrase = data['passphrase'] as String?;
|
||||
|
||||
keysData = WalletKeysData(mnemonic: mnemonic, privateKey: privateKey);
|
||||
keysData = WalletKeysData(mnemonic: mnemonic, privateKey: privateKey, passphrase: passphrase);
|
||||
} else {
|
||||
keysData = await WalletKeysFile.readKeysFile(
|
||||
name,
|
||||
|
@ -166,6 +168,7 @@ class EthereumWallet extends EVMChainWallet {
|
|||
password: password,
|
||||
mnemonic: keysData.mnemonic,
|
||||
privateKey: keysData.privateKey,
|
||||
passphrase: keysData.passphrase,
|
||||
initialBalance: balance,
|
||||
client: EthereumClient(),
|
||||
encryptionFileUtils: encryptionFileUtils,
|
||||
|
|
|
@ -27,6 +27,7 @@ class EthereumWalletService extends EVMChainWalletService<EthereumWallet> {
|
|||
walletInfo: credentials.walletInfo!,
|
||||
mnemonic: mnemonic,
|
||||
password: credentials.password!,
|
||||
passphrase: credentials.passphrase,
|
||||
client: client,
|
||||
encryptionFileUtils: encryptionFileUtilsFor(isDirect),
|
||||
);
|
||||
|
@ -144,6 +145,7 @@ class EthereumWalletService extends EVMChainWalletService<EthereumWallet> {
|
|||
password: credentials.password!,
|
||||
mnemonic: credentials.mnemonic,
|
||||
walletInfo: credentials.walletInfo!,
|
||||
passphrase: credentials.passphrase,
|
||||
client: client,
|
||||
encryptionFileUtils: encryptionFileUtilsFor(isDirect),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue