System program address. This program contain instructions to: create new accounts, allocate account data, assign accounts to owning programs, transfer lamports from System Program owned accounts and pay transaction fees.
Modulesolana-haskell-sdk-1.3.0.0GHC2021
Network.Solana.NativePrograms.SystemProgram
Client for the System program: account creation and allocation (plain and seed-derived), program assignment, lamport transfers and durable-nonce account management, plus decodeNonceAccount for nonce account state. Instruction data is byte-verified against the Rust SDK.
- 2 types
- 17 values
- Packagesolana-haskell-sdk-1.3.0.0
- Exports19
- LanguageGHC2021
- LicenceApache-2.0
- SourceSystemProgram.hs
Constructors
CreateAccountCreate a new account
AssignAssign account to a program
owner :: SolanaPublicKeyAddress of program that will own the new account
TransferTransfer lamports
CreateAccountWithSeedbase :: SolanaPublicKeyBase public key
seed :: StringString of ASCII chars, no longer than maxSeedLen
lamports :: Word64Number of lamports to transfer to the new account
space :: Word64Number of bytes of memory to allocate
owner :: SolanaPublicKeyAddress of program that will own the new account
AdvanceNonceAccountConsume a stored nonce, replacing it with a successor
WithdrawNonceAccountWithdraw funds from a nonce account
InitializeNonceAccountDrive state of Uninitialized nonce account to Initialized, setting the nonce value
AuthorizeNonceAccountChange the entity authorized to execute nonce instructions on the account
AllocateAllocate space in a (possibly new) account without funding
AllocateWithSeedAllocate space for and assign an account at an address derived from a base public key and a seed
base :: SolanaPublicKeyBase public key
seed :: StringString of ASCII chars, no longer than maxSeedLen
space :: Word64Number of bytes of memory to allocate
owner :: SolanaPublicKeyAddress of program that will own the new account
AssignWithSeedAssign account to a program based on a seed
base :: SolanaPublicKeyBase public key
seed :: StringString of ASCII chars, no longer than maxSeedLen
owner :: SolanaPublicKeyAddress of program that will own the new account
TransferWithSeedTransfer lamports from a derived address
UpgradeNonceAccountOne-time idempotent upgrade of legacy nonce versions to bump them out of chain blockhash domain
Instances5Eq, Show, Generic, Binary, Rep
Eq SystemInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.SystemProgramShow SystemInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.SystemProgramGeneric SystemInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.SystemProgramBinary SystemInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.SystemProgramtype Rep SystemInstruction = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.SystemProgram"SystemInstruction"
"Network.Solana.NativePrograms.SystemProgram"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (((C1 ('MetaCons"CreateAccount"
'PrefixI 'True) (S1 ('MetaSel ('Just"lamports"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: (S1 ('MetaSel ('Just"space"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just"owner"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey))) :+: (C1 ('MetaCons"Assign"
'PrefixI 'True) (S1 ('MetaSel ('Just"owner"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey)) :+: C1 ('MetaCons"Transfer"
'PrefixI 'True) (S1 ('MetaSel ('Just"lamports"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))) :+: (C1 ('MetaCons"CreateAccountWithSeed"
'PrefixI 'True) ((S1 ('MetaSel ('Just"base"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey) :*: S1 ('MetaSel ('Just"seed"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :*: (S1 ('MetaSel ('Just"lamports"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: (S1 ('MetaSel ('Just"space"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just"owner"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey)))) :+: (C1 ('MetaCons"AdvanceNonceAccount"
'PrefixI 'False) U1 :+: C1 ('MetaCons"WithdrawNonceAccount"
'PrefixI 'True) (S1 ('MetaSel ('Just"lamports"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))))) :+: ((C1 ('MetaCons"InitializeNonceAccount"
'PrefixI 'True) (S1 ('MetaSel ('Just"authority"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey)) :+: (C1 ('MetaCons"AuthorizeNonceAccount"
'PrefixI 'True) (S1 ('MetaSel ('Just"authority"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey)) :+: C1 ('MetaCons"Allocate"
'PrefixI 'True) (S1 ('MetaSel ('Just"space"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))) :+: ((C1 ('MetaCons"AllocateWithSeed"
'PrefixI 'True) ((S1 ('MetaSel ('Just"base"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey) :*: S1 ('MetaSel ('Just"seed"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :*: (S1 ('MetaSel ('Just"space"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just"owner"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey))) :+: C1 ('MetaCons"AssignWithSeed"
'PrefixI 'True) (S1 ('MetaSel ('Just"base"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey) :*: (S1 ('MetaSel ('Just"seed"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just"owner"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey)))) :+: (C1 ('MetaCons"TransferWithSeed"
'PrefixI 'True) (S1 ('MetaSel ('Just"lamports"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: (S1 ('MetaSel ('Just"fromSeed"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just"fromOwner"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey))) :+: C1 ('MetaCons"UpgradeNonceAccount"
'PrefixI 'False) U1))))
bincode decodes a Rust String as a u64 little-endian byte length followed by that many UTF-8 bytes.
A nonce account's on-chain state (bincode-encoded VersionsState:
a u32 version tag around a u32 state tag).
Instances2Eq, Show
Eq NonceStateDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.SystemProgramShow NonceStateDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.NativePrograms.SystemProgram
Decodes a nonce account's data: a u32 version (0 or 1), then a u32 state discriminant (0 uninitialized, 1 initialized with authority, durable nonce, and fee-rate fields). Trailing bytes (account padding) are allowed.
Creates instruction to "Create a new account" Receives the funding account, the new account, amount to transfer, the number of bytes of memory to allocate and the owner program account. # Account references 0. `[WRITE, SIGNER]` Funding account 1. `[WRITE, SIGNER]` New account
Creates instruction to "Assign account to a program" Receives addresses for the assigned account and owner program account # Account references 0. `[WRITE, SIGNER]` Assigned account public key
Creates instruction to "Transfer lamports" Receives the funding account, the recipient account and the amount to transfer. # Account references 0. `[WRITE, SIGNER]` Funding account 1. `[WRITE]` Recipient account
Creates instruction to "Create a new account at an address derived from a base pubkey and a seed" Receives the funding account, the new account, base pubkey, seed, amount to transfer, the number of bytes of memory to allocate and the owner program account. # Account references 0. `[WRITE, SIGNER]` Funding account 1. `[WRITE]` Created account 2. `[SIGNER]` (optional) Base account; the account matching the base Pubkey below must be provided as a signer, but may be the same as the funding account and provided as account 0
Creates instruction to "Consume a stored nonce, replacing it with a successor" Receives the nonce account and the nonce authority. # Account references 0. `[WRITE]` Nonce account 1. `[]` RecentBlockhashes sysvar 2. `[SIGNER]` Nonce authority
Creates instruction to "Withdraw funds from a nonce account" Receives the nonce account, the nonce authority, the recipient account and the amount. # Account references 0. `[WRITE]` Nonce account 1. `[WRITE]` Recipient account 2. `[]` RecentBlockhashes sysvar 3. `[]` Rent sysvar 4. `[SIGNER]` Nonce authority
Creates instruction to "Drive state of Uninitialized nonce account to Initialized" Receives the nonce account and the entity authorized to execute nonce instructions on it. # Account references 0. `[WRITE]` Nonce account 1. `[]` RecentBlockhashes sysvar 2. `[]` Rent sysvar
Creates instruction to "Change the entity authorized to execute nonce instructions on the account" Receives the nonce account, the current nonce authority and the new nonce authority. # Account references 0. `[WRITE]` Nonce account 1. `[SIGNER]` Nonce authority
Creates instruction to "Upgrade legacy nonce versions" Receives the nonce account. # Account references 0. `[WRITE]` Nonce account
Creates instruction to "Allocate space in a (possibly new) account without funding" Receives the account and the number of bytes of memory to allocate. # Account references 0. `[WRITE, SIGNER]` New account
Creates instruction to "Allocate space for and assign an account at an address derived from a base public key and a seed" Receives the allocated account, base account, seed, the number of bytes and the owner program account. # Account references 0. `[WRITE]` Allocated account 1. `[SIGNER]` Base account
Creates instruction to "Assign account to a program based on a seed" Receives the assigned account, base account, seed and the owner program account. # Account references 0. `[WRITE]` Assigned account 1. `[SIGNER]` Base account
Creates instruction to "Transfer lamports from a derived address" Receives the funding account, base account, seed, the owner of the funding account, the recipient and the amount. # Account references 0. `[WRITE]` Funding account 1. `[SIGNER]` Base for funding account 2. `[WRITE]` Recipient account