pub enum SystemInstruction {
Show 14 variants
CreateAccount {
lamports: u64,
space: u64,
owner: Address,
},
Assign {
owner: Address,
},
Transfer {
lamports: u64,
},
CreateAccountWithSeed {
base: Address,
seed: String,
lamports: u64,
space: u64,
owner: Address,
},
AdvanceNonceAccount,
WithdrawNonceAccount(u64),
InitializeNonceAccount(Address),
AuthorizeNonceAccount(Address),
Allocate {
space: u64,
},
AllocateWithSeed {
base: Address,
seed: String,
space: u64,
owner: Address,
},
AssignWithSeed {
base: Address,
seed: String,
owner: Address,
},
TransferWithSeed {
lamports: u64,
from_seed: String,
from_owner: Address,
},
UpgradeNonceAccount,
CreateAccountAllowPrefund {
lamports: u64,
space: u64,
owner: Address,
},
}Expand description
An instruction to the system program.
Variants§
CreateAccount
Create a new account
§Account references
[WRITE, SIGNER]Funding account[WRITE, SIGNER]New account
Fields
Assign
Transfer
CreateAccountWithSeed
Create a new account at an address derived from a base address and a seed
§Account references
[WRITE, SIGNER]Funding account[WRITE]Created account[SIGNER](optional) Base account; the account matching the base address below must be provided as a signer, but may be the same as the funding account and provided as account 0
Fields
AdvanceNonceAccount
Consumes a stored nonce, replacing it with a successor
§Account references
[WRITE]Nonce account[]RecentBlockhashes sysvar[SIGNER]Nonce authority
WithdrawNonceAccount(u64)
Withdraw funds from a nonce account
§Account references
[WRITE]Nonce account[WRITE]Recipient account[]RecentBlockhashes sysvar[]Rent sysvar[SIGNER]Nonce authority
The u64 parameter is the lamports to withdraw, which must leave the
account balance above the rent exempt reserve or at zero.
InitializeNonceAccount(Address)
Drive state of Uninitialized nonce account to Initialized, setting the nonce value
§Account references
[WRITE]Nonce account[]RecentBlockhashes sysvar[]Rent sysvar
The Address parameter specifies the entity authorized to execute nonce
instruction on the account
No signatures are required to execute this instruction, enabling derived nonce account addresses
AuthorizeNonceAccount(Address)
Change the entity authorized to execute nonce instructions on the account
§Account references
[WRITE]Nonce account[SIGNER]Nonce authority
The Address parameter identifies the entity to authorize
Allocate
Allocate space in a (possibly new) account without funding
§Account references
[WRITE, SIGNER]New account
AllocateWithSeed
Allocate space for and assign an account at an address derived from a base public key and a seed
§Account references
[WRITE]Allocated account[SIGNER]Base account
Fields
AssignWithSeed
Assign account to a program based on a seed
§Account references
[WRITE]Assigned account[SIGNER]Base account
Fields
TransferWithSeed
Transfer lamports from a derived address
§Account references
[WRITE]Funding account[SIGNER]Base for funding account[WRITE]Recipient account
Fields
UpgradeNonceAccount
One-time idempotent upgrade of legacy nonce versions in order to bump them out of chain blockhash domain.
§Account references
[WRITE]Nonce account
CreateAccountAllowPrefund
Create a new account without enforcing the invariant that the account’s current lamports must be 0.
This constructor is identical to create_account with the exception that it
does not check that the destination account (to_pubkey) has a zero
lamport balance prior to creation. This enables patterns where you first transfer
lamports to prefund an account, then use create_account_allow_prefund as a single
CPI to transfer additional lamports, allocate space, and assign ownership.
Use create_account for typical account creation.
Use create_account_allow_prefund when the target account has already been
prefunded and you want to complete the creation process with a single CPI.
Safety considerations
As with allocate and assign when invoked manually, this instruction can brick
a wallet if used incorrectly; do not pass in a wallet system account as the new
account. This instruction does not prevent the new account from having more
lamports than required for rent exemption, and all lamports will become locked.
§Account references
If lamports > 0 (meaning lamports are being transferred):
0. [WRITE, SIGNER] New account
[WRITE, SIGNER]Funding account
If lamports == 0 (no lamports to be transferred), you may omit funding account:
0. [WRITE, SIGNER] New account
Trait Implementations§
Source§impl AbiEnumVisitor for SystemInstruction
impl AbiEnumVisitor for SystemInstruction
fn visit_for_abi(&self, digester: &mut AbiDigester) -> DigestResult
Source§impl AbiExample for SystemInstruction
impl AbiExample for SystemInstruction
Source§impl Clone for SystemInstruction
impl Clone for SystemInstruction
Source§fn clone(&self) -> SystemInstruction
fn clone(&self) -> SystemInstruction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SystemInstruction
impl Debug for SystemInstruction
Source§impl<'de> Deserialize<'de> for SystemInstruction
impl<'de> Deserialize<'de> for SystemInstruction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SystemInstruction
impl PartialEq for SystemInstruction
Source§impl Serialize for SystemInstruction
impl Serialize for SystemInstruction
impl Eq for SystemInstruction
impl StructuralPartialEq for SystemInstruction
Auto Trait Implementations§
impl Freeze for SystemInstruction
impl RefUnwindSafe for SystemInstruction
impl Send for SystemInstruction
impl Sync for SystemInstruction
impl Unpin for SystemInstruction
impl UnwindSafe for SystemInstruction
Blanket Implementations§
Source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Source§impl<T> AbiEnumVisitor for Twhere
T: Serialize + AbiExample,
impl<T> AbiEnumVisitor for Twhere
T: Serialize + AbiExample,
default fn visit_for_abi( &self, digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more