Enum solana_stake_program::stake_instruction::StakeInstruction[][src]

pub enum StakeInstruction {
    Initialize(Authorized, Lockup),
    Authorize(Pubkey, StakeAuthorize),
    DelegateStake,
    Split(u64),
    Withdraw(u64),
    Deactivate,
    SetLockup(LockupArgs),
    Merge,
    AuthorizeWithSeed(AuthorizeWithSeedArgs),
}

Variants

Initialize

Initialize a stake with lockup and authorization information

Account references

  1. [WRITE] Uninitialized stake account
  2. [] Rent sysvar

Authorized carries pubkeys that must sign staker transactions and withdrawer transactions. Lockup carries information about withdrawal restrictions

Tuple Fields of Initialize

0: Authorized1: Lockup
Authorize

Authorize a key to manage stake or withdrawal

Account references

  1. [WRITE] Stake account to be updated
  2. [] Clock sysvar
  3. [SIGNER] The stake or withdraw authority
  4. Optional: [SIGNER] Lockup authority, if updating StakeAuthorize::Withdrawer before lockup expiration

Tuple Fields of Authorize

0: Pubkey1: StakeAuthorize
DelegateStake

Delegate a stake to a particular vote account

Account references

  1. [WRITE] Initialized stake account to be delegated
  2. [] Vote account to which this stake will be delegated
  3. [] Clock sysvar
  4. [] Stake history sysvar that carries stake warmup/cooldown history
  5. [] Address of config account that carries stake config
  6. [SIGNER] Stake authority

The entire balance of the staking account is staked. DelegateStake can be called multiple times, but re-delegation is delayed by one epoch

Split

Split u64 tokens and stake off a stake account into another stake account.

Account references

  1. [WRITE] Stake account to be split; must be in the Initialized or Stake state
  2. [WRITE] Uninitialized stake account that will take the split-off amount
  3. [SIGNER] Stake authority

Tuple Fields of Split

0: u64
Withdraw

Withdraw unstaked lamports from the stake account

Account references

  1. [WRITE] Stake account from which to withdraw
  2. [WRITE] Recipient account
  3. [] Clock sysvar
  4. [] Stake history sysvar that carries stake warmup/cooldown history
  5. [SIGNER] Withdraw authority
  6. Optional: [SIGNER] Lockup authority, if before lockup expiration

The u64 is the portion of the stake account balance to be withdrawn, must be <= StakeAccount.lamports - staked_lamports.

Tuple Fields of Withdraw

0: u64
Deactivate

Deactivates the stake in the account

Account references

  1. [WRITE] Delegated stake account
  2. [] Clock sysvar
  3. [SIGNER] Stake authority
SetLockup

Set stake lockup

If a lockup is not active, the withdraw authority may set a new lockup If a lockup is active, the lockup custodian may update the lockup parameters

Account references

  1. [WRITE] Initialized stake account
  2. [SIGNER] Lockup authority or withdraw authority

Tuple Fields of SetLockup

0: LockupArgs
Merge

Merge two stake accounts.

Both accounts must have identical lockup and authority keys. A merge is possible between two stakes in the following states with no additional conditions:

  • two deactivated stakes
  • an inactive stake into an activating stake during its activation epoch

For the following cases, the voter pubkey and vote credits observed must match:

  • two activated stakes
  • two activating accounts that share an activation epoch, during the activation epoch

All other combinations of stake states will fail to merge, including all “transient” states, where a stake is activating or deactivating with a non-zero effective stake.

Account references

  1. [WRITE] Destination stake account for the merge
  2. [WRITE] Source stake account for to merge. This account will be drained
  3. [] Clock sysvar
  4. [] Stake history sysvar that carries stake warmup/cooldown history
  5. [SIGNER] Stake authority
AuthorizeWithSeed

Authorize a key to manage stake or withdrawal with a derived key

Account references

  1. [WRITE] Stake account to be updated
  2. [SIGNER] Base key of stake or withdraw authority
  3. [] Clock sysvar
  4. Optional: [SIGNER] Lockup authority, if updating StakeAuthorize::Withdrawer before lockup expiration

Tuple Fields of AuthorizeWithSeed

0: AuthorizeWithSeedArgs

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.