Instructions for the Solana System Program.
The System Program (address: 11111111111111111111111111111111, 32 zero bytes)
handles basic operations like SOL transfers and account creation.
API Functions
| Function | Arity | Description | Param Kinds |
|---|---|---|---|
create_account | 5 | Build a Solana System Program create-account instruction. | from: value, new_account: value, lamports: value, space: value, owner: value |
transfer | 3 | Build a Solana System Program SOL transfer instruction. | from: value, to: value, lamports: value |
program_id | 0 | Return the Solana System Program public key. | - |
Summary
Functions
Build a create_account instruction.
Returns the System Program pubkey (32 zero bytes).
Build a transfer instruction (SOL transfer).
Functions
@spec create_account( <<_::256>>, <<_::256>>, non_neg_integer(), non_neg_integer(), <<_::256>> ) :: Cartouche.Solana.Transaction.Instruction.t()
Build a create_account instruction.
System Program instruction index 0.
Examples
iex> ix = Cartouche.Solana.SystemProgram.create_account(<<1::256>>, <<2::256>>, 1_000_000, 165, <<3::256>>)
iex> ix.program_id
<<0::256>>
iex> byte_size(ix.data)
52
@spec program_id() :: <<_::256>>
Returns the System Program pubkey (32 zero bytes).
Delegates to Cartouche.Solana.Programs.system_program/0.
@spec transfer(<<_::256>>, <<_::256>>, non_neg_integer()) :: Cartouche.Solana.Transaction.Instruction.t()
Build a transfer instruction (SOL transfer).
System Program instruction index 2.
Examples
iex> ix = Cartouche.Solana.SystemProgram.transfer(<<1::256>>, <<2::256>>, 1_000_000_000)
iex> ix.program_id
<<0::256>>
iex> byte_size(ix.data)
12