system

package
v0.0.0-...-8c22cd4 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

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

func InstructionIDToName(id uint32) string

InstructionIDToName returns the name of the instruction given its ID.

func SetProgramID

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

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

func NewAdvanceNonceAccountInstructionBuilder() *AdvanceNonceAccount

NewAdvanceNonceAccountInstructionBuilder creates a new `AdvanceNonceAccount` instruction builder.

func (AdvanceNonceAccount) Build

func (inst AdvanceNonceAccount) Build() *Instruction

func (*AdvanceNonceAccount) EncodeToTree

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

func (*AdvanceNonceAccount) GetNonceAccount

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

func (*AdvanceNonceAccount) GetNonceAuthorityAccount

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

func (*AdvanceNonceAccount) GetSysVarRecentBlockHashesPubkeyAccount

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

func (AdvanceNonceAccount) MarshalWithEncoder

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

func (*AdvanceNonceAccount) SetNonceAccount

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

Nonce account

func (*AdvanceNonceAccount) SetNonceAuthorityAccount

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

Nonce authority

func (*AdvanceNonceAccount) SetSysVarRecentBlockHashesPubkeyAccount

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

RecentBlockhashes sysvar

func (*AdvanceNonceAccount) UnmarshalWithDecoder

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

func (*AdvanceNonceAccount) Validate

func (inst *AdvanceNonceAccount) Validate() error

func (AdvanceNonceAccount) ValidateAndBuild

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

func NewAllocateInstruction(

	space uint64,

	newAccount ag_solanago.PublicKey) *Allocate

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

func NewAllocateInstructionBuilder

func NewAllocateInstructionBuilder() *Allocate

NewAllocateInstructionBuilder creates a new `Allocate` instruction builder.

func (Allocate) Build

func (inst Allocate) Build() *Instruction

func (*Allocate) EncodeToTree

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

func (*Allocate) GetNewAccount

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

func (Allocate) MarshalWithEncoder

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

func (*Allocate) SetNewAccount

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

New account

func (*Allocate) SetSpace

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

Number of bytes of memory to allocate

func (*Allocate) UnmarshalWithDecoder

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

func (*Allocate) Validate

func (inst *Allocate) Validate() error

func (Allocate) ValidateAndBuild

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

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

func NewAllocateWithSeedInstructionBuilder() *AllocateWithSeed

NewAllocateWithSeedInstructionBuilder creates a new `AllocateWithSeed` instruction builder.

func (AllocateWithSeed) Build

func (inst AllocateWithSeed) Build() *Instruction

func (*AllocateWithSeed) EncodeToTree

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

func (*AllocateWithSeed) GetAllocatedAccount

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

func (*AllocateWithSeed) GetBaseAccount

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

func (AllocateWithSeed) MarshalWithEncoder

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

func (*AllocateWithSeed) SetAllocatedAccount

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

Allocated account

func (*AllocateWithSeed) SetBase

Base public key

func (*AllocateWithSeed) SetBaseAccount

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

Base account

func (*AllocateWithSeed) SetOwner

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

Owner program account address

func (*AllocateWithSeed) SetSeed

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

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

func (*AllocateWithSeed) SetSpace

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

Number of bytes of memory to allocate

func (*AllocateWithSeed) UnmarshalWithDecoder

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

func (*AllocateWithSeed) Validate

func (inst *AllocateWithSeed) Validate() error

func (AllocateWithSeed) ValidateAndBuild

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

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

func NewAssignInstructionBuilder() *Assign

NewAssignInstructionBuilder creates a new `Assign` instruction builder.

func (Assign) Build

func (inst Assign) Build() *Instruction

func (*Assign) EncodeToTree

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

func (*Assign) GetAssignedAccount

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

func (Assign) MarshalWithEncoder

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

func (*Assign) SetAssignedAccount

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

Assigned account public key

func (*Assign) SetOwner

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

Owner program account

func (*Assign) UnmarshalWithDecoder

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

func (*Assign) Validate

func (inst *Assign) Validate() error

func (Assign) ValidateAndBuild

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

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

func NewAssignWithSeedInstructionBuilder() *AssignWithSeed

NewAssignWithSeedInstructionBuilder creates a new `AssignWithSeed` instruction builder.

func (AssignWithSeed) Build

func (inst AssignWithSeed) Build() *Instruction

func (*AssignWithSeed) EncodeToTree

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

func (*AssignWithSeed) GetAssignedAccount

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

func (*AssignWithSeed) GetBaseAccount

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

func (AssignWithSeed) MarshalWithEncoder

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

func (*AssignWithSeed) SetAssignedAccount

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

Assigned account

func (*AssignWithSeed) SetBase

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

Base public key

func (*AssignWithSeed) SetBaseAccount

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

Base account

func (*AssignWithSeed) SetOwner

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

Owner program account

func (*AssignWithSeed) SetSeed

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

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

func (*AssignWithSeed) UnmarshalWithDecoder

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

func (*AssignWithSeed) Validate

func (inst *AssignWithSeed) Validate() error

func (AssignWithSeed) ValidateAndBuild

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

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

func NewAuthorizeNonceAccountInstructionBuilder() *AuthorizeNonceAccount

NewAuthorizeNonceAccountInstructionBuilder creates a new `AuthorizeNonceAccount` instruction builder.

func (AuthorizeNonceAccount) Build

func (inst AuthorizeNonceAccount) Build() *Instruction

func (*AuthorizeNonceAccount) EncodeToTree

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

func (*AuthorizeNonceAccount) GetNonceAccount

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

func (*AuthorizeNonceAccount) GetNonceAuthorityAccount

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

func (AuthorizeNonceAccount) MarshalWithEncoder

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

func (*AuthorizeNonceAccount) SetAuthorized

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

The Pubkey parameter identifies the entity to authorize.

func (*AuthorizeNonceAccount) SetNonceAccount

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

Nonce account

func (*AuthorizeNonceAccount) SetNonceAuthorityAccount

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

Nonce authority

func (*AuthorizeNonceAccount) UnmarshalWithDecoder

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

func (*AuthorizeNonceAccount) Validate

func (inst *AuthorizeNonceAccount) Validate() error

func (AuthorizeNonceAccount) ValidateAndBuild

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

func NewCreateAccountInstructionBuilder() *CreateAccount

NewCreateAccountInstructionBuilder creates a new `CreateAccount` instruction builder.

func (CreateAccount) Build

func (inst CreateAccount) Build() *Instruction

func (*CreateAccount) EncodeToTree

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

func (*CreateAccount) GetFundingAccount

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

func (*CreateAccount) GetNewAccount

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

func (CreateAccount) MarshalWithEncoder

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

func (*CreateAccount) SetFundingAccount

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

Funding account

func (*CreateAccount) SetLamports

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

Number of lamports to transfer to the new account

func (*CreateAccount) SetNewAccount

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

New account

func (*CreateAccount) SetOwner

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

Address of program that will own the new account

func (*CreateAccount) SetSpace

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

Number of bytes of memory to allocate

func (*CreateAccount) UnmarshalWithDecoder

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

func (*CreateAccount) Validate

func (inst *CreateAccount) Validate() error

func (CreateAccount) ValidateAndBuild

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

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

func NewCreateAccountWithSeedInstructionBuilder() *CreateAccountWithSeed

NewCreateAccountWithSeedInstructionBuilder creates a new `CreateAccountWithSeed` instruction builder.

func (CreateAccountWithSeed) Build

func (inst CreateAccountWithSeed) Build() *Instruction

func (*CreateAccountWithSeed) EncodeToTree

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

func (*CreateAccountWithSeed) GetBaseAccount

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

func (*CreateAccountWithSeed) GetCreatedAccount

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

func (*CreateAccountWithSeed) GetFundingAccount

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

func (CreateAccountWithSeed) MarshalWithEncoder

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

func (*CreateAccountWithSeed) SetBase

Base public key

func (*CreateAccountWithSeed) SetBaseAccount

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

Base account

func (*CreateAccountWithSeed) SetCreatedAccount

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

Created account

func (*CreateAccountWithSeed) SetFundingAccount

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

Funding account

func (*CreateAccountWithSeed) SetLamports

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

Number of lamports to transfer to the new account

func (*CreateAccountWithSeed) SetOwner

Owner program account address

func (*CreateAccountWithSeed) SetSeed

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

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

func (*CreateAccountWithSeed) SetSpace

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

Number of bytes of memory to allocate

func (*CreateAccountWithSeed) UnmarshalWithDecoder

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

func (*CreateAccountWithSeed) Validate

func (inst *CreateAccountWithSeed) Validate() error

func (CreateAccountWithSeed) ValidateAndBuild

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

type FeeCalculator struct {
	LamportsPerSignature uint64
}

func (FeeCalculator) MarshalWithEncoder

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

func (*FeeCalculator) UnmarshalWithDecoder

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

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

func NewInitializeNonceAccountInstructionBuilder() *InitializeNonceAccount

NewInitializeNonceAccountInstructionBuilder creates a new `InitializeNonceAccount` instruction builder.

func (InitializeNonceAccount) Build

func (inst InitializeNonceAccount) Build() *Instruction

func (*InitializeNonceAccount) EncodeToTree

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

func (*InitializeNonceAccount) GetNonceAccount

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

func (*InitializeNonceAccount) GetSysVarRecentBlockHashesPubkeyAccount

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

func (*InitializeNonceAccount) GetSysVarRentPubkeyAccount

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

func (InitializeNonceAccount) MarshalWithEncoder

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

func (*InitializeNonceAccount) SetAuthorized

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

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

Nonce account

func (*InitializeNonceAccount) SetSysVarRecentBlockHashesPubkeyAccount

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

RecentBlockhashes sysvar

func (*InitializeNonceAccount) SetSysVarRentPubkeyAccount

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

Rent sysvar

func (*InitializeNonceAccount) UnmarshalWithDecoder

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

func (*InitializeNonceAccount) Validate

func (inst *InitializeNonceAccount) Validate() error

func (InitializeNonceAccount) ValidateAndBuild

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

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

func (Instruction) MarshalWithEncoder

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

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

type NonceAccount

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

func (NonceAccount) MarshalWithEncoder

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

func (*NonceAccount) UnmarshalWithDecoder

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

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

func NewTransferInstructionBuilder() *Transfer

NewTransferInstructionBuilder creates a new `Transfer` instruction builder.

func (Transfer) Build

func (inst Transfer) Build() *Instruction

func (*Transfer) EncodeToTree

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

func (*Transfer) GetFundingAccount

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

func (*Transfer) GetRecipientAccount

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

func (Transfer) MarshalWithEncoder

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

func (*Transfer) SetFundingAccount

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

Funding account

func (*Transfer) SetLamports

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

Number of lamports to transfer to the new account

func (*Transfer) SetRecipientAccount

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

Recipient account

func (*Transfer) UnmarshalWithDecoder

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

func (*Transfer) Validate

func (inst *Transfer) Validate() error

func (Transfer) ValidateAndBuild

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

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

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

func NewTransferWithSeedInstructionBuilder() *TransferWithSeed

NewTransferWithSeedInstructionBuilder creates a new `TransferWithSeed` instruction builder.

func (TransferWithSeed) Build

func (inst TransferWithSeed) Build() *Instruction

func (*TransferWithSeed) EncodeToTree

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

func (*TransferWithSeed) GetBaseForFundingAccount

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

func (*TransferWithSeed) GetFundingAccount

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

func (*TransferWithSeed) GetRecipientAccount

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

func (TransferWithSeed) MarshalWithEncoder

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

func (*TransferWithSeed) SetBaseForFundingAccount

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

Base for funding account

func (*TransferWithSeed) SetFromOwner

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

Owner to use to derive the funding account address

func (*TransferWithSeed) SetFromSeed

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

Seed to use to derive the funding account address

func (*TransferWithSeed) SetFundingAccount

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

Funding account

func (*TransferWithSeed) SetLamports

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

Amount to transfer

func (*TransferWithSeed) SetRecipientAccount

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

Recipient account

func (*TransferWithSeed) UnmarshalWithDecoder

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

func (*TransferWithSeed) Validate

func (inst *TransferWithSeed) Validate() error

func (TransferWithSeed) ValidateAndBuild

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

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

func NewWithdrawNonceAccountInstructionBuilder() *WithdrawNonceAccount

NewWithdrawNonceAccountInstructionBuilder creates a new `WithdrawNonceAccount` instruction builder.

func (WithdrawNonceAccount) Build

func (inst WithdrawNonceAccount) Build() *Instruction

func (*WithdrawNonceAccount) EncodeToTree

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

func (*WithdrawNonceAccount) GetNonceAccount

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

func (*WithdrawNonceAccount) GetNonceAuthorityAccount

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

func (*WithdrawNonceAccount) GetRecipientAccount

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

func (*WithdrawNonceAccount) GetSysVarRecentBlockHashesPubkeyAccount

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

func (*WithdrawNonceAccount) GetSysVarRentPubkeyAccount

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

func (WithdrawNonceAccount) MarshalWithEncoder

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

func (*WithdrawNonceAccount) SetLamports

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

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

Nonce account

func (*WithdrawNonceAccount) SetNonceAuthorityAccount

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

Nonce authority

func (*WithdrawNonceAccount) SetRecipientAccount

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

Recipient account

func (*WithdrawNonceAccount) SetSysVarRecentBlockHashesPubkeyAccount

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

RecentBlockhashes sysvar

func (*WithdrawNonceAccount) SetSysVarRentPubkeyAccount

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

Rent sysvar

func (*WithdrawNonceAccount) UnmarshalWithDecoder

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

func (*WithdrawNonceAccount) Validate

func (inst *WithdrawNonceAccount) Validate() error

func (WithdrawNonceAccount) ValidateAndBuild

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