Stake program address.
Modulesolana-haskell-sdk-1.3.0.0GHC2021
Network.Solana.NativePrograms.Stake
Client for the Stake program. Instruction data is bincode-encoded (u32 little-endian discriminant), like the System Program. Covered discriminants: 0-7, 9, 10, 13; the seed-authority variants (8, 11), SetLockupChecked (12), DeactivateDelinquent (14) and the deprecated Redelegate (15) are not modeled.
- 8 types
- 17 values
- Packagesolana-haskell-sdk-1.3.0.0
- Exports25
- LanguageGHC2021
- LicenceApache-2.0
- SourceStake.hs
Stake config account address (legacy; still passed to DelegateStake).
The authorities of a stake account.
Constructors
Instances5Eq, Show, Generic, Binary, Rep
Eq AuthorizedDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeShow AuthorizedDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeGeneric AuthorizedDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeBinary AuthorizedDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Staketype Rep Authorized = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Stake"Authorized"
"Network.Solana.NativePrograms.Stake"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"Authorized"
'PrefixI 'True) (S1 ('MetaSel ('Just"aStaker"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey) :*: S1 ('MetaSel ('Just"aWithdrawer"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey)))
Lockup constraints on a stake account.
Constructors
Instances5Eq, Show, Generic, Binary, Rep
Eq LockupDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeShow LockupDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeGeneric LockupDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeBinary LockupDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Staketype Rep Lockup = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Stake"Lockup"
"Network.Solana.NativePrograms.Stake"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"Lockup"
'PrefixI 'True) (S1 ('MetaSel ('Just"lUnixTimestamp"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64) :*: (S1 ('MetaSel ('Just"lEpoch"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just"lCustodian"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey))))
A stake's delegation to a vote account.
Constructors
Instances2Eq, Show
Eq StakeDelegationDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeShow StakeDelegationDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Stake
A stake account's metadata: rent-exempt reserve, authorities, and lockup.
Constructors
A stake account's on-chain state (bincode-encoded StakeStateV2).
Constructors
StakeUninitializedStakeInitialized StakeMetaStakeActive StakeMeta StakeDelegation Word64 Word8Meta, delegation, credits observed, stake flags (wire order).
StakeRewardsPool
Instances2Eq, Show
Eq StakeStateDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeShow StakeStateDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Stake
Decodes a stake account's data: a u32 discriminant (0 uninitialized, 1 initialized, 2 active/delegated, 3 rewards pool). Trailing bytes (account padding) are allowed.
Which stake authority an operation concerns (bincode u32: 0 staker, 1 withdrawer).
Instances6Bounded, Enum, Eq, Show, Generic, Rep
Bounded StakeAuthorizeDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeEnum StakeAuthorizeDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeEq StakeAuthorizeDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeShow StakeAuthorizeDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeGeneric StakeAuthorizeDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Staketype Rep StakeAuthorize = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Stake"StakeAuthorize"
"Network.Solana.NativePrograms.Stake"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"AuthorizeStaker"
'PrefixI 'False) U1 :+: C1 ('MetaCons"AuthorizeWithdrawer"
'PrefixI 'False) U1)
Partial lockup update; bincode Option fields (u8 tag + value).
Constructors
Instances5Eq, Show, Generic, Binary, Rep
Eq LockupArgsDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeShow LockupArgsDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeGeneric LockupArgsDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeBinary LockupArgsDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Staketype Rep LockupArgs = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Stake"LockupArgs"
"Network.Solana.NativePrograms.Stake"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"LockupArgs"
'PrefixI 'True) (S1 ('MetaSel ('Just"laUnixTimestamp"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int64)) :*: (S1 ('MetaSel ('Just"laEpoch"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word64)) :*: S1 ('MetaSel ('Just"laCustodian"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SolanaPublicKey)))))
bincode OptionT: u8 tag 0 (None) | 1 followed by T.
Stake program instructions (covered subset).
Instances5Eq, Show, Generic, Binary, Rep
Eq StakeInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeShow StakeInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeGeneric StakeInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.StakeBinary StakeInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Staketype Rep StakeInstruction = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.Stake"StakeInstruction"
"Network.Solana.NativePrograms.Stake"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (((C1 ('MetaCons"Initialize"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Authorized) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Lockup)) :+: C1 ('MetaCons"Authorize"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StakeAuthorize))) :+: (C1 ('MetaCons"DelegateStake"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"Split"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)) :+: C1 ('MetaCons"Withdraw"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))))) :+: ((C1 ('MetaCons"Deactivate"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"SetLockup"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LockupArgs)) :+: C1 ('MetaCons"Merge"
'PrefixI 'False) U1)) :+: (C1 ('MetaCons"InitializeChecked"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"AuthorizeChecked"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StakeAuthorize)) :+: C1 ('MetaCons"GetMinimumDelegation"
'PrefixI 'False) U1))))
Creates instruction to "Initialize a stake with lockup and authorization information" Receives the new stake account, the authorized staker/withdrawer and the lockup. # Account references 0. `[WRITE]` Uninitialized stake account 1. `[]` Rent sysvar
Creates instruction to "Authorize a key to manage stake or withdrawal" Receives the stake account, the current stake or withdraw authority, the new authority, which authority is being changed and, if updating the withdrawer before lockup expiration, the lockup custodian. # Account references 0. `[WRITE]` Stake account to be updated 1. `[]` Clock sysvar 2. `[SIGNER]` The stake or withdraw authority 3. `[SIGNER]` (optional) Lockup authority, if updating StakeAuthorize::Withdrawer before lockup expiration
Creates instruction to "Delegate a stake to a particular vote account" Receives the stake account, the authorized staker and the vote account. # Account references 0. `[WRITE]` Initialized stake account to be delegated 1. `[]` Vote account to which this stake will be delegated 2. `[]` Clock sysvar 3. `[]` Stake history sysvar 4. `[]` Address of config account that carries stake config 5. `[SIGNER]` Stake authority
Creates instruction to "Split u64 tokens and stake off a stake account into another stake account"
Receives the stake account to split from, the uninitialized stake account that will take the
split-off amount, the stake authority and the number of lamports to split.
The destination account must already be allocated with 200 bytes and assigned to the stake
program (compose with the System Program client's createAccount/allocate+assign); the Rust
SDK's composite split helper emits those instructions automatically, this builder does not.
# Account references
0. `[WRITE]` Stake account to be split; must be in the Initialized or Stake state
1. `[WRITE]` Uninitialized stake account that will take the split-off amount
2. `[SIGNER]` Stake authority
Creates instruction to "Withdraw unstaked lamports from the stake account" Receives the stake account, the recipient account, the withdraw authority, the number of lamports to withdraw and, if withdrawing before lockup expiration, the lockup custodian. # Account references 0. `[WRITE]` Stake account from which to withdraw 1. `[WRITE]` Recipient account 2. `[]` Clock sysvar 3. `[]` Stake history sysvar 4. `[SIGNER]` Withdraw authority 5. `[SIGNER]` (optional) Lockup authority, if before lockup expiration
Creates instruction to "Deactivate the stake in the account" Receives the stake account and the stake authority. # Account references 0. `[WRITE]` Delegated stake account 1. `[]` Clock sysvar 2. `[SIGNER]` Stake authority
Creates instruction to "Set stake lockup" Receives the stake account, the lockup fields to update, and the lockup custodian (or, if no lockup is currently in force, the withdraw authority). # Account references 0. `[WRITE]` Stake account 1. `[SIGNER]` Lockup authority or withdraw authority
Creates instruction to "Merge two stake accounts" Receives the destination stake account, the source stake account (which is merged into the destination and deactivated) and the stake authority. # Account references 0. `[WRITE]` Destination stake account for the merge 1. `[WRITE]` Source stake account for the merge 2. `[]` Clock sysvar 3. `[]` Stake history sysvar 4. `[SIGNER]` Stake authority
Creates instruction to "Initialize a stake with authorization information", checking that the withdrawer signs (a safer version of initialize). Receives the new stake account and the authorized staker/withdrawer; the withdrawer must sign. # Account references 0. `[WRITE]` Uninitialized stake account 1. `[]` Rent sysvar 2. `[]` The stake authority 3. `[SIGNER]` The withdraw authority
Creates instruction to "Authorize a key to manage stake or withdrawal", checking that the new authority signs (a safer version of authorize). Receives the stake account, the current stake or withdraw authority, the new authority (which must sign), which authority is being changed and, if updating the withdrawer before lockup expiration, the lockup custodian. # Account references 0. `[WRITE]` Stake account to be updated 1. `[]` Clock sysvar 2. `[SIGNER]` The stake or withdraw authority 3. `[SIGNER]` The new stake or withdraw authority 4. `[SIGNER]` (optional) Lockup authority, if updating StakeAuthorize::Withdrawer before lockup expiration