createKeyPairFromPrivateKeyBytes function
Creates a KeyPair from a 32-byte private key, deriving the corresponding public key.
Throws a SolanaError with code
SolanaErrorCode.keysInvalidPrivateKeyByteLength if bytes is not
exactly 32 bytes.
Implementation
KeyPair createKeyPairFromPrivateKeyBytes(Uint8List bytes) {
assertIsPrivateKey(bytes);
final publicKeyBytes = getPublicKeyFromPrivateKey(bytes);
return KeyPair(privateKey: bytes, publicKey: publicKeyBytes);
}