mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 11:39: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;
|
||||
|
||||
@override
|
||||
Future<PolygonWallet> create(PolygonNewWalletCredentials credentials) async {
|
||||
Future<PolygonWallet> create(PolygonNewWalletCredentials credentials, {bool? isTestnet}) async {
|
||||
final strength = (credentials.seedPhraseLength == 12)
|
||||
? 128
|
||||
: (credentials.seedPhraseLength == 24)
|
||||
|
@ -72,7 +72,8 @@ class PolygonWalletService extends WalletService<PolygonNewWalletCredentials,
|
|||
}
|
||||
|
||||
@override
|
||||
Future<PolygonWallet> restoreFromKeys(PolygonRestoreWalletFromPrivateKey credentials) async {
|
||||
Future<PolygonWallet> restoreFromKeys(PolygonRestoreWalletFromPrivateKey credentials,
|
||||
{bool? isTestnet}) async {
|
||||
final wallet = PolygonWallet(
|
||||
password: credentials.password!,
|
||||
privateKey: credentials.privateKey,
|
||||
|
@ -87,7 +88,8 @@ class PolygonWalletService extends WalletService<PolygonNewWalletCredentials,
|
|||
}
|
||||
|
||||
@override
|
||||
Future<PolygonWallet> restoreFromSeed(PolygonRestoreWalletFromSeedCredentials credentials) async {
|
||||
Future<PolygonWallet> restoreFromSeed(PolygonRestoreWalletFromSeedCredentials credentials,
|
||||
{bool? isTestnet}) async {
|
||||
if (!bip39.validateMnemonic(credentials.mnemonic)) {
|
||||
throw EthereumMnemonicIsIncorrectException();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue