system

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 85

Documentation

Index

Constants

View Source
const (
	// Create a new account
	Instruction_CreateAccount uint32 = iota

	// Assign account to a program
	Instruction_Assign

	// Transfer lamports
	Instruction_Transfer

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

	// Consumes a stored nonce, replacing it with a successor
	Instruction_AdvanceNonceAccount

	// Withdraw funds from a nonce account
	Instruction_WithdrawNonceAccount

	// Drive state of Uninitalized nonce account to Initialized, setting the nonce value
	Instruction_InitializeNonceAccount

	// Change the entity authorized to execute nonce instructions on the account
	Instruction_AuthorizeNonceAccount

	// Allocate space in a (possibly new) account without funding
	Instruction_Allocate

	// Allocate space for and assign an account at an address derived from a base public key and a seed
	Instruction_AllocateWithSeed

	// Assign account to a program based on a seed
	Instruction_AssignWithSeed

	// Transfer lamports from a derived address
	Instruction_TransferWithSeed
)
View Source
const ProgramName = "System"

Variables

View Source
var InstructionImplDef = ag_binary.NewVariantDefinition(
	ag_binary.Uint32TypeIDEncoding,
	[]ag_binary.VariantType{
		{
			"CreateAccount", (*CreateAccount)(nil),
		},
		{
			"Assign", (*Assign)(nil),
		},
		{
			"Transfer", (*Transfer)(nil),
		},
		{
			"CreateAccountWithSeed", (*CreateAccountWithSeed)(nil),
		},
		{
			"AdvanceNonceAccount", (*AdvanceNonceAccount)(nil),
		},
		{
			"WithdrawNonceAccount", (*WithdrawNonceAccount)(nil),
		},
		{
			"InitializeNonceAccount", (*InitializeNonceAccount)(nil),
		},
		{
			"AuthorizeNonceAccount", (*AuthorizeNonceAccount)(nil),
		},
		{
			"Allocate", (*Allocate)(nil),
		},
		{
			"AllocateWithSeed", (*AllocateWithSeed)(nil),
		},
		{
			"AssignWithSeed", (*AssignWithSeed)(nil),
		},
		{
			"TransferWithSeed", (*TransferWithSeed)(nil),
		},
	},
)

Functions

func InstructionIDToName added in v0.4.0

func InstructionIDToName(id uint32) string

InstructionIDToName returns the name of the instruction given its ID.

func SetProgramID added in v0.4.0

func SetProgramID(pubkey ag_solanago.PublicKey)

Types

type AdvanceNonceAccount

type AdvanceNonceAccount struct {

	// [0] = [WRITE] NonceAccount
	// ··········· Nonce account
	//
	// [1] = [] $(SysVarRecentBlockHashesPubkey)
	// ··········· RecentBlockhashes sysvar
	//
	// [2] = [SIGNER] NonceAuthorityAccount
	// ··········· Nonce authority
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Consumes a stored nonce, replacing it with a successor

func NewAdvanceNonceAccountInstruction added in v0.4.0

func NewAdvanceNonceAccountInstruction(

	nonceAccount ag_solanago.PublicKey,
	SysVarRecentBlockHashesPubkey ag_solanago.PublicKey,
	nonceAuthorityAccount ag_solanago.PublicKey) *AdvanceNonceAccount

NewAdvanceNonceAccountInstruction declares a new AdvanceNonceAccount instruction with the provided parameters and accounts.

func NewAdvanceNonceAccountInstructionBuilder added in v0.4.0

func NewAdvanceNonceAccountInstructionBuilder() *AdvanceNonceAccount

NewAdvanceNonceAccountInstructionBuilder creates a new `AdvanceNonceAccount` instruction builder.

func (AdvanceNonceAccount) Build added in v0.4.0

func (inst AdvanceNonceAccount) Build() *Instruction

func (*AdvanceNonceAccount) EncodeToTree added in v0.4.0

func (inst *AdvanceNonceAccount) EncodeToTree(parent ag_treeout.Branches)

func (*AdvanceNonceAccount) GetNonceAccount added in v0.4.0

func (inst *AdvanceNonceAccount) GetNonceAccount() *ag_solanago.AccountMeta

func (*AdvanceNonceAccount) GetNonceAuthorityAccount added in v0.4.0

func (inst *AdvanceNonceAccount) GetNonceAuthorityAccount() *ag_solanago.AccountMeta

func (*AdvanceNonceAccount) GetSysVarRecentBlockHashesPubkeyAccount added in v0.4.0

func (inst *AdvanceNonceAccount) GetSysVarRecentBlockHashesPubkeyAccount() *ag_solanago.AccountMeta

func (AdvanceNonceAccount) MarshalWithEncoder added in v0.4.0

func (inst AdvanceNonceAccount) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*AdvanceNonceAccount) SetNonceAccount added in v0.4.0

func (inst *AdvanceNonceAccount) SetNonceAccount(nonceAccount ag_solanago.PublicKey) *AdvanceNonceAccount

Nonce account

func (*AdvanceNonceAccount) SetNonceAuthorityAccount added in v0.4.0

func (inst *AdvanceNonceAccount) SetNonceAuthorityAccount(nonceAuthorityAccount ag_solanago.PublicKey) *AdvanceNonceAccount

Nonce authority

func (*AdvanceNonceAccount) SetSysVarRecentBlockHashesPubkeyAccount added in v0.4.0

func (inst *AdvanceNonceAccount) SetSysVarRecentBlockHashesPubkeyAccount(SysVarRecentBlockHashesPubkey ag_solanago.PublicKey) *AdvanceNonceAccount

RecentBlockhashes sysvar

func (*AdvanceNonceAccount) UnmarshalWithDecoder added in v0.4.0

func (inst *AdvanceNonceAccount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*AdvanceNonceAccount) Validate added in v0.4.0

func (inst *AdvanceNonceAccount) Validate() error

func (AdvanceNonceAccount) ValidateAndBuild added in v0.4.0

func (inst AdvanceNonceAccount) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Allocate

type Allocate struct {
	// Number of bytes of memory to allocate
	Space *uint64

	// [0] = [WRITE, SIGNER] NewAccount
	// ··········· New account
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Allocate space in a (possibly new) account without funding

func NewAllocateInstruction added in v0.4.0

func NewAllocateInstruction(

	space uint64,

	newAccount ag_solanago.PublicKey) *Allocate

NewAllocateInstruction declares a new Allocate instruction with the provided parameters and accounts.

func NewAllocateInstructionBuilder added in v0.4.0

func NewAllocateInstructionBuilder() *Allocate

NewAllocateInstructionBuilder creates a new `Allocate` instruction builder.

func (Allocate) Build added in v0.4.0

func (inst Allocate) Build() *Instruction

func (*Allocate) EncodeToTree added in v0.4.0

func (inst *Allocate) EncodeToTree(parent ag_treeout.Branches)

func (*Allocate) GetNewAccount added in v0.4.0

func (inst *Allocate) GetNewAccount() *ag_solanago.AccountMeta

func (Allocate) MarshalWithEncoder added in v0.4.0

func (inst Allocate) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*Allocate) SetNewAccount added in v0.4.0

func (inst *Allocate) SetNewAccount(newAccount ag_solanago.PublicKey) *Allocate

New account

func (*Allocate) SetSpace added in v0.4.0

func (inst *Allocate) SetSpace(space uint64) *Allocate

Number of bytes of memory to allocate

func (*Allocate) UnmarshalWithDecoder added in v0.4.0

func (inst *Allocate) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*Allocate) Validate added in v0.4.0

func (inst *Allocate) Validate() error

func (Allocate) ValidateAndBuild added in v0.4.0

func (inst Allocate) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type AllocateWithSeed

type AllocateWithSeed struct {
	// Base public key
	Base *ag_solanago.PublicKey

	// String of ASCII chars, no longer than pubkey::MAX_SEED_LEN
	Seed *string

	// Number of bytes of memory to allocate
	Space *uint64

	// Owner program account address
	Owner *ag_solanago.PublicKey

	// [0] = [WRITE] AllocatedAccount
	// ··········· Allocated account
	//
	// [1] = [SIGNER] BaseAccount
	// ··········· Base account
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

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

func NewAllocateWithSeedInstruction added in v0.4.0

func NewAllocateWithSeedInstruction(

	base ag_solanago.PublicKey,
	seed string,
	space uint64,
	owner ag_solanago.PublicKey,

	allocatedAccount ag_solanago.PublicKey,
	baseAccount ag_solanago.PublicKey) *AllocateWithSeed

NewAllocateWithSeedInstruction declares a new AllocateWithSeed instruction with the provided parameters and accounts.

func NewAllocateWithSeedInstructionBuilder added in v0.4.0

func NewAllocateWithSeedInstructionBuilder() *AllocateWithSeed

NewAllocateWithSeedInstructionBuilder creates a new `AllocateWithSeed` instruction builder.

func (AllocateWithSeed) Build added in v0.4.0

func (inst AllocateWithSeed) Build() *Instruction

func (*AllocateWithSeed) EncodeToTree added in v0.4.0

func (inst *AllocateWithSeed) EncodeToTree(parent ag_treeout.Branches)

func (*AllocateWithSeed) GetAllocatedAccount added in v0.4.0

func (inst *AllocateWithSeed) GetAllocatedAccount() *ag_solanago.AccountMeta

func (*AllocateWithSeed) GetBaseAccount added in v0.4.0

func (inst *AllocateWithSeed) GetBaseAccount() *ag_solanago.AccountMeta

func (AllocateWithSeed) MarshalWithEncoder added in v0.4.0

func (inst AllocateWithSeed) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*AllocateWithSeed) SetAllocatedAccount added in v0.4.0

func (inst *AllocateWithSeed) SetAllocatedAccount(allocatedAccount ag_solanago.PublicKey) *AllocateWithSeed

Allocated account

func (*AllocateWithSeed) SetBase added in v0.4.0

Base public key

func (*AllocateWithSeed) SetBaseAccount added in v0.4.0

func (inst *AllocateWithSeed) SetBaseAccount(baseAccount ag_solanago.PublicKey) *AllocateWithSeed

Base account

func (*AllocateWithSeed) SetOwner added in v0.4.0

func (inst *AllocateWithSeed) SetOwner(owner ag_solanago.PublicKey) *AllocateWithSeed

Owner program account address

func (*AllocateWithSeed) SetSeed added in v0.4.0

func (inst *AllocateWithSeed) SetSeed(seed string) *AllocateWithSeed

String of ASCII chars, no longer than pubkey::MAX_SEED_LEN

func (*AllocateWithSeed) SetSpace added in v0.4.0

func (inst *AllocateWithSeed) SetSpace(space uint64) *AllocateWithSeed

Number of bytes of memory to allocate

func (*AllocateWithSeed) UnmarshalWithDecoder added in v0.4.0

func (inst *AllocateWithSeed) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*AllocateWithSeed) Validate added in v0.4.0

func (inst *AllocateWithSeed) Validate() error

func (AllocateWithSeed) ValidateAndBuild added in v0.4.0

func (inst AllocateWithSeed) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Assign

type Assign struct {
	// Owner program account
	Owner *ag_solanago.PublicKey

	// [0] = [WRITE, SIGNER] AssignedAccount
	// ··········· Assigned account public key
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Assign account to a program

func NewAssignInstruction added in v0.4.0

func NewAssignInstruction(

	owner ag_solanago.PublicKey,

	assignedAccount ag_solanago.PublicKey) *Assign

NewAssignInstruction declares a new Assign instruction with the provided parameters and accounts.

func NewAssignInstructionBuilder added in v0.4.0

func NewAssignInstructionBuilder() *Assign

NewAssignInstructionBuilder creates a new `Assign` instruction builder.

func (Assign) Build added in v0.4.0

func (inst Assign) Build() *Instruction

func (*Assign) EncodeToTree added in v0.4.0

func (inst *Assign) EncodeToTree(parent ag_treeout.Branches)

func (*Assign) GetAssignedAccount added in v0.4.0

func (inst *Assign) GetAssignedAccount() *ag_solanago.AccountMeta

func (Assign) MarshalWithEncoder added in v0.4.0

func (inst Assign) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*Assign) SetAssignedAccount added in v0.4.0

func (inst *Assign) SetAssignedAccount(assignedAccount ag_solanago.PublicKey) *Assign

Assigned account public key

func (*Assign) SetOwner added in v0.4.0

func (inst *Assign) SetOwner(owner ag_solanago.PublicKey) *Assign

Owner program account

func (*Assign) UnmarshalWithDecoder added in v0.4.0

func (inst *Assign) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*Assign) Validate added in v0.4.0

func (inst *Assign) Validate() error

func (Assign) ValidateAndBuild added in v0.4.0

func (inst Assign) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type AssignWithSeed

type AssignWithSeed struct {
	// Base public key
	Base *ag_solanago.PublicKey

	// String of ASCII chars, no longer than pubkey::MAX_SEED_LEN
	Seed *string

	// Owner program account
	Owner *ag_solanago.PublicKey

	// [0] = [WRITE] AssignedAccount
	// ··········· Assigned account
	//
	// [1] = [SIGNER] BaseAccount
	// ··········· Base account
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Assign account to a program based on a seed

func NewAssignWithSeedInstruction added in v0.4.0

func NewAssignWithSeedInstruction(

	base ag_solanago.PublicKey,
	seed string,
	owner ag_solanago.PublicKey,

	assignedAccount ag_solanago.PublicKey,
	baseAccount ag_solanago.PublicKey) *AssignWithSeed

NewAssignWithSeedInstruction declares a new AssignWithSeed instruction with the provided parameters and accounts.

func NewAssignWithSeedInstructionBuilder added in v0.4.0

func NewAssignWithSeedInstructionBuilder() *AssignWithSeed

NewAssignWithSeedInstructionBuilder creates a new `AssignWithSeed` instruction builder.

func (AssignWithSeed) Build added in v0.4.0

func (inst AssignWithSeed) Build() *Instruction

func (*AssignWithSeed) EncodeToTree added in v0.4.0

func (inst *AssignWithSeed) EncodeToTree(parent ag_treeout.Branches)

func (*AssignWithSeed) GetAssignedAccount added in v0.4.0

func (inst *AssignWithSeed) GetAssignedAccount() *ag_solanago.AccountMeta

func (*AssignWithSeed) GetBaseAccount added in v0.4.0

func (inst *AssignWithSeed) GetBaseAccount() *ag_solanago.AccountMeta

func (AssignWithSeed) MarshalWithEncoder added in v0.4.0

func (inst AssignWithSeed) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*AssignWithSeed) SetAssignedAccount added in v0.4.0

func (inst *AssignWithSeed) SetAssignedAccount(assignedAccount ag_solanago.PublicKey) *AssignWithSeed

Assigned account

func (*AssignWithSeed) SetBase added in v0.4.0

func (inst *AssignWithSeed) SetBase(base ag_solanago.PublicKey) *AssignWithSeed

Base public key

func (*AssignWithSeed) SetBaseAccount added in v0.4.0

func (inst *AssignWithSeed) SetBaseAccount(baseAccount ag_solanago.PublicKey) *AssignWithSeed

Base account

func (*AssignWithSeed) SetOwner added in v0.4.0

func (inst *AssignWithSeed) SetOwner(owner ag_solanago.PublicKey) *AssignWithSeed

Owner program account

func (*AssignWithSeed) SetSeed added in v0.4.0

func (inst *AssignWithSeed) SetSeed(seed string) *AssignWithSeed

String of ASCII chars, no longer than pubkey::MAX_SEED_LEN

func (*AssignWithSeed) UnmarshalWithDecoder added in v0.4.0

func (inst *AssignWithSeed) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*AssignWithSeed) Validate added in v0.4.0

func (inst *AssignWithSeed) Validate() error

func (AssignWithSeed) ValidateAndBuild added in v0.4.0

func (inst AssignWithSeed) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type AuthorizeNonceAccount

type AuthorizeNonceAccount struct {
	// The Pubkey parameter identifies the entity to authorize.
	Authorized *ag_solanago.PublicKey

	// [0] = [WRITE] NonceAccount
	// ··········· Nonce account
	//
	// [1] = [SIGNER] NonceAuthorityAccount
	// ··········· Nonce authority
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Change the entity authorized to execute nonce instructions on the account

func NewAuthorizeNonceAccountInstruction added in v0.4.0

func NewAuthorizeNonceAccountInstruction(

	authorized ag_solanago.PublicKey,

	nonceAccount ag_solanago.PublicKey,
	nonceAuthorityAccount ag_solanago.PublicKey) *AuthorizeNonceAccount

NewAuthorizeNonceAccountInstruction declares a new AuthorizeNonceAccount instruction with the provided parameters and accounts.

func NewAuthorizeNonceAccountInstructionBuilder added in v0.4.0

func NewAuthorizeNonceAccountInstructionBuilder() *AuthorizeNonceAccount

NewAuthorizeNonceAccountInstructionBuilder creates a new `AuthorizeNonceAccount` instruction builder.

func (AuthorizeNonceAccount) Build added in v0.4.0

func (inst AuthorizeNonceAccount) Build() *Instruction

func (*AuthorizeNonceAccount) EncodeToTree added in v0.4.0

func (inst *AuthorizeNonceAccount) EncodeToTree(parent ag_treeout.Branches)

func (*AuthorizeNonceAccount) GetNonceAccount added in v0.4.0

func (inst *AuthorizeNonceAccount) GetNonceAccount() *ag_solanago.AccountMeta

func (*AuthorizeNonceAccount) GetNonceAuthorityAccount added in v0.4.0

func (inst *AuthorizeNonceAccount) GetNonceAuthorityAccount() *ag_solanago.AccountMeta

func (AuthorizeNonceAccount) MarshalWithEncoder added in v0.4.0

func (inst AuthorizeNonceAccount) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*AuthorizeNonceAccount) SetAuthorized added in v0.4.0

func (inst *AuthorizeNonceAccount) SetAuthorized(authorized ag_solanago.PublicKey) *AuthorizeNonceAccount

The Pubkey parameter identifies the entity to authorize.

func (*AuthorizeNonceAccount) SetNonceAccount added in v0.4.0

func (inst *AuthorizeNonceAccount) SetNonceAccount(nonceAccount ag_solanago.PublicKey) *AuthorizeNonceAccount

Nonce account

func (*AuthorizeNonceAccount) SetNonceAuthorityAccount added in v0.4.0

func (inst *AuthorizeNonceAccount) SetNonceAuthorityAccount(nonceAuthorityAccount ag_solanago.PublicKey) *AuthorizeNonceAccount

Nonce authority

func (*AuthorizeNonceAccount) UnmarshalWithDecoder added in v0.4.0

func (inst *AuthorizeNonceAccount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*AuthorizeNonceAccount) Validate added in v0.4.0

func (inst *AuthorizeNonceAccount) Validate() error

func (AuthorizeNonceAccount) ValidateAndBuild added in v0.4.0

func (inst AuthorizeNonceAccount) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type CreateAccount

type CreateAccount struct {
	// Number of lamports to transfer to the new account
	Lamports *uint64

	// Number of bytes of memory to allocate
	Space *uint64

	// Address of program that will own the new account
	Owner *ag_solanago.PublicKey

	// [0] = [WRITE, SIGNER] FundingAccount
	// ··········· Funding account
	//
	// [1] = [WRITE, SIGNER] NewAccount
	// ··········· New account
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Create a new account

func NewCreateAccountInstruction

func NewCreateAccountInstruction(

	lamports uint64,
	space uint64,
	owner ag_solanago.PublicKey,

	fundingAccount ag_solanago.PublicKey,
	newAccount ag_solanago.PublicKey) *CreateAccount

NewCreateAccountInstruction declares a new CreateAccount instruction with the provided parameters and accounts.

func NewCreateAccountInstructionBuilder added in v0.4.0

func NewCreateAccountInstructionBuilder() *CreateAccount

NewCreateAccountInstructionBuilder creates a new `CreateAccount` instruction builder.

func (CreateAccount) Build added in v0.4.0

func (inst CreateAccount) Build() *Instruction

func (*CreateAccount) EncodeToTree added in v0.4.0

func (inst *CreateAccount) EncodeToTree(parent ag_treeout.Branches)

func (*CreateAccount) GetFundingAccount added in v0.4.0

func (inst *CreateAccount) GetFundingAccount() *ag_solanago.AccountMeta

func (*CreateAccount) GetNewAccount added in v0.4.0

func (inst *CreateAccount) GetNewAccount() *ag_solanago.AccountMeta

func (CreateAccount) MarshalWithEncoder added in v0.4.0

func (inst CreateAccount) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*CreateAccount) SetFundingAccount added in v0.4.0

func (inst *CreateAccount) SetFundingAccount(fundingAccount ag_solanago.PublicKey) *CreateAccount

Funding account

func (*CreateAccount) SetLamports added in v0.4.0

func (inst *CreateAccount) SetLamports(lamports uint64) *CreateAccount

Number of lamports to transfer to the new account

func (*CreateAccount) SetNewAccount added in v0.4.0

func (inst *CreateAccount) SetNewAccount(newAccount ag_solanago.PublicKey) *CreateAccount

New account

func (*CreateAccount) SetOwner added in v0.4.0

func (inst *CreateAccount) SetOwner(owner ag_solanago.PublicKey) *CreateAccount

Address of program that will own the new account

func (*CreateAccount) SetSpace added in v0.4.0

func (inst *CreateAccount) SetSpace(space uint64) *CreateAccount

Number of bytes of memory to allocate

func (*CreateAccount) UnmarshalWithDecoder added in v0.4.0

func (inst *CreateAccount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*CreateAccount) Validate added in v0.4.0

func (inst *CreateAccount) Validate() error

func (CreateAccount) ValidateAndBuild added in v0.4.0

func (inst CreateAccount) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type CreateAccountWithSeed

type CreateAccountWithSeed struct {
	// Base public key
	Base *ag_solanago.PublicKey

	// String of ASCII chars, no longer than Pubkey::MAX_SEED_LEN
	Seed *string

	// Number of lamports to transfer to the new account
	Lamports *uint64

	// Number of bytes of memory to allocate
	Space *uint64

	// Owner program account address
	Owner *ag_solanago.PublicKey

	// [0] = [WRITE, SIGNER] FundingAccount
	// ··········· Funding account
	//
	// [1] = [WRITE] CreatedAccount
	// ··········· Created account
	//
	// [2] = [SIGNER] BaseAccount
	// ··········· Base account
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

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

func NewCreateAccountWithSeedInstruction added in v0.4.0

func NewCreateAccountWithSeedInstruction(

	base ag_solanago.PublicKey,
	seed string,
	lamports uint64,
	space uint64,
	owner ag_solanago.PublicKey,

	fundingAccount ag_solanago.PublicKey,
	createdAccount ag_solanago.PublicKey,
	baseAccount ag_solanago.PublicKey) *CreateAccountWithSeed

NewCreateAccountWithSeedInstruction declares a new CreateAccountWithSeed instruction with the provided parameters and accounts.

func NewCreateAccountWithSeedInstructionBuilder added in v0.4.0

func NewCreateAccountWithSeedInstructionBuilder() *CreateAccountWithSeed

NewCreateAccountWithSeedInstructionBuilder creates a new `CreateAccountWithSeed` instruction builder.

func (CreateAccountWithSeed) Build added in v0.4.0

func (inst CreateAccountWithSeed) Build() *Instruction

func (*CreateAccountWithSeed) EncodeToTree added in v0.4.0

func (inst *CreateAccountWithSeed) EncodeToTree(parent ag_treeout.Branches)

func (*CreateAccountWithSeed) GetBaseAccount added in v0.4.0

func (inst *CreateAccountWithSeed) GetBaseAccount() *ag_solanago.AccountMeta

func (*CreateAccountWithSeed) GetCreatedAccount added in v0.4.0

func (inst *CreateAccountWithSeed) GetCreatedAccount() *ag_solanago.AccountMeta

func (*CreateAccountWithSeed) GetFundingAccount added in v0.4.0

func (inst *CreateAccountWithSeed) GetFundingAccount() *ag_solanago.AccountMeta

func (CreateAccountWithSeed) MarshalWithEncoder added in v0.4.0

func (inst CreateAccountWithSeed) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*CreateAccountWithSeed) SetBase added in v0.4.0

Base public key

func (*CreateAccountWithSeed) SetBaseAccount added in v0.4.0

func (inst *CreateAccountWithSeed) SetBaseAccount(baseAccount ag_solanago.PublicKey) *CreateAccountWithSeed

Base account

func (*CreateAccountWithSeed) SetCreatedAccount added in v0.4.0

func (inst *CreateAccountWithSeed) SetCreatedAccount(createdAccount ag_solanago.PublicKey) *CreateAccountWithSeed

Created account

func (*CreateAccountWithSeed) SetFundingAccount added in v0.4.0

func (inst *CreateAccountWithSeed) SetFundingAccount(fundingAccount ag_solanago.PublicKey) *CreateAccountWithSeed

Funding account

func (*CreateAccountWithSeed) SetLamports added in v0.4.0

func (inst *CreateAccountWithSeed) SetLamports(lamports uint64) *CreateAccountWithSeed

Number of lamports to transfer to the new account

func (*CreateAccountWithSeed) SetOwner added in v0.4.0

Owner program account address

func (*CreateAccountWithSeed) SetSeed added in v0.4.0

func (inst *CreateAccountWithSeed) SetSeed(seed string) *CreateAccountWithSeed

String of ASCII chars, no longer than Pubkey::MAX_SEED_LEN

func (*CreateAccountWithSeed) SetSpace added in v0.4.0

func (inst *CreateAccountWithSeed) SetSpace(space uint64) *CreateAccountWithSeed

Number of bytes of memory to allocate

func (*CreateAccountWithSeed) UnmarshalWithDecoder added in v0.4.0

func (inst *CreateAccountWithSeed) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*CreateAccountWithSeed) Validate added in v0.4.0

func (inst *CreateAccountWithSeed) Validate() error

func (CreateAccountWithSeed) ValidateAndBuild added in v0.4.0

func (inst CreateAccountWithSeed) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type FeeCalculator added in v1.0.3

type FeeCalculator struct {
	LamportsPerSignature uint64
}

func (FeeCalculator) MarshalWithEncoder added in v1.0.3

func (obj FeeCalculator) MarshalWithEncoder(encoder *bin.Encoder) (err error)

func (*FeeCalculator) UnmarshalWithDecoder added in v1.0.3

func (obj *FeeCalculator) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type InitializeNonceAccount

type InitializeNonceAccount struct {
	// 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.
	Authorized *ag_solanago.PublicKey

	// [0] = [WRITE] NonceAccount
	// ··········· Nonce account
	//
	// [1] = [] $(SysVarRecentBlockHashesPubkey)
	// ··········· RecentBlockhashes sysvar
	//
	// [2] = [] $(SysVarRentPubkey)
	// ··········· Rent sysvar
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Drive state of Uninitalized nonce account to Initialized, setting the nonce value

func NewInitializeNonceAccountInstruction added in v0.4.0

func NewInitializeNonceAccountInstruction(

	authorized ag_solanago.PublicKey,

	nonceAccount ag_solanago.PublicKey,
	SysVarRecentBlockHashesPubkey ag_solanago.PublicKey,
	SysVarRentPubkey ag_solanago.PublicKey) *InitializeNonceAccount

NewInitializeNonceAccountInstruction declares a new InitializeNonceAccount instruction with the provided parameters and accounts.

func NewInitializeNonceAccountInstructionBuilder added in v0.4.0

func NewInitializeNonceAccountInstructionBuilder() *InitializeNonceAccount

NewInitializeNonceAccountInstructionBuilder creates a new `InitializeNonceAccount` instruction builder.

func (InitializeNonceAccount) Build added in v0.4.0

func (inst InitializeNonceAccount) Build() *Instruction

func (*InitializeNonceAccount) EncodeToTree added in v0.4.0

func (inst *InitializeNonceAccount) EncodeToTree(parent ag_treeout.Branches)

func (*InitializeNonceAccount) GetNonceAccount added in v0.4.0

func (inst *InitializeNonceAccount) GetNonceAccount() *ag_solanago.AccountMeta

func (*InitializeNonceAccount) GetSysVarRecentBlockHashesPubkeyAccount added in v0.4.0

func (inst *InitializeNonceAccount) GetSysVarRecentBlockHashesPubkeyAccount() *ag_solanago.AccountMeta

func (*InitializeNonceAccount) GetSysVarRentPubkeyAccount added in v0.4.0

func (inst *InitializeNonceAccount) GetSysVarRentPubkeyAccount() *ag_solanago.AccountMeta

func (InitializeNonceAccount) MarshalWithEncoder added in v0.4.0

func (inst InitializeNonceAccount) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*InitializeNonceAccount) SetAuthorized added in v0.4.0

func (inst *InitializeNonceAccount) SetAuthorized(authorized ag_solanago.PublicKey) *InitializeNonceAccount

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.

func (*InitializeNonceAccount) SetNonceAccount added in v0.4.0

func (inst *InitializeNonceAccount) SetNonceAccount(nonceAccount ag_solanago.PublicKey) *InitializeNonceAccount

Nonce account

func (*InitializeNonceAccount) SetSysVarRecentBlockHashesPubkeyAccount added in v0.4.0

func (inst *InitializeNonceAccount) SetSysVarRecentBlockHashesPubkeyAccount(SysVarRecentBlockHashesPubkey ag_solanago.PublicKey) *InitializeNonceAccount

RecentBlockhashes sysvar

func (*InitializeNonceAccount) SetSysVarRentPubkeyAccount added in v0.4.0

func (inst *InitializeNonceAccount) SetSysVarRentPubkeyAccount(SysVarRentPubkey ag_solanago.PublicKey) *InitializeNonceAccount

Rent sysvar

func (*InitializeNonceAccount) UnmarshalWithDecoder added in v0.4.0

func (inst *InitializeNonceAccount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*InitializeNonceAccount) Validate added in v0.4.0

func (inst *InitializeNonceAccount) Validate() error

func (InitializeNonceAccount) ValidateAndBuild added in v0.4.0

func (inst InitializeNonceAccount) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type Instruction

type Instruction struct {
	ag_binary.BaseVariant
}

func DecodeInstruction

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

func (*Instruction) Accounts

func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta)

func (*Instruction) Data

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

func (*Instruction) EncodeToTree added in v0.4.0

func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches)

func (Instruction) MarshalWithEncoder added in v0.4.0

func (inst Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*Instruction) ProgramID

func (inst *Instruction) ProgramID() ag_solanago.PublicKey

func (*Instruction) TextEncode

func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error

func (*Instruction) UnmarshalWithDecoder added in v0.4.0

func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

type NonceAccount added in v1.0.3

type NonceAccount struct {
	Version          uint32
	State            uint32
	AuthorizedPubkey solana.PublicKey
	Nonce            solana.PublicKey
	FeeCalculator    FeeCalculator
}

func (NonceAccount) MarshalWithEncoder added in v1.0.3

func (obj NonceAccount) MarshalWithEncoder(encoder *bin.Encoder) (err error)

func (*NonceAccount) UnmarshalWithDecoder added in v1.0.3

func (obj *NonceAccount) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type Transfer

type Transfer struct {
	// Number of lamports to transfer to the new account
	Lamports *uint64

	// [0] = [WRITE, SIGNER] FundingAccount
	// ··········· Funding account
	//
	// [1] = [WRITE] RecipientAccount
	// ··········· Recipient account
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Transfer lamports

func NewTransferInstruction added in v0.3.5

func NewTransferInstruction(

	lamports uint64,

	fundingAccount ag_solanago.PublicKey,
	recipientAccount ag_solanago.PublicKey) *Transfer

NewTransferInstruction declares a new Transfer instruction with the provided parameters and accounts.

func NewTransferInstructionBuilder added in v0.4.0

func NewTransferInstructionBuilder() *Transfer

NewTransferInstructionBuilder creates a new `Transfer` instruction builder.

func (Transfer) Build added in v0.4.0

func (inst Transfer) Build() *Instruction

func (*Transfer) EncodeToTree added in v0.4.0

func (inst *Transfer) EncodeToTree(parent ag_treeout.Branches)

func (*Transfer) GetFundingAccount added in v0.4.0

func (inst *Transfer) GetFundingAccount() *ag_solanago.AccountMeta

func (*Transfer) GetRecipientAccount added in v0.4.0

func (inst *Transfer) GetRecipientAccount() *ag_solanago.AccountMeta

func (Transfer) MarshalWithEncoder added in v0.4.0

func (inst Transfer) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*Transfer) SetFundingAccount added in v0.4.0

func (inst *Transfer) SetFundingAccount(fundingAccount ag_solanago.PublicKey) *Transfer

Funding account

func (*Transfer) SetLamports added in v0.4.0

func (inst *Transfer) SetLamports(lamports uint64) *Transfer

Number of lamports to transfer to the new account

func (*Transfer) SetRecipientAccount added in v0.4.0

func (inst *Transfer) SetRecipientAccount(recipientAccount ag_solanago.PublicKey) *Transfer

Recipient account

func (*Transfer) UnmarshalWithDecoder added in v0.4.0

func (inst *Transfer) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*Transfer) Validate added in v0.4.0

func (inst *Transfer) Validate() error

func (Transfer) ValidateAndBuild added in v0.4.0

func (inst Transfer) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type TransferWithSeed added in v0.4.0

type TransferWithSeed struct {
	// Amount to transfer
	Lamports *uint64

	// Seed to use to derive the funding account address
	FromSeed *string

	// Owner to use to derive the funding account address
	FromOwner *ag_solanago.PublicKey

	// [0] = [WRITE] FundingAccount
	// ··········· Funding account
	//
	// [1] = [SIGNER] BaseForFundingAccount
	// ··········· Base for funding account
	//
	// [2] = [WRITE] RecipientAccount
	// ··········· Recipient account
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Transfer lamports from a derived address

func NewTransferWithSeedInstruction added in v0.4.0

func NewTransferWithSeedInstruction(

	lamports uint64,
	from_seed string,
	from_owner ag_solanago.PublicKey,

	fundingAccount ag_solanago.PublicKey,
	baseForFundingAccount ag_solanago.PublicKey,
	recipientAccount ag_solanago.PublicKey) *TransferWithSeed

NewTransferWithSeedInstruction declares a new TransferWithSeed instruction with the provided parameters and accounts.

func NewTransferWithSeedInstructionBuilder added in v0.4.0

func NewTransferWithSeedInstructionBuilder() *TransferWithSeed

NewTransferWithSeedInstructionBuilder creates a new `TransferWithSeed` instruction builder.

func (TransferWithSeed) Build added in v0.4.0

func (inst TransferWithSeed) Build() *Instruction

func (*TransferWithSeed) EncodeToTree added in v0.4.0

func (inst *TransferWithSeed) EncodeToTree(parent ag_treeout.Branches)

func (*TransferWithSeed) GetBaseForFundingAccount added in v0.4.0

func (inst *TransferWithSeed) GetBaseForFundingAccount() *ag_solanago.AccountMeta

func (*TransferWithSeed) GetFundingAccount added in v0.4.0

func (inst *TransferWithSeed) GetFundingAccount() *ag_solanago.AccountMeta

func (*TransferWithSeed) GetRecipientAccount added in v0.4.0

func (inst *TransferWithSeed) GetRecipientAccount() *ag_solanago.AccountMeta

func (TransferWithSeed) MarshalWithEncoder added in v0.4.0

func (inst TransferWithSeed) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*TransferWithSeed) SetBaseForFundingAccount added in v0.4.0

func (inst *TransferWithSeed) SetBaseForFundingAccount(baseForFundingAccount ag_solanago.PublicKey) *TransferWithSeed

Base for funding account

func (*TransferWithSeed) SetFromOwner added in v0.4.0

func (inst *TransferWithSeed) SetFromOwner(from_owner ag_solanago.PublicKey) *TransferWithSeed

Owner to use to derive the funding account address

func (*TransferWithSeed) SetFromSeed added in v0.4.0

func (inst *TransferWithSeed) SetFromSeed(from_seed string) *TransferWithSeed

Seed to use to derive the funding account address

func (*TransferWithSeed) SetFundingAccount added in v0.4.0

func (inst *TransferWithSeed) SetFundingAccount(fundingAccount ag_solanago.PublicKey) *TransferWithSeed

Funding account

func (*TransferWithSeed) SetLamports added in v0.4.0

func (inst *TransferWithSeed) SetLamports(lamports uint64) *TransferWithSeed

Amount to transfer

func (*TransferWithSeed) SetRecipientAccount added in v0.4.0

func (inst *TransferWithSeed) SetRecipientAccount(recipientAccount ag_solanago.PublicKey) *TransferWithSeed

Recipient account

func (*TransferWithSeed) UnmarshalWithDecoder added in v0.4.0

func (inst *TransferWithSeed) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*TransferWithSeed) Validate added in v0.4.0

func (inst *TransferWithSeed) Validate() error

func (TransferWithSeed) ValidateAndBuild added in v0.4.0

func (inst TransferWithSeed) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type WithdrawNonceAccount

type WithdrawNonceAccount struct {
	// The u64 parameter is the lamports to withdraw, which must leave the account balance above the rent exempt reserve or at zero.
	Lamports *uint64

	// [0] = [WRITE] NonceAccount
	// ··········· Nonce account
	//
	// [1] = [WRITE] RecipientAccount
	// ··········· Recipient account
	//
	// [2] = [] $(SysVarRecentBlockHashesPubkey)
	// ··········· RecentBlockhashes sysvar
	//
	// [3] = [] $(SysVarRentPubkey)
	// ··········· Rent sysvar
	//
	// [4] = [SIGNER] NonceAuthorityAccount
	// ··········· Nonce authority
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

Withdraw funds from a nonce account

func NewWithdrawNonceAccountInstruction added in v0.4.0

func NewWithdrawNonceAccountInstruction(

	lamports uint64,

	nonceAccount ag_solanago.PublicKey,
	recipientAccount ag_solanago.PublicKey,
	SysVarRecentBlockHashesPubkey ag_solanago.PublicKey,
	SysVarRentPubkey ag_solanago.PublicKey,
	nonceAuthorityAccount ag_solanago.PublicKey) *WithdrawNonceAccount

NewWithdrawNonceAccountInstruction declares a new WithdrawNonceAccount instruction with the provided parameters and accounts.

func NewWithdrawNonceAccountInstructionBuilder added in v0.4.0

func NewWithdrawNonceAccountInstructionBuilder() *WithdrawNonceAccount

NewWithdrawNonceAccountInstructionBuilder creates a new `WithdrawNonceAccount` instruction builder.

func (WithdrawNonceAccount) Build added in v0.4.0

func (inst WithdrawNonceAccount) Build() *Instruction

func (*WithdrawNonceAccount) EncodeToTree added in v0.4.0

func (inst *WithdrawNonceAccount) EncodeToTree(parent ag_treeout.Branches)

func (*WithdrawNonceAccount) GetNonceAccount added in v0.4.0

func (inst *WithdrawNonceAccount) GetNonceAccount() *ag_solanago.AccountMeta

func (*WithdrawNonceAccount) GetNonceAuthorityAccount added in v0.4.0

func (inst *WithdrawNonceAccount) GetNonceAuthorityAccount() *ag_solanago.AccountMeta

func (*WithdrawNonceAccount) GetRecipientAccount added in v0.4.0

func (inst *WithdrawNonceAccount) GetRecipientAccount() *ag_solanago.AccountMeta

func (*WithdrawNonceAccount) GetSysVarRecentBlockHashesPubkeyAccount added in v0.4.0

func (inst *WithdrawNonceAccount) GetSysVarRecentBlockHashesPubkeyAccount() *ag_solanago.AccountMeta

func (*WithdrawNonceAccount) GetSysVarRentPubkeyAccount added in v0.4.0

func (inst *WithdrawNonceAccount) GetSysVarRentPubkeyAccount() *ag_solanago.AccountMeta

func (WithdrawNonceAccount) MarshalWithEncoder added in v0.4.0

func (inst WithdrawNonceAccount) MarshalWithEncoder(encoder *ag_binary.Encoder) error

func (*WithdrawNonceAccount) SetLamports added in v0.4.0

func (inst *WithdrawNonceAccount) SetLamports(lamports uint64) *WithdrawNonceAccount

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

func (*WithdrawNonceAccount) SetNonceAccount added in v0.4.0

func (inst *WithdrawNonceAccount) SetNonceAccount(nonceAccount ag_solanago.PublicKey) *WithdrawNonceAccount

Nonce account

func (*WithdrawNonceAccount) SetNonceAuthorityAccount added in v0.4.0

func (inst *WithdrawNonceAccount) SetNonceAuthorityAccount(nonceAuthorityAccount ag_solanago.PublicKey) *WithdrawNonceAccount

Nonce authority

func (*WithdrawNonceAccount) SetRecipientAccount added in v0.4.0

func (inst *WithdrawNonceAccount) SetRecipientAccount(recipientAccount ag_solanago.PublicKey) *WithdrawNonceAccount

Recipient account

func (*WithdrawNonceAccount) SetSysVarRecentBlockHashesPubkeyAccount added in v0.4.0

func (inst *WithdrawNonceAccount) SetSysVarRecentBlockHashesPubkeyAccount(SysVarRecentBlockHashesPubkey ag_solanago.PublicKey) *WithdrawNonceAccount

RecentBlockhashes sysvar

func (*WithdrawNonceAccount) SetSysVarRentPubkeyAccount added in v0.4.0

func (inst *WithdrawNonceAccount) SetSysVarRentPubkeyAccount(SysVarRentPubkey ag_solanago.PublicKey) *WithdrawNonceAccount

Rent sysvar

func (*WithdrawNonceAccount) UnmarshalWithDecoder added in v0.4.0

func (inst *WithdrawNonceAccount) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error

func (*WithdrawNonceAccount) Validate added in v0.4.0

func (inst *WithdrawNonceAccount) Validate() error

func (WithdrawNonceAccount) ValidateAndBuild added in v0.4.0

func (inst WithdrawNonceAccount) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

Jump to

Keyboard shortcuts

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