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

pub enum StakeInstruction {
    Initialize(AuthorizedLockup),
    Authorize(PubkeyStakeAuthorize),
    DelegateStake,
    Split(u64),
    Withdraw(u64),
    Deactivate,
    SetLockup(Lockup),
}

Variants

Initialize(AuthorizedLockup)

Initialize a stake with Lockup and Authorized information

Expects 2 Accounts: 0 - Uninitialized StakeAccount 1 - Rent sysvar

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

Authorize(PubkeyStakeAuthorize)

Authorize a key to manage stake or withdrawal requires Authorized::staker or Authorized::withdrawer signature, depending on which key's being updated

Expects 1 Account: 0 - StakeAccount to be updated with the Pubkey for authorization

DelegateStake

Delegate a stake to a particular vote account requires Authorized::staker signature

Expects 4 Accounts: 0 - Initialized StakeAccount to be delegated 1 - VoteAccount to which this Stake will be delegated 2 - Clock sysvar Account that carries clock bank epoch 3 - Config Account that carries stake config

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

Split(u64)

Split u64 tokens and stake off a stake account into another stake account. Requires Authorized::staker signature and the signature of the split-off stake address.

The source stake must be either Initialized or a Stake.

Expects 2 Accounts: 0 - StakeAccount to be split 1 - Uninitialized StakeAcount that will take the split-off amount

Withdraw(u64)

Withdraw unstaked lamports from the stake account requires Authorized::withdrawer signature. If withdrawal is before lockup has expired, also requires signature of the lockup custodian.

Expects 4 Accounts: 0 - StakeAccount from which to withdraw 1 - Account to which the lamports will be transferred 2 - Syscall Account that carries epoch 3 - StakeHistory sysvar that carries stake warmup/cooldown history

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

Deactivate

Deactivates the stake in the account requires Authorized::staker signature

Expects 2 Accounts: 0 - Delegate StakeAccount 1 - Syscall Account that carries epoch

SetLockup(Lockup)

Set stake lockup requires Lockup::custodian signature

Expects 1 Account: 0 - initialized StakeAccount

Trait Implementations

impl Clone for StakeInstruction[src]

impl Debug for StakeInstruction[src]

impl<'de> Deserialize<'de> for StakeInstruction[src]

impl PartialEq<StakeInstruction> for StakeInstruction[src]

impl Serialize for StakeInstruction[src]

impl StructuralPartialEq for StakeInstruction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.