system

package
v3.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateAccountTypeID          uint32 = iota
	AssignTypeID                        // 1
	TransferTypeID                      // 2
	CreateAccountWithSeedTypeID         // 3
	AdvanceNonceAccountTypeID           // 4
	WithdrawNonceAccountTypeID          // 5
	InitializeNonceAccountTypeID        // 6
	AuthorizeNonceAccountTypeID         // 7
	AllocateTypeID                      // 8
	AllocateWithSeedTypeID              // 9
	AssignWithSeedTypeID                // 10
)

typeID constants

Variables

View Source
var (
	SystemProgramID               = types.MustPublicKeyFromBase58("11111111111111111111111111111111")
	SysvarRentProgramID           = types.MustPublicKeyFromBase58("SysvarRent111111111111111111111111111111111")
	SysvarC1ockProgramID          = types.MustPublicKeyFromBase58("SysvarC1ock11111111111111111111111111111111")
	SysvarRecentBlockhashesPubkey = types.MustPublicKeyFromBase58("SysvarRecentB1ockHashes11111111111111111111")
	MemoProgramID                 = types.MustPublicKeyFromBase58("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr")
	MemoProgramIDV2               = types.MustPublicKeyFromBase58("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo")
)

programID constants

View Source
var InstructionImplDef = bin.NewVariantDefinition(bin.Uint32TypeIDEncoding, []bin.VariantType{
	{Name: "create_account", Type: (*CreateAccount)(nil)},
	{Name: "assign", Type: (*Assign)(nil)},
	{Name: "transfer", Type: (*Transfer)(nil)},
})

InstructionImplDef default

Functions

This section is empty.

Types

type AdvanceNonceAccounts

type AdvanceNonceAccounts struct {
	NoncePubkey      *types.AccountMeta
	BlockHash        *types.AccountMeta
	AuthorizedPubkey *types.AccountMeta
}

AdvanceNonceAccount advance nonce account

type Allocate

type Allocate struct {
	// Prefix with 0x08
	Space bin.Uint64
}

Allocate type

type AllocateWithSeed

type AllocateWithSeed struct {
	// Prefix with byte 0x09
	Base  types.PublicKey
	Seed  types.BorshString
	Space bin.Uint64
	Owner types.PublicKey
}

AllocateWithSeed type

type Assign

type Assign struct {
	// Prefix with byte 0x01
	Owner types.PublicKey
}

Assign type

type AssignWithSeed

type AssignWithSeed struct {
	// Prefix with byte 0x0a
	Base  types.PublicKey
	Seed  types.BorshString
	Owner types.PublicKey
}

AssignWithSeed type

type AuthorizeNonceAccount

type AuthorizeNonceAccount struct {
	// Prefix with 0x07
	AuthorizeAccount types.PublicKey
}

AuthorizeNonceAccount authorize nonce account

type CreateAccount

type CreateAccount struct {
	Lamports bin.Uint64
	Space    bin.Uint64
	Owner    types.PublicKey
	Accounts *CreateAccountAccounts `bin:"-"`
}

CreateAccount type

func (*CreateAccount) SetAccounts

func (i *CreateAccount) SetAccounts(accounts []*types.AccountMeta) error

SetAccounts set accounts

type CreateAccountAccounts

type CreateAccountAccounts struct {
	From *types.AccountMeta `text:"linear,notype"`
	New  *types.AccountMeta `text:"linear,notype"`
}

CreateAccountAccounts type

type CreateAccountWithSeed

type CreateAccountWithSeed struct {
	// Prefix with byte 0x03
	Base     types.PublicKey
	Seed     types.BorshString
	Lamports bin.Uint64
	Space    bin.Uint64
	Owner    types.PublicKey
}

CreateAccountWithSeed type

type InitializeNonceAccount

type InitializeNonceAccount struct {
	// Prefix with 0x06
	AuthorizedAccount types.PublicKey
}

InitializeNonceAccount initialize nonce account

type Instruction

type Instruction struct {
	bin.BaseVariant
}

Instruction type

func DecodeInstruction

func DecodeInstruction(accounts []*types.AccountMeta, data []byte) (*Instruction, error)

DecodeInstruction decode instruction

func NewCreateAccountInstruction

func NewCreateAccountInstruction(lamports uint64, space uint64, owner, from, to types.PublicKey) *Instruction

NewCreateAccountInstruction new create account instruction

func NewNonceAdvanceInstruction

func NewNonceAdvanceInstruction(noncePubkey, authorizedPubkey types.PublicKey) *Instruction

NewNonceAdvanceInstruction new NonceAdvance solana instruction

func NewTransferSolanaInstruction

func NewTransferSolanaInstruction(from, to types.PublicKey, lamports uint64) *Instruction

NewTransferSolanaInstruction new transfer solana instruction

func (*Instruction) Accounts

func (i *Instruction) Accounts() (out []*types.AccountMeta)

Accounts get accounts

func (*Instruction) Data

func (i *Instruction) Data() ([]byte, error)

Data return data

func (*Instruction) MarshalBinary

func (i *Instruction) MarshalBinary(encoder *bin.Encoder) error

MarshalBinary marshal binary

func (*Instruction) ProgramID

func (i *Instruction) ProgramID() types.PublicKey

ProgramID return program id

func (*Instruction) UnmarshalBinary

func (i *Instruction) UnmarshalBinary(decoder *bin.Decoder) error

UnmarshalBinary unmarshal binary

type NonceAccount

type NonceAccount struct {
	// Prefix with 0x04
	Accounts *AdvanceNonceAccounts `bin:"-"`
}

type Transfer

type Transfer struct {
	// Prefix with byte 0x02
	Lamports bin.Uint64
	Accounts *TransferAccounts `bin:"-"`
}

Transfer type

func (*Transfer) SetAccounts

func (i *Transfer) SetAccounts(accounts []*types.AccountMeta) error

SetAccounts set accounts

type TransferAccounts

type TransferAccounts struct {
	From *types.AccountMeta `text:"linear,notype"`
	To   *types.AccountMeta `text:"linear,notype"`
}

TransferAccounts type

type WithdrawNonceAccount

type WithdrawNonceAccount struct {
	// Prefix with 0x05
	Lamports bin.Uint64
}

WithdrawNonceAccount withdraw nonce account

Jump to

Keyboard shortcuts

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