fix: Error while restoring Solana Wallet with PrivateKey (#2201)

This commit is contained in:
David Adegoke 2025-04-14 18:27:49 +01:00 committed by GitHub
parent 87207c61ba
commit 469373b780
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -167,10 +167,10 @@ abstract class SolanaWalletBase
try {
final keypairBytes = Base58Decoder.decode(privateKey!);
return SolanaPrivateKey.fromSeed(keypairBytes);
return SolanaPrivateKey.fromBytes(keypairBytes);
} catch (_) {
final privateKeyBytes = HEX.decode(privateKey!);
return SolanaPrivateKey.fromBytes(privateKeyBytes);
return SolanaPrivateKey.fromSeed(privateKeyBytes);
}
}