Documentation ¶
Index ¶
- Constants
- Variables
- func InstructionIDToName(id ag_binary.TypeID) string
- func SetProgramID(pubkey ag_solanago.PublicKey)
- type Counter
- type Instruction
- func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta)
- func (inst *Instruction) Data() ([]byte, error)
- func (inst *Instruction) EncodeToTree(parent ag_treeout.Branches)
- func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error
- func (inst *Instruction) ProgramID() ag_solanago.PublicKey
- func (inst *Instruction) TextEncode(encoder *ag_text.Encoder, option *ag_text.Option) error
- func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error
- type Lock
- func (inst Lock) Build() *Instruction
- func (inst *Lock) EncodeToTree(parent ag_treeout.Branches)
- func (inst *Lock) GetCounterAccount() *ag_solanago.AccountMeta
- func (inst *Lock) GetLockAccounts() *LockAccounts
- func (inst *Lock) GetPayerAccount() *ag_solanago.AccountMeta
- func (inst *Lock) GetSystemProgramAccount() *ag_solanago.AccountMeta
- func (obj Lock) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)
- func (inst *Lock) SetCounterAccount(counter ag_solanago.PublicKey) *Lock
- func (inst *Lock) SetInput(input []byte) *Lock
- func (inst *Lock) SetPayerAccount(payer ag_solanago.PublicKey) *Lock
- func (inst *Lock) SetSystemProgramAccount(systemProgram ag_solanago.PublicKey) *Lock
- func (obj *Lock) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)
- func (inst *Lock) Validate() error
- func (inst Lock) ValidateAndBuild() (*Instruction, error)
- type LockAccounts
- type Memo
- func (inst Memo) Build() *Instruction
- func (inst *Memo) EncodeToTree(parent ag_treeout.Branches)
- func (inst *Memo) GetMemoAccounts() *MemoAccounts
- func (obj Memo) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error)
- func (inst *Memo) SetInput(input []byte) *Memo
- func (obj *Memo) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error)
- func (inst *Memo) Validate() error
- func (inst Memo) ValidateAndBuild() (*Instruction, error)
- type MemoAccounts
Constants ¶
const ProgramName = "LockBench"
Variables ¶
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}) )
var CounterDiscriminator = [8]byte{255, 176, 4, 245, 188, 253, 124, 25}
var InstructionImplDef = ag_binary.NewVariantDefinition( ag_binary.AnchorTypeIDEncoding, []ag_binary.VariantType{ {Name: "lock", Type: (*Lock)(nil)}, {Name: "memo", Type: (*Memo)(nil)}, }, )
var ProgramID ag_solanago.PublicKey = ag_solanago.MPK("memos5eKsok4hXwxufkppaTBrfWRjFMhqxgomv5trJ6")
Functions ¶
func InstructionIDToName ¶
InstructionIDToName returns the name of the instruction given its ID.
func SetProgramID ¶
func SetProgramID(pubkey ag_solanago.PublicKey)
Types ¶
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 (*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 (*Lock) SetCounterAccount ¶
func (inst *Lock) SetCounterAccount(counter ag_solanago.PublicKey) *Lock
SetCounterAccount sets the "counter" account.
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 (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 ¶
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 (*Memo) UnmarshalWithDecoder ¶
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{}