mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
fix: polygon wallet service
This commit is contained in:
parent
8627698416
commit
a2b67374c1
1 changed files with 5 additions and 3 deletions
|
@ -19,7 +19,7 @@ class PolygonWalletService extends WalletService<PolygonNewWalletCredentials,
|
||||||
final Box<WalletInfo> walletInfoSource;
|
final Box<WalletInfo> walletInfoSource;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<PolygonWallet> create(PolygonNewWalletCredentials credentials) async {
|
Future<PolygonWallet> create(PolygonNewWalletCredentials credentials, {bool? isTestnet}) async {
|
||||||
final strength = (credentials.seedPhraseLength == 12)
|
final strength = (credentials.seedPhraseLength == 12)
|
||||||
? 128
|
? 128
|
||||||
: (credentials.seedPhraseLength == 24)
|
: (credentials.seedPhraseLength == 24)
|
||||||
|
@ -72,7 +72,8 @@ class PolygonWalletService extends WalletService<PolygonNewWalletCredentials,
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<PolygonWallet> restoreFromKeys(PolygonRestoreWalletFromPrivateKey credentials) async {
|
Future<PolygonWallet> restoreFromKeys(PolygonRestoreWalletFromPrivateKey credentials,
|
||||||
|
{bool? isTestnet}) async {
|
||||||
final wallet = PolygonWallet(
|
final wallet = PolygonWallet(
|
||||||
password: credentials.password!,
|
password: credentials.password!,
|
||||||
privateKey: credentials.privateKey,
|
privateKey: credentials.privateKey,
|
||||||
|
@ -87,7 +88,8 @@ class PolygonWalletService extends WalletService<PolygonNewWalletCredentials,
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<PolygonWallet> restoreFromSeed(PolygonRestoreWalletFromSeedCredentials credentials) async {
|
Future<PolygonWallet> restoreFromSeed(PolygonRestoreWalletFromSeedCredentials credentials,
|
||||||
|
{bool? isTestnet}) async {
|
||||||
if (!bip39.validateMnemonic(credentials.mnemonic)) {
|
if (!bip39.validateMnemonic(credentials.mnemonic)) {
|
||||||
throw EthereumMnemonicIsIncorrectException();
|
throw EthereumMnemonicIsIncorrectException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue