[][src]Enum solana_sdk::system_instruction::SystemInstruction

pub enum SystemInstruction {
    CreateAccount {
        lamports: u64,
        space: u64,
        program_id: Pubkey,
    },
    Assign {
        program_id: Pubkey,
    },
    Transfer {
        lamports: u64,
    },
    CreateAccountWithSeed {
        base: Pubkey,
        seed: String,
        lamports: u64,
        space: u64,
        program_id: Pubkey,
    },
    AdvanceNonceAccount,
    WithdrawNonceAccount(u64),
    InitializeNonceAccount(Pubkey),
    AuthorizeNonceAccount(Pubkey),
    Allocate {
        space: u64,
    },
    AllocateWithSeed {
        base: Pubkey,
        seed: String,
        space: u64,
        program_id: Pubkey,
    },
    AssignWithSeed {
        base: Pubkey,
        seed: String,
        program_id: Pubkey,
    },
}

Variants

CreateAccount

Create a new account

  • Transaction::keys[0] - source
  • Transaction::keys[1] - new account key
  • lamports - number of lamports to transfer to the new account
  • space - number of bytes of memory to allocate
  • program_id - the program id of the new account

Fields of CreateAccount

lamports: u64space: u64program_id: Pubkey
Assign

Assign account to a program

  • Transaction::keys[0] - account to assign

Fields of Assign

program_id: Pubkey
Transfer

Transfer lamports

  • Transaction::keys[0] - source
  • Transaction::keys[1] - destination

Fields of Transfer

lamports: u64
CreateAccountWithSeed

Create a new account at an address derived from a base pubkey and a seed

  • Transaction::keys[0] - source
  • Transaction::keys[1] - new account key
  • seed - string of ascii chars, no longer than MAX_ADDRESS_SEED_LEN
  • lamports - number of lamports to transfer to the new account
  • space - number of bytes of memory to allocate
  • program_id - the program id of the new account

Fields of CreateAccountWithSeed

base: Pubkeyseed: Stringlamports: u64space: u64program_id: Pubkey
AdvanceNonceAccount

AdvanceNonceAccount consumes a stored nonce, replacing it with a successor

Expects 2 Accounts: 0 - A NonceAccount 1 - RecentBlockhashes sysvar

The current authority must sign a transaction executing this instrucion

WithdrawNonceAccount(u64)

WithdrawNonceAccount transfers funds out of the nonce account

Expects 4 Accounts: 0 - A NonceAccount 1 - A system account to which the lamports will be transferred 2 - RecentBlockhashes sysvar 3 - Rent sysvar

The u64 parameter is the lamports to withdraw, which must leave the account balance above the rent exempt reserve or at zero.

The current authority must sign a transaction executing this instruction

InitializeNonceAccount(Pubkey)

InitializeNonceAccount drives state of Uninitalized NonceAccount to Initialized, setting the nonce value.

Expects 3 Accounts: 0 - A NonceAccount in the Uninitialized state 1 - RecentBlockHashes sysvar 2 - Rent sysvar

The Pubkey 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(Pubkey)

AuthorizeNonceAccount changes the entity authorized to execute nonce instructions on the account

Expects 1 Account: 0 - A NonceAccount

The Pubkey parameter identifies the entity to authorize

The current authority must sign a transaction executing this instruction

Allocate

Allocate space in a (possibly new) account without funding

  • Transaction::keys[0] - new account key
  • space - number of bytes of memory to allocate

Fields of Allocate

space: u64
AllocateWithSeed

Allocate space for and assign an account at an address derived from a base pubkey and a seed

  • Transaction::keys[0] - new account key
  • seed - string of ascii chars, no longer than MAX_ADDRESS_SEED_LEN
  • space - number of bytes of memory to allocate
  • program_id - the program id of the new account

Fields of AllocateWithSeed

base: Pubkeyseed: Stringspace: u64program_id: Pubkey
AssignWithSeed

Assign account to a program based on a seed

  • Transaction::keys[0] - account to assign
  • seed - string of ascii chars, no longer than MAX_ADDRESS_SEED_LEN
  • program_id - the program id of the new account

Fields of AssignWithSeed

base: Pubkeyseed: Stringprogram_id: Pubkey

Trait Implementations

impl Clone for SystemInstruction[src]

impl Debug for SystemInstruction[src]

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

impl PartialEq<SystemInstruction> for SystemInstruction[src]

impl Serialize for SystemInstruction[src]

impl StructuralPartialEq for SystemInstruction[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.