StakeInstruction.authorize constructor
StakeInstruction.authorize({
- required Ed25519HDPublicKey stake,
- required Ed25519HDPublicKey authority,
- required StakeAuthorize authorize,
- Ed25519HDPublicKey? lockupAuthority,
Authorize a key to manage stake
or withdrawal.
Implementation
factory StakeInstruction.authorize({
required Ed25519HDPublicKey stake,
required Ed25519HDPublicKey authority,
required StakeAuthorize authorize,
Ed25519HDPublicKey? lockupAuthority,
}) =>
StakeInstruction._(
accounts: [
AccountMeta.writeable(pubKey: stake, isSigner: false),
AccountMeta.readonly(
pubKey: Ed25519HDPublicKey.fromBase58(Sysvar.clock),
isSigner: false,
),
AccountMeta.readonly(pubKey: authority, isSigner: true),
if (lockupAuthority != null)
AccountMeta.readonly(pubKey: lockupAuthority, isSigner: true),
],
data: ByteArray.merge([
StakeProgram.authorizeInstructionIndex,
authorize.serialize(),
]),
);