pub enum ProgramInstruction {
Show 23 variants
CreateCentralState,
CreateStakePool,
ActivateStakePool,
CreateStakeAccount,
Stake,
Unstake,
ClaimPoolRewards,
ClaimRewards,
Crank,
CloseStakePool,
CloseStakeAccount,
ChangeInflation,
CreateBond,
SignBond,
UnlockBondTokens,
ClaimBond,
ClaimBondRewards,
ChangePoolMinimum,
AdminMint,
AdminFreeze,
ChangePoolMultiplier,
ChangeCentralStateAuthority,
EditMetadata,
}
Variants§
CreateCentralState
Create central state
| Index | Writable | Signer | Description | | –––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The central state account | | 1 | ❌ | ❌ | The system program account | | 2 | ✅ | ✅ | The fee payer account | | 3 | ❌ | ❌ | The mint of the ACCESS token |
CreateStakePool
Create stake pool
| Index | Writable | Signer | Description | | –––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The stake pool account | | 1 | ❌ | ❌ | The system program account | | 2 | ✅ | ✅ | The fee payer account | | 3 | ❌ | ❌ | The stake pool vault account |
ActivateStakePool
Activate a stake pool
| Index | Writable | Signer | Description | | ———————————————————— | | 0 | ❌ | ✅ | The central state authority | | 1 | ✅ | ❌ | The stake pool to activate | | 2 | ❌ | ❌ | The account of the central state |
CreateStakeAccount
Create stake account
| Index | Writable | Signer | Description | | —————————————————— | | 0 | ✅ | ❌ | The stake account | | 1 | ❌ | ❌ | The system program account | | 2 | ❌ | ❌ | The stake pool account | | 3 | ✅ | ✅ | The fee payer account |
Stake
Stake
| Index | Writable | Signer | Description | | ————————————————————————————— | | 0 | ✅ | ❌ | The central state account | | 1 | ✅ | ❌ | The stake account | | 2 | ✅ | ❌ | The stake pool account | | 3 | ❌ | ✅ | The owner of the stake account | | 4 | ✅ | ❌ | The source account of the stake tokens | | 5 | ❌ | ❌ | The SPL token program account | | 6 | ✅ | ❌ | The stake pool vault account | | 7 | ✅ | ❌ | The stake fee account | | 8 | ❌ | ❌ | Optional bond account to be able to stake under the minimum |
Unstake
Unstake
| Index | Writable | Signer | Description | | ————————————————————————————— | | 0 | ✅ | ❌ | The central state account | | 1 | ✅ | ❌ | The stake account | | 2 | ✅ | ❌ | The stake pool account | | 3 | ❌ | ✅ | The owner of the stake account | | 4 | ✅ | ❌ | The destination of the staked tokens | | 5 | ❌ | ❌ | The SPL token program account | | 6 | ✅ | ❌ | The stake pool vault | | 7 | ❌ | ❌ | Optional bond account to be able to stake under the minimum |
ClaimPoolRewards
Claim rewards of a stake pool This instruction is used by stake pool owner for claiming their staking rewards
| Index | Writable | Signer | Description | | –––––––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The stake pool account | | 1 | ❌ | ✅ | The stake pool owner account | | 2 | ✅ | ❌ | The rewards destination | | 3 | ❌ | ❌ | The central state account | | 4 | ✅ | ❌ | The mint address of the ACCESS token | | 5 | ❌ | ❌ | The SPL token program account |
ClaimRewards
Claim rewards of a stake account This instruction can be used by stakers to claim their staking rewards
| Index | Writable | Signer | Description | | –––––––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The stake pool account | | 1 | ✅ | ❌ | The stake account | | 2 | ❌ | ✅ | The owner of the stake account | | 3 | ✅ | ❌ | The rewards destination | | 4 | ❌ | ❌ | The central state account | | 5 | ✅ | ❌ | The mint address of the ACCESS token | | 6 | ❌ | ❌ | The SPL token program account |
Crank
Permissionless crank to update the stake pool rewards This instructions updates the circular buffer with the pool balances multiplied by the current inflation
| Index | Writable | Signer | Description | | ———————————————————— | | 0 | ✅ | ❌ | The stake pool account | | 1 | ✅ | ❌ | The account of the central state |
CloseStakePool
Close a stake pool This instruction can be used to close an empty stake pool and collect the lamports
| Index | Writable | Signer | Description | | ——————————————————— | | 0 | ✅ | ❌ | The account of the stake pool | | 1 | ❌ | ❌ | Pool vault | | 2 | ✅ | ✅ | The owner of the stake pool |
CloseStakeAccount
Close a stake account This instruction can be used to close an empty stake account and collect the lamports
| Index | Writable | Signer | Description | | ––––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The stake account | | 1 | ✅ | ✅ | The owner of the stake account |
ChangeInflation
Change central state inflation
| Index | Writable | Signer | Description | | ––––––––––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The account of the central state | | 1 | ❌ | ✅ | The account of the central state authority |
CreateBond
Create a bond This instruction can be used by authorized sellers to create a bond
| Index | Writable | Signer | Description | | —————————————————— | | 0 | ✅ | ✅ | The bond seller account | | 1 | ✅ | ❌ | The bond account | | 2 | ❌ | ❌ | | | 3 | ❌ | ❌ | The system program account | | 4 | ✅ | ✅ | The fee account |
SignBond
Sign a bond This instruction is used by authorized sellers to approve the creation of a bond
| Index | Writable | Signer | Description | | ————————————— | | 0 | ❌ | ✅ | | | 1 | ✅ | ❌ | |
UnlockBondTokens
Unlock ACCESS tokens bought through a bond account When tokens are unlocked they are withdrawn from the pool and are not considered staked anymore
| Index | Writable | Signer | Description | | ———————————————————— | | 0 | ✅ | ❌ | The bond account | | 1 | ❌ | ✅ | The account of the bond owner | | 2 | ❌ | ❌ | The ACCESS mint token | | 3 | ✅ | ❌ | The ACCESS token destination | | 4 | ✅ | ❌ | The account of the central state | | 5 | ✅ | ❌ | The account of the staking pool | | 6 | ✅ | ❌ | The vault of the staking pool | | 7 | ❌ | ❌ | The SPL token program account |
ClaimBond
Claim bond This instruction allows a buyer to claim a bond once it has been signed by enough DAO members.
| Index | Writable | Signer | Description | | –––––––––––––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The bond account | | 1 | ❌ | ✅ | The account of the bond buyer | | 2 | ✅ | ❌ | The token account used to purchase the bond | | 3 | ✅ | ❌ | The token account where the sell proceed is sent | | 4 | ✅ | ❌ | The stake pool account | | 5 | ✅ | ❌ | The mint of the ACCESS token | | 6 | ✅ | ❌ | The vault of the stake pool | | 7 | ✅ | ❌ | The central state account | | 8 | ❌ | ❌ | The SPL token program account |
ClaimBondRewards
Claim bond rewards This Instruction allows bond owners to claim their staking rewards
| Index | Writable | Signer | Description | | –––––––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The stake pool account | | 1 | ✅ | ❌ | The bond account | | 2 | ❌ | ✅ | The bond account owner | | 3 | ✅ | ❌ | The rewards destination | | 4 | ❌ | ❌ | The central state account | | 5 | ✅ | ❌ | The mint address of the ACCESS token | | 6 | ❌ | ❌ | The SPL token program account |
ChangePoolMinimum
Change the minimum stakeable amount of a pool This instruction allows a pool owner to adjust the price of its subscription for new joiners without impacting people who already subscribed
| Index | Writable | Signer | Description | | –––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The stake pool account | | 1 | ❌ | ✅ | The stake pool owner account |
AdminMint
Allows central state authority to mint ACCESS tokens
| Index | Writable | Signer | Description | | ———————————————————— | | 0 | ❌ | ✅ | The central state authority | | 1 | ✅ | ❌ | The ACCESS mint token | | 2 | ✅ | ❌ | The ACCESS token destination | | 3 | ❌ | ❌ | The account of the central state | | 4 | ❌ | ❌ | The SPL token program account |
AdminFreeze
Freeze and unfreeze a program account This admin instruction can be dangereous 💀
| Index | Writable | Signer | Description | | ————————————————————— | | 0 | ❌ | ✅ | The central state authority | | 1 | ✅ | ❌ | The account to freeze (or unfreeze) | | 2 | ❌ | ❌ | The account of the central state |
ChangePoolMultiplier
| Index | Writable | Signer | Description | | –––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The stake pool account | | 1 | ❌ | ✅ | The stake pool owner account |
ChangeCentralStateAuthority
Change central state authority
| Index | Writable | Signer | Description | | ––––––––––––––––––––––––––––––––––– | | 0 | ✅ | ❌ | The account of the central state | | 1 | ❌ | ✅ | The account of the central state authority |
EditMetadata
Edit metadata
| Index | Writable | Signer | Description | | ––––––––––––––––––––––––––––––––––– | | 0 | ❌ | ❌ | The central state account | | 1 | ❌ | ✅ | The account of the central state authority | | 2 | ✅ | ❌ | The metadata account | | 3 | ❌ | ❌ | The metadata program account |
Trait Implementations§
source§impl BorshSerialize for ProgramInstruction
impl BorshSerialize for ProgramInstruction
source§impl FromPrimitive for ProgramInstruction
impl FromPrimitive for ProgramInstruction
source§fn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
i64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
u64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
isize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
i8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
i16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
i32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
i128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
usize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
u8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
u16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
u32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
u128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more