lock_bench

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ProgramName = "LockBench"

Variables

View Source
var (
	Instruction_Lock = ag_binary.TypeID([8]byte{21, 19, 208, 43, 237, 62, 255, 87})
	Instruction_Memo = ag_binary.TypeID([8]byte{11, 4, 237, 89, 11, 183, 177, 12})
)
View Source
var CounterDiscriminator = [8]byte{255, 176, 4, 245, 188, 253, 124, 25}
View Source
var InstructionImplDef = ag_binary.NewVariantDefinition(
	ag_binary.AnchorTypeIDEncoding,
	[]ag_binary.VariantType{
		{Name: "lock", Type: (*Lock)(nil)},
		{Name: "memo", Type: (*Memo)(nil)},
	},
)
View Source
var ProgramID ag_solanago.PublicKey = ag_solanago.MPK("memos5eKsok4hXwxufkppaTBrfWRjFMhqxgomv5trJ6")

Functions

func InstructionIDToName

func InstructionIDToName(id ag_binary.TypeID) string

InstructionIDToName returns the name of the instruction given its ID.

func SetProgramID

func SetProgramID(pubkey ag_solanago.PublicKey)

Types

type Counter

type Counter struct {
	Count uint64
}

func (Counter) MarshalWithEncoder

func (obj Counter) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*Counter) UnmarshalWithDecoder

func (obj *Counter) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

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 Lock

type Lock struct {
	Input *[]byte

	// [0] = [WRITE, SIGNER] payer
	//
	// [1] = [WRITE] counter
	//
	// [2] = [] systemProgram
	ag_solanago.AccountMetaSlice `bin:"-"`
}

Lock is the `lock` instruction.

func NewLockInstruction

func NewLockInstruction(

	input []byte,

	payer ag_solanago.PublicKey,
	counter ag_solanago.PublicKey,
	systemProgram ag_solanago.PublicKey,
) *Lock

NewLockInstruction declares a new Lock instruction with the provided parameters and accounts.

func NewLockInstructionBuilder

func NewLockInstructionBuilder() *Lock

NewLockInstructionBuilder creates a new `Lock` instruction builder.

func (Lock) Build

func (inst Lock) Build() *Instruction

func (*Lock) EncodeToTree

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

func (*Lock) GetCounterAccount

func (inst *Lock) GetCounterAccount() *ag_solanago.AccountMeta

GetCounterAccount gets the "counter" account.

func (*Lock) GetLockAccounts

func (inst *Lock) GetLockAccounts() *LockAccounts

func (*Lock) GetPayerAccount

func (inst *Lock) GetPayerAccount() *ag_solanago.AccountMeta

GetPayerAccount gets the "payer" account.

func (*Lock) GetSystemProgramAccount

func (inst *Lock) GetSystemProgramAccount() *ag_solanago.AccountMeta

GetSystemProgramAccount gets the "systemProgram" account.

func (Lock) MarshalWithEncoder

func (obj Lock) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*Lock) SetCounterAccount

func (inst *Lock) SetCounterAccount(counter ag_solanago.PublicKey) *Lock

SetCounterAccount sets the "counter" account.

func (*Lock) SetInput

func (inst *Lock) SetInput(input []byte) *Lock

SetInput sets the "input" parameter.

func (*Lock) SetPayerAccount

func (inst *Lock) SetPayerAccount(payer ag_solanago.PublicKey) *Lock

SetPayerAccount sets the "payer" account.

func (*Lock) SetSystemProgramAccount

func (inst *Lock) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Lock

SetSystemProgramAccount sets the "systemProgram" account.

func (*Lock) UnmarshalWithDecoder

func (obj *Lock) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*Lock) Validate

func (inst *Lock) Validate() error

func (Lock) ValidateAndBuild

func (inst Lock) 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 LockAccounts

type LockAccounts struct {
	Payer         ag_solanago.PublicKey
	Counter       ag_solanago.PublicKey
	SystemProgram ag_solanago.PublicKey
}

type Memo

type Memo struct {
	Input *[]byte

	ag_solanago.AccountMetaSlice `bin:"-"`
}

Memo is the `memo` instruction.

func NewMemoInstruction

func NewMemoInstruction(

	input []byte,
) *Memo

NewMemoInstruction declares a new Memo instruction with the provided parameters and accounts.

func NewMemoInstructionBuilder

func NewMemoInstructionBuilder() *Memo

NewMemoInstructionBuilder creates a new `Memo` instruction builder.

func (Memo) Build

func (inst Memo) Build() *Instruction

func (*Memo) EncodeToTree

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

func (*Memo) GetMemoAccounts

func (inst *Memo) GetMemoAccounts() *MemoAccounts

func (Memo) MarshalWithEncoder

func (obj Memo) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)

func (*Memo) SetInput

func (inst *Memo) SetInput(input []byte) *Memo

SetInput sets the "input" parameter.

func (*Memo) UnmarshalWithDecoder

func (obj *Memo) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)

func (*Memo) Validate

func (inst *Memo) Validate() error

func (Memo) ValidateAndBuild

func (inst Memo) 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 MemoAccounts

type MemoAccounts struct{}

Jump to

Keyboard shortcuts

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