systemProgram

package
v0.0.0-...-07b51e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package systemProgram provides a set of functions for constructing Solana system program instructions. See instruction definitions here: https://github.com/solana-labs/solana/blob/4b2fe9b20d4c895f4d3cb58c2918c72a5b0a5b64/sdk/program/src/system_instruction.rs#L142

Index

Constants

This section is empty.

Variables

View Source
var ID = solana.NewPublicKeyFromBase58String("11111111111111111111111111111111")

ID is the Solana system program ID

Functions

func CreateAccount

func CreateAccount(params CreateAccountParams) ([]solana.Instruction, error)

CreateAccount creates a Solana system program Instruction

Types

type CreateAccountParams

type CreateAccountParams struct {
	// FromPubkey is the account that will transfer the required Lamports
	// to cover the required Space to the new account
	// Req: [writer, signer]
	FromPubkey solana.PublicKey

	// NewAccountPubkey is the public key for the new account
	// Req: [writer, signer]
	NewAccountPubkey solana.PublicKey

	// Lamports is the amount of Lamports that will be transferred to the
	// new account on opening.
	Lamports uint64

	// Space is the amount of space in bytes to allocate to the new account
	Space uint64

	// ProgramID is the Public key of the program to assign as the owner of
	// the new account
	ProgramID solana.PublicKey
}

type Instruction

type Instruction uint32

Instruction is a Solana system program Instruction. See rust defs here: https://github.com/solana-labs/solana/blob/4b2fe9b20d4c895f4d3cb58c2918c72a5b0a5b64/sdk/program/src/system_instruction.rs#L142

const (
	CreateAccountInstruction Instruction = iota
	AssignInstruction
	TransferInstruction
	CreateAccountWithSeedInstruction
	AdvanceNonceAccountInstruction
	WithdrawNonceAccountInstruction
	InitializeNonceAccountInstruction
	AuthorizeNonceAccountInstruction
	AllocateInstruction
	AllocateWithSeedInstruction
	AssignWithSeedInstruction
	TransferWithSeedInstruction
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL