pub enum StakeInstruction {
Show 13 variants
Initialize(Authorized, Lockup),
Authorize(Pubkey, StakeAuthorize),
DelegateStake,
Split(u64),
Withdraw(u64),
Deactivate,
SetLockup(LockupArgs),
Merge,
AuthorizeWithSeed(AuthorizeWithSeedArgs),
InitializeChecked,
AuthorizeChecked(StakeAuthorize),
AuthorizeCheckedWithSeed(AuthorizeCheckedWithSeedArgs),
SetLockupChecked(LockupCheckedArgs),
}
Variants
Initialize(Authorized, Lockup)
Initialize a stake with lockup and authorization information
Account references
[WRITE]
Uninitialized stake account[]
Rent sysvar
Authorized carries pubkeys that must sign staker transactions and withdrawer transactions. Lockup carries information about withdrawal restrictions
Authorize(Pubkey, StakeAuthorize)
Authorize a key to manage stake or withdrawal
Account references
[WRITE]
Stake account to be updated[]
Clock sysvar[SIGNER]
The stake or withdraw authority- Optional:
[SIGNER]
Lockup authority, if updating StakeAuthorize::Withdrawer before lockup expiration
DelegateStake
Delegate a stake to a particular vote account
Account references
[WRITE]
Initialized stake account to be delegated[]
Vote account to which this stake will be delegated[]
Clock sysvar[]
Stake history sysvar that carries stake warmup/cooldown history[]
Address of config account that carries stake config[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(u64)
Split u64 tokens and stake off a stake account into another stake account.
Account references
[WRITE]
Stake account to be split; must be in the Initialized or Stake state[WRITE]
Uninitialized stake account that will take the split-off amount[SIGNER]
Stake authority
Withdraw(u64)
Withdraw unstaked lamports from the stake account
Account references
[WRITE]
Stake account from which to withdraw[WRITE]
Recipient account[]
Clock sysvar[]
Stake history sysvar that carries stake warmup/cooldown history[SIGNER]
Withdraw authority- 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
.
Deactivate
Deactivates the stake in the account
Account references
[WRITE]
Delegated stake account[]
Clock sysvar[SIGNER]
Stake authority
SetLockup(LockupArgs)
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
[WRITE]
Initialized stake account[SIGNER]
Lockup authority or withdraw authority
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
[WRITE]
Destination stake account for the merge[WRITE]
Source stake account for to merge. This account will be drained[]
Clock sysvar[]
Stake history sysvar that carries stake warmup/cooldown history[SIGNER]
Stake authority
AuthorizeWithSeed(AuthorizeWithSeedArgs)
Authorize a key to manage stake or withdrawal with a derived key
Account references
[WRITE]
Stake account to be updated[SIGNER]
Base key of stake or withdraw authority[]
Clock sysvar- Optional:
[SIGNER]
Lockup authority, if updating StakeAuthorize::Withdrawer before lockup expiration
InitializeChecked
Initialize a stake with authorization information
This instruction is similar to Initialize
except that the withdraw authority
must be a signer, and no lockup is applied to the account.
Account references
[WRITE]
Uninitialized stake account[]
Rent sysvar[]
The stake authority[SIGNER]
The withdraw authority
AuthorizeChecked(StakeAuthorize)
Authorize a key to manage stake or withdrawal
This instruction behaves like Authorize
with the additional requirement that the new
stake or withdraw authority must also be a signer.
Account references
[WRITE]
Stake account to be updated[]
Clock sysvar[SIGNER]
The stake or withdraw authority[SIGNER]
The new stake or withdraw authority- Optional:
[SIGNER]
Lockup authority, if updating StakeAuthorize::Withdrawer before lockup expiration
AuthorizeCheckedWithSeed(AuthorizeCheckedWithSeedArgs)
Authorize a key to manage stake or withdrawal with a derived key
This instruction behaves like AuthorizeWithSeed
with the additional requirement that
the new stake or withdraw authority must also be a signer.
Account references
[WRITE]
Stake account to be updated[SIGNER]
Base key of stake or withdraw authority[]
Clock sysvar[SIGNER]
The new stake or withdraw authority- Optional:
[SIGNER]
Lockup authority, if updating StakeAuthorize::Withdrawer before lockup expiration
SetLockupChecked(LockupCheckedArgs)
Set stake lockup
This instruction behaves like SetLockup
with the additional requirement that
the new lockup authority also be a signer.
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
[WRITE]
Initialized stake account[SIGNER]
Lockup authority or withdraw authority- Optional:
[SIGNER]
New lockup authority
Trait Implementations
impl Clone for StakeInstruction
impl Clone for StakeInstruction
fn clone(&self) -> StakeInstruction
fn clone(&self) -> StakeInstruction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for StakeInstruction
impl Debug for StakeInstruction
impl<'de> Deserialize<'de> for StakeInstruction
impl<'de> Deserialize<'de> for StakeInstruction
fn deserialize<__D>(
__deserializer: __D
) -> Result<StakeInstruction, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<StakeInstruction, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl PartialEq<StakeInstruction> for StakeInstruction
impl PartialEq<StakeInstruction> for StakeInstruction
fn eq(&self, other: &StakeInstruction) -> bool
fn eq(&self, other: &StakeInstruction) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &StakeInstruction) -> bool
fn ne(&self, other: &StakeInstruction) -> bool
This method tests for !=
.
impl Serialize for StakeInstruction
impl Serialize for StakeInstruction
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for StakeInstruction
Auto Trait Implementations
impl RefUnwindSafe for StakeInstruction
impl Send for StakeInstruction
impl Sync for StakeInstruction
impl Unpin for StakeInstruction
impl UnwindSafe for StakeInstruction
Blanket Implementations
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more