StakeInstruction.delegateStake constructor
StakeInstruction.delegateStake({
- required Ed25519HDPublicKey stake,
- required Ed25519HDPublicKey vote,
- required Ed25519HDPublicKey config,
- required Ed25519HDPublicKey authority,
Delegate a stake to a particular vote account.
Implementation
factory StakeInstruction.delegateStake({
required Ed25519HDPublicKey stake,
required Ed25519HDPublicKey vote,
required Ed25519HDPublicKey config,
required Ed25519HDPublicKey authority,
}) =>
StakeInstruction._(
accounts: [
AccountMeta.writeable(pubKey: stake, isSigner: false),
AccountMeta.readonly(pubKey: vote, isSigner: false),
AccountMeta.readonly(
pubKey: Ed25519HDPublicKey.fromBase58(Sysvar.clock),
isSigner: false,
),
AccountMeta.readonly(
pubKey: Ed25519HDPublicKey.fromBase58(Sysvar.stakeHistory),
isSigner: false,
),
AccountMeta.readonly(pubKey: config, isSigner: false),
AccountMeta.readonly(pubKey: authority, isSigner: true),
],
data: StakeProgram.delegateStakeInstructionIndex,
);