Ed25519ProgramLayout.fromPrivateKey constructor
Ed25519ProgramLayout.fromPrivateKey({
- required SolanaPrivateKey privateKey,
- required List<
int> message, - int? instructionIndex,
Create an ed25519 instruction with a private key.
Implementation
factory Ed25519ProgramLayout.fromPrivateKey({
required SolanaPrivateKey privateKey,
required List<int> message,
int? instructionIndex,
}) {
final pubkey = privateKey.publicKey();
final signature = privateKey.sign(message);
return Ed25519ProgramLayout.fromPublicKey(
publicKey: pubkey,
message: message,
signature: signature,
instructionIndex: instructionIndex,
);
}