memo

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InstructionImplDef = ag_binary.NewVariantDefinition(
	ag_binary.NoTypeIDEncoding,
	[]ag_binary.VariantType{
		{
			Name: "Memo", Type: (*Create)(nil),
		},
	},
)

Functions

func SetProgramID

func SetProgramID(pubkey ag_solanago.PublicKey)

Types

type Create

type Create struct {
	// The memo message
	Message []byte

	// [0] = [SIGNER] Signer
	// ··········· The account that will pay for the transaction
	ag_solanago.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

func NewMemoInstruction

func NewMemoInstruction(

	message []byte,

	signer ag_solanago.PublicKey) *Create

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

func NewMemoInstructionBuilder

func NewMemoInstructionBuilder() *Create

NewMemoInstructionBuilder creates a new `Memo` instruction builder.

func (Create) Build

func (inst Create) Build() *MemoInstruction

func (*Create) EncodeToTree

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

func (*Create) GetSigner

func (inst *Create) GetSigner() *ag_solanago.AccountMeta

func (Create) MarshalWithEncoder

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

func (*Create) SetMessage

func (inst *Create) SetMessage(message []byte) *Create

SetMessage sets the memo message

func (*Create) SetSigner

func (inst *Create) SetSigner(signer ag_solanago.PublicKey) *Create

SetSigner sets the signer account

func (*Create) UnmarshalWithDecoder

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

func (*Create) Validate

func (inst *Create) Validate() error

func (Create) ValidateAndBuild

func (inst Create) ValidateAndBuild() (*MemoInstruction, 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 MemoInstruction

type MemoInstruction struct {
	ag_binary.BaseVariant
}

func DecodeInstruction

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

func (*MemoInstruction) Accounts

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

func (*MemoInstruction) Data

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

func (*MemoInstruction) EncodeToTree

func (inst *MemoInstruction) EncodeToTree(parent treeout.Branches)

func (MemoInstruction) MarshalWithEncoder

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

func (*MemoInstruction) ProgramID

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

func (*MemoInstruction) TextEncode

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

func (*MemoInstruction) UnmarshalWithDecoder

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

Jump to

Keyboard shortcuts

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