group_member_pointer

package
v0.0.0-...-3968f94 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const GROUP_MEMBER_POINTER_SIZE = 64
View Source
const ProgramName = "group_member_pointer"

Variables

View Source
var (
	Instruction_Initialize uint8 = 0
	Instruction_Update     uint8 = 1
)
View Source
var InstructionImplDef = binary.NewVariantDefinition(binary.Uint8TypeIDEncoding, []binary.VariantType{
	{
		"initialize", (*Initialize)(nil),
	},
	{
		"update", (*Update)(nil),
	},
})
View Source
var ProgramID common.PublicKey = common.MustPublicKeyFromBase58("11111111111111111111111111111111")

Functions

func InstructionIDToName

func InstructionIDToName(id uint8) string

InstructionIDToName returns the name of the instruction given its ID.

func SetProgramID

func SetProgramID(pubkey common.PublicKey)

Types

type GroupMemberPointer

type GroupMemberPointer struct {
	// Authority that can set the member address
	Authority common.PublicKey
	// Account address that holds the member
	MemberAddress common.PublicKey
}

GroupMemberPointer Struct Group member pointer extension data for mints.

func (*GroupMemberPointer) MarshalWithEncoder

func (obj *GroupMemberPointer) MarshalWithEncoder(encoder *binary.Encoder) (err error)

func (*GroupMemberPointer) UnmarshalWithDecoder

func (obj *GroupMemberPointer) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)

type Initialize

type Initialize struct {
	// The public key for the account that can update the group address
	Authority *common.PublicKey
	// The account address that holds the member
	MemberAddress *common.PublicKey
	// [0] = [WRITE] mint `The mint to initialize.`
	common.AccountMetaSlice `bin:"-"`
	// contains filtered or unexported fields
}

Initialize Instruction

func NewInitializeInstruction

func NewInitializeInstruction(
	authority common.PublicKey,
	memberAddress common.PublicKey,
	mint common.PublicKey,
) *Initialize

NewInitializeInstruction

Parameters:

authority: The public key for the account that can update the group address
memberAddress: The account address that holds the member
mint: The mint to initialize.

func NewInitializeInstructionBuilder

func NewInitializeInstructionBuilder() *Initialize

NewInitializeInstructionBuilder creates a new `Initialize` instruction builder.

func (*Initialize) Build

func (obj *Initialize) Build() *Instruction

func (*Initialize) EncodeToTree

func (obj *Initialize) EncodeToTree(parent treeout.Branches)

func (*Initialize) GetMintAccount

func (obj *Initialize) GetMintAccount() *common.AccountMeta

GetMintAccount gets the "mint" parameter. The mint to initialize.

func (*Initialize) MarshalWithEncoder

func (obj *Initialize) MarshalWithEncoder(encoder *binary.Encoder) (err error)

func (*Initialize) SetAuthority

func (obj *Initialize) SetAuthority(authority common.PublicKey) *Initialize

SetAuthority sets the "authority" parameter.

func (*Initialize) SetMemberAddress

func (obj *Initialize) SetMemberAddress(memberAddress common.PublicKey) *Initialize

SetMemberAddress sets the "memberAddress" parameter.

func (*Initialize) SetMintAccount

func (obj *Initialize) SetMintAccount(mint common.PublicKey, multiSigners ...common.PublicKey) *Initialize

SetMintAccount sets the "mint" parameter. The mint to initialize.

func (*Initialize) SetProgramId

func (obj *Initialize) SetProgramId(programId *common.PublicKey) *Initialize

func (*Initialize) UnmarshalWithDecoder

func (obj *Initialize) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)

func (*Initialize) Validate

func (obj *Initialize) Validate() error

func (*Initialize) ValidateAndBuild

func (obj *Initialize) 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 {
	binary.BaseVariant
	// contains filtered or unexported fields
}

func DecodeInstruction

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

func (*Instruction) Accounts

func (obj *Instruction) Accounts() (out []*common.AccountMeta)

func (*Instruction) Data

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

func (*Instruction) EncodeToTree

func (obj *Instruction) EncodeToTree(parent treeout.Branches)

func (*Instruction) MarshalWithEncoder

func (obj *Instruction) MarshalWithEncoder(encoder *binary.Encoder) error

func (*Instruction) ProgramID

func (obj *Instruction) ProgramID() common.PublicKey

func (*Instruction) TextEncode

func (obj *Instruction) TextEncode(encoder *text.Encoder, option *text.Option) error

func (*Instruction) UnmarshalWithDecoder

func (obj *Instruction) UnmarshalWithDecoder(decoder *binary.Decoder) error

type Update

type Update struct {
	// The new account address that holds the group
	MemberAddress *common.PublicKey
	// [0] = [WRITE] mint `The mint.`
	// [1] = [SIGNER] authority `The group member pointer authority.,..2+M `[signer]` M signer accounts.`
	common.AccountMetaSlice `bin:"-"`
	// contains filtered or unexported fields
}

Update Instruction

func NewUpdateInstruction

func NewUpdateInstruction(
	memberAddress common.PublicKey,
	mint common.PublicKey,
	authority common.PublicKey,
) *Update

NewUpdateInstruction

Parameters:

memberAddress: The new account address that holds the group
mint: The mint.

authority: The group member pointer authority.
..2+M `[signer]` M signer accounts.

func NewUpdateInstructionBuilder

func NewUpdateInstructionBuilder() *Update

NewUpdateInstructionBuilder creates a new `Update` instruction builder.

func (*Update) Build

func (obj *Update) Build() *Instruction

func (*Update) EncodeToTree

func (obj *Update) EncodeToTree(parent treeout.Branches)

func (*Update) GetAuthorityAccount

func (obj *Update) GetAuthorityAccount() *common.AccountMeta

GetAuthorityAccount gets the "authority" parameter. The group member pointer authority. ..2+M `[signer]` M signer accounts.

func (*Update) GetMintAccount

func (obj *Update) GetMintAccount() *common.AccountMeta

GetMintAccount gets the "mint" parameter. The mint.

func (*Update) MarshalWithEncoder

func (obj *Update) MarshalWithEncoder(encoder *binary.Encoder) (err error)

func (*Update) SetAuthorityAccount

func (obj *Update) SetAuthorityAccount(authority common.PublicKey, multiSigners ...common.PublicKey) *Update

SetAuthorityAccount sets the "authority" parameter. The group member pointer authority. ..2+M `[signer]` M signer accounts.

func (*Update) SetMemberAddress

func (obj *Update) SetMemberAddress(memberAddress common.PublicKey) *Update

SetMemberAddress sets the "memberAddress" parameter.

func (*Update) SetMintAccount

func (obj *Update) SetMintAccount(mint common.PublicKey) *Update

SetMintAccount sets the "mint" parameter. The mint.

func (*Update) SetProgramId

func (obj *Update) SetProgramId(programId *common.PublicKey) *Update

func (*Update) UnmarshalWithDecoder

func (obj *Update) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)

func (*Update) Validate

func (obj *Update) Validate() error

func (*Update) ValidateAndBuild

func (obj *Update) 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