Documentation ¶
Index ¶
- Constants
- Variables
- func InstructionIDToName(id binary.TypeID) string
- func SetProgramID(pubkey common.PublicKey)
- type Emit
- func (obj *Emit) Build() *Instruction
- func (obj *Emit) EncodeToTree(parent treeout.Branches)
- func (obj *Emit) GetMetadataAccount() *common.AccountMeta
- func (obj *Emit) MarshalWithEncoder(encoder *binary.Encoder) (err error)
- func (obj *Emit) SetEnd(end *uint64) *Emit
- func (obj *Emit) SetMetadataAccount(metadata common.PublicKey, multiSigners ...common.PublicKey) *Emit
- func (obj *Emit) SetProgramId(programId *common.PublicKey) *Emit
- func (obj *Emit) SetStart(start *uint64) *Emit
- func (obj *Emit) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
- func (obj *Emit) Validate() error
- func (obj *Emit) ValidateAndBuild() (*Instruction, error)
- type Field
- func (obj *Field) AsKey() FieldKey
- func (obj *Field) IsKey() bool
- func (obj *Field) IsName() bool
- func (obj *Field) IsSymbol() bool
- func (obj *Field) IsUri() bool
- func (obj *Field) MarshalWithEncoder(encoder *binary.Encoder) (err error)
- func (obj *Field) String() string
- func (obj *Field) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
- type FieldKey
- type ImmutableMetadataError
- type IncorrectAccountError
- type IncorrectMintAuthorityError
- type IncorrectUpdateAuthorityError
- type Initialize
- func (obj *Initialize) Build() *Instruction
- func (obj *Initialize) EncodeToTree(parent treeout.Branches)
- func (obj *Initialize) GetMetadataAccount() *common.AccountMeta
- func (obj *Initialize) GetMintAccount() *common.AccountMeta
- func (obj *Initialize) GetMintAuthorityAccount() *common.AccountMeta
- func (obj *Initialize) GetUpdateAuthorityAccount() *common.AccountMeta
- func (obj *Initialize) MarshalWithEncoder(encoder *binary.Encoder) (err error)
- func (obj *Initialize) SetMetadataAccount(metadata common.PublicKey) *Initialize
- func (obj *Initialize) SetMintAccount(mint common.PublicKey) *Initialize
- func (obj *Initialize) SetMintAuthorityAccount(mintAuthority common.PublicKey, multiSigners ...common.PublicKey) *Initialize
- func (obj *Initialize) SetName(name string) *Initialize
- func (obj *Initialize) SetProgramId(programId *common.PublicKey) *Initialize
- func (obj *Initialize) SetSymbol(symbol string) *Initialize
- func (obj *Initialize) SetUpdateAuthorityAccount(updateAuthority common.PublicKey) *Initialize
- func (obj *Initialize) SetUri(uri string) *Initialize
- func (obj *Initialize) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
- func (obj *Initialize) Validate() error
- func (obj *Initialize) ValidateAndBuild() (*Instruction, error)
- type Instruction
- func (obj *Instruction) Accounts() (out []*common.AccountMeta)
- func (obj *Instruction) Data() ([]byte, error)
- func (obj *Instruction) EncodeToTree(parent treeout.Branches)
- func (obj *Instruction) MarshalWithEncoder(encoder *binary.Encoder) error
- func (obj *Instruction) ProgramID() common.PublicKey
- func (obj *Instruction) TextEncode(encoder *text.Encoder, option *text.Option) error
- func (obj *Instruction) UnmarshalWithDecoder(decoder *binary.Decoder) error
- type KeyNotFoundError
- type MintHasNoMintAuthorityError
- type ProgramError
- type RemoveKey
- func (obj *RemoveKey) Build() *Instruction
- func (obj *RemoveKey) EncodeToTree(parent treeout.Branches)
- func (obj *RemoveKey) GetMetadataAccount() *common.AccountMeta
- func (obj *RemoveKey) GetUpdateAuthorityAccount() *common.AccountMeta
- func (obj *RemoveKey) MarshalWithEncoder(encoder *binary.Encoder) (err error)
- func (obj *RemoveKey) SetIdempotent(idempotent bool) *RemoveKey
- func (obj *RemoveKey) SetKey(key string) *RemoveKey
- func (obj *RemoveKey) SetMetadataAccount(metadata common.PublicKey) *RemoveKey
- func (obj *RemoveKey) SetProgramId(programId *common.PublicKey) *RemoveKey
- func (obj *RemoveKey) SetUpdateAuthorityAccount(updateAuthority common.PublicKey, multiSigners ...common.PublicKey) *RemoveKey
- func (obj *RemoveKey) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
- func (obj *RemoveKey) Validate() error
- func (obj *RemoveKey) ValidateAndBuild() (*Instruction, error)
- type TokenMetadata
- type UpdateAuthority
- func (obj *UpdateAuthority) Build() *Instruction
- func (obj *UpdateAuthority) EncodeToTree(parent treeout.Branches)
- func (obj *UpdateAuthority) GetMetadataAccount() *common.AccountMeta
- func (obj *UpdateAuthority) GetUpdateAuthorityAccount() *common.AccountMeta
- func (obj *UpdateAuthority) MarshalWithEncoder(encoder *binary.Encoder) (err error)
- func (obj *UpdateAuthority) SetMetadataAccount(metadata common.PublicKey) *UpdateAuthority
- func (obj *UpdateAuthority) SetNewAuthority(newAuthority common.PublicKey) *UpdateAuthority
- func (obj *UpdateAuthority) SetProgramId(programId *common.PublicKey) *UpdateAuthority
- func (obj *UpdateAuthority) SetUpdateAuthorityAccount(updateAuthority common.PublicKey, multiSigners ...common.PublicKey) *UpdateAuthority
- func (obj *UpdateAuthority) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
- func (obj *UpdateAuthority) Validate() error
- func (obj *UpdateAuthority) ValidateAndBuild() (*Instruction, error)
- type UpdateField
- func (obj *UpdateField) Build() *Instruction
- func (obj *UpdateField) EncodeToTree(parent treeout.Branches)
- func (obj *UpdateField) GetMetadataAccount() *common.AccountMeta
- func (obj *UpdateField) GetUpdateAuthorityAccount() *common.AccountMeta
- func (obj *UpdateField) MarshalWithEncoder(encoder *binary.Encoder) (err error)
- func (obj *UpdateField) SetField(field Field) *UpdateField
- func (obj *UpdateField) SetMetadataAccount(metadata common.PublicKey) *UpdateField
- func (obj *UpdateField) SetProgramId(programId *common.PublicKey) *UpdateField
- func (obj *UpdateField) SetUpdateAuthorityAccount(updateAuthority common.PublicKey, multiSigners ...common.PublicKey) *UpdateField
- func (obj *UpdateField) SetValue(value string) *UpdateField
- func (obj *UpdateField) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
- func (obj *UpdateField) Validate() error
- func (obj *UpdateField) ValidateAndBuild() (*Instruction, error)
Constants ¶
const ProgramName = "token_metadata"
Variables ¶
var ( Instruction_Initialize = binary.TypeID([8]byte{210, 225, 30, 162, 88, 184, 77, 141}) Instruction_UpdateField = binary.TypeID([8]byte{221, 233, 49, 45, 181, 202, 220, 200}) Instruction_RemoveKey = binary.TypeID([8]byte{234, 18, 32, 56, 89, 141, 37, 181}) Instruction_UpdateAuthority = binary.TypeID([8]byte{215, 228, 166, 228, 84, 100, 86, 123}) Instruction_Emit = binary.TypeID([8]byte{250, 166, 180, 250, 13, 12, 184, 70}) )
var InstructionImplDef = binary.NewVariantDefinition(binary.AnchorTypeIDEncoding, []binary.VariantType{ { "initialize", (*Initialize)(nil), }, { "update_field", (*UpdateField)(nil), }, { "remove_key", (*RemoveKey)(nil), }, { "update_authority", (*UpdateAuthority)(nil), }, { "emit", (*Emit)(nil), }, })
var ProgramID common.PublicKey = common.MustPublicKeyFromBase58("11111111111111111111111111111111")
Functions ¶
func InstructionIDToName ¶
InstructionIDToName returns the name of the instruction given its ID.
func SetProgramID ¶
Types ¶
type Emit ¶
type Emit struct { // Start of range of data to emit Start *uint64 `bin:"optional"` // End of range of data to emit End *uint64 `bin:"optional"` // [0] = [] metadata `Metadata` common.AccountMetaSlice `bin:"-"` // contains filtered or unexported fields }
Emit Instruction
func NewEmitInstruction ¶
NewEmitInstruction
Parameters:
start: Start of range of data to emit end: End of range of data to emit metadata: Metadata
func NewEmitInstructionBuilder ¶
func NewEmitInstructionBuilder() *Emit
NewEmitInstructionBuilder creates a new `Emit` instruction builder.
func (*Emit) Build ¶
func (obj *Emit) Build() *Instruction
func (*Emit) EncodeToTree ¶
func (*Emit) GetMetadataAccount ¶
func (obj *Emit) GetMetadataAccount() *common.AccountMeta
GetMetadataAccount gets the "metadata" parameter. Metadata
func (*Emit) MarshalWithEncoder ¶
func (*Emit) SetMetadataAccount ¶
func (obj *Emit) SetMetadataAccount(metadata common.PublicKey, multiSigners ...common.PublicKey) *Emit
SetMetadataAccount sets the "metadata" parameter. Metadata
func (*Emit) UnmarshalWithDecoder ¶
func (*Emit) ValidateAndBuild ¶
func (obj *Emit) 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 Field ¶
type Field struct { Name *struct{} `bin:"optional"` Symbol *struct{} `bin:"optional"` Uri *struct{} `bin:"optional"` Key *FieldKey `bin:"optional"` }
Field Enum
func NewField_Key ¶
func NewField_Name ¶
func NewField_Name() Field
func NewField_Symbol ¶
func NewField_Symbol() Field
func NewField_Uri ¶
func NewField_Uri() Field
func (*Field) MarshalWithEncoder ¶
type ImmutableMetadataError ¶
type ImmutableMetadataError struct{}
ImmutableMetadataError Error: 901952961 `Token metadata has no update authority`
func (ImmutableMetadataError) Code ¶
func (e ImmutableMetadataError) Code() int
func (ImmutableMetadataError) Error ¶
func (e ImmutableMetadataError) Error() string
type IncorrectAccountError ¶
type IncorrectAccountError struct{}
IncorrectAccountError Error: 901952957 `Incorrect account provided`
func (IncorrectAccountError) Code ¶
func (e IncorrectAccountError) Code() int
func (IncorrectAccountError) Error ¶
func (e IncorrectAccountError) Error() string
type IncorrectMintAuthorityError ¶
type IncorrectMintAuthorityError struct{}
IncorrectMintAuthorityError Error: 901952959 `Incorrect mint authority has signed the instruction`
func (IncorrectMintAuthorityError) Code ¶
func (e IncorrectMintAuthorityError) Code() int
func (IncorrectMintAuthorityError) Error ¶
func (e IncorrectMintAuthorityError) Error() string
type IncorrectUpdateAuthorityError ¶
type IncorrectUpdateAuthorityError struct{}
IncorrectUpdateAuthorityError Error: 901952960 `Incorrect metadata update authority has signed the instruction`
func (IncorrectUpdateAuthorityError) Code ¶
func (e IncorrectUpdateAuthorityError) Code() int
func (IncorrectUpdateAuthorityError) Error ¶
func (e IncorrectUpdateAuthorityError) Error() string
type Initialize ¶
type Initialize struct { // Longer name of the token Name *string // Shortened symbol of the token Symbol *string // URI pointing to more metadata (image, video, etc.) Uri *string // [0] = [WRITE] metadata `Metadata` // [1] = [] updateAuthority `Update authority` // [2] = [] mint `Mint` // [3] = [SIGNER] mintAuthority `Mint authority` common.AccountMetaSlice `bin:"-"` // contains filtered or unexported fields }
Initialize Instruction
func NewInitializeInstruction ¶
func NewInitializeInstruction( name string, symbol string, uri string, metadata common.PublicKey, updateAuthority common.PublicKey, mint common.PublicKey, mintAuthority common.PublicKey, ) *Initialize
NewInitializeInstruction
Parameters:
name: Longer name of the token symbol: Shortened symbol of the token uri: URI pointing to more metadata (image, video, etc.) metadata: Metadata updateAuthority: Update authority mint: Mint mintAuthority: Mint authority
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) GetMetadataAccount ¶
func (obj *Initialize) GetMetadataAccount() *common.AccountMeta
GetMetadataAccount gets the "metadata" parameter. Metadata
func (*Initialize) GetMintAccount ¶
func (obj *Initialize) GetMintAccount() *common.AccountMeta
GetMintAccount gets the "mint" parameter. Mint
func (*Initialize) GetMintAuthorityAccount ¶
func (obj *Initialize) GetMintAuthorityAccount() *common.AccountMeta
GetMintAuthorityAccount gets the "mintAuthority" parameter. Mint authority
func (*Initialize) GetUpdateAuthorityAccount ¶
func (obj *Initialize) GetUpdateAuthorityAccount() *common.AccountMeta
GetUpdateAuthorityAccount gets the "updateAuthority" parameter. Update authority
func (*Initialize) MarshalWithEncoder ¶
func (obj *Initialize) MarshalWithEncoder(encoder *binary.Encoder) (err error)
func (*Initialize) SetMetadataAccount ¶
func (obj *Initialize) SetMetadataAccount(metadata common.PublicKey) *Initialize
SetMetadataAccount sets the "metadata" parameter. Metadata
func (*Initialize) SetMintAccount ¶
func (obj *Initialize) SetMintAccount(mint common.PublicKey) *Initialize
SetMintAccount sets the "mint" parameter. Mint
func (*Initialize) SetMintAuthorityAccount ¶
func (obj *Initialize) SetMintAuthorityAccount(mintAuthority common.PublicKey, multiSigners ...common.PublicKey) *Initialize
SetMintAuthorityAccount sets the "mintAuthority" parameter. Mint authority
func (*Initialize) SetName ¶
func (obj *Initialize) SetName(name string) *Initialize
SetName sets the "name" parameter.
func (*Initialize) SetProgramId ¶
func (obj *Initialize) SetProgramId(programId *common.PublicKey) *Initialize
func (*Initialize) SetSymbol ¶
func (obj *Initialize) SetSymbol(symbol string) *Initialize
SetSymbol sets the "symbol" parameter.
func (*Initialize) SetUpdateAuthorityAccount ¶
func (obj *Initialize) SetUpdateAuthorityAccount(updateAuthority common.PublicKey) *Initialize
SetUpdateAuthorityAccount sets the "updateAuthority" parameter. Update authority
func (*Initialize) SetUri ¶
func (obj *Initialize) SetUri(uri string) *Initialize
SetUri sets the "uri" parameter.
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 (*Instruction) UnmarshalWithDecoder ¶
func (obj *Instruction) UnmarshalWithDecoder(decoder *binary.Decoder) error
type KeyNotFoundError ¶
type KeyNotFoundError struct{}
KeyNotFoundError Error: 901952962 `Key not found in metadata account`
func (KeyNotFoundError) Code ¶
func (e KeyNotFoundError) Code() int
func (KeyNotFoundError) Error ¶
func (e KeyNotFoundError) Error() string
type MintHasNoMintAuthorityError ¶
type MintHasNoMintAuthorityError struct{}
MintHasNoMintAuthorityError Error: 901952958 `Mint has no mint authority`
func (MintHasNoMintAuthorityError) Code ¶
func (e MintHasNoMintAuthorityError) Code() int
func (MintHasNoMintAuthorityError) Error ¶
func (e MintHasNoMintAuthorityError) Error() string
type ProgramError ¶
func GetTokenMetadataErrorFromCode ¶
func GetTokenMetadataErrorFromCode(code int) ProgramError
func GetTokenMetadataErrorFromName ¶
func GetTokenMetadataErrorFromName(name string) ProgramError
type RemoveKey ¶
type RemoveKey struct { // If the idempotent flag is set to true, then the instruction will not,error if the key does not exist Idempotent *bool // Key to remove in the additional metadata portion Key *string // [0] = [WRITE] metadata `Metadata` // [1] = [SIGNER] updateAuthority `Update authority` common.AccountMetaSlice `bin:"-"` // contains filtered or unexported fields }
RemoveKey Instruction
func NewRemoveKeyInstruction ¶
func NewRemoveKeyInstruction( idempotent bool, key string, metadata common.PublicKey, updateAuthority common.PublicKey, ) *RemoveKey
NewRemoveKeyInstruction
Parameters:
idempotent: If the idempotent flag is set to true, then the instruction will not error if the key does not exist key: Key to remove in the additional metadata portion metadata: Metadata updateAuthority: Update authority
func NewRemoveKeyInstructionBuilder ¶
func NewRemoveKeyInstructionBuilder() *RemoveKey
NewRemoveKeyInstructionBuilder creates a new `RemoveKey` instruction builder.
func (*RemoveKey) Build ¶
func (obj *RemoveKey) Build() *Instruction
func (*RemoveKey) EncodeToTree ¶
func (*RemoveKey) GetMetadataAccount ¶
func (obj *RemoveKey) GetMetadataAccount() *common.AccountMeta
GetMetadataAccount gets the "metadata" parameter. Metadata
func (*RemoveKey) GetUpdateAuthorityAccount ¶
func (obj *RemoveKey) GetUpdateAuthorityAccount() *common.AccountMeta
GetUpdateAuthorityAccount gets the "updateAuthority" parameter. Update authority
func (*RemoveKey) MarshalWithEncoder ¶
func (*RemoveKey) SetIdempotent ¶
SetIdempotent sets the "idempotent" parameter.
func (*RemoveKey) SetMetadataAccount ¶
SetMetadataAccount sets the "metadata" parameter. Metadata
func (*RemoveKey) SetProgramId ¶
func (*RemoveKey) SetUpdateAuthorityAccount ¶
func (obj *RemoveKey) SetUpdateAuthorityAccount(updateAuthority common.PublicKey, multiSigners ...common.PublicKey) *RemoveKey
SetUpdateAuthorityAccount sets the "updateAuthority" parameter. Update authority
func (*RemoveKey) UnmarshalWithDecoder ¶
func (*RemoveKey) ValidateAndBuild ¶
func (obj *RemoveKey) 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 TokenMetadata ¶
type TokenMetadata struct { // The authority that can sign to update the metadata UpdateAuthority common.PublicKey // The associated mint, used to counter spoofing to be sure that metadata // belongs to a particular mint Mint common.PublicKey // The longer name of the token Name string // The shortened symbol for the token Symbol string // The URI pointing to richer metadata Uri string // Any additional metadata about the token as key-value pairs. The program // must avoid storing the same key twice. AdditionalMetadata []struct { Key string Value string } }
TokenMetadata Struct
func (*TokenMetadata) MarshalWithEncoder ¶
func (obj *TokenMetadata) MarshalWithEncoder(encoder *binary.Encoder) (err error)
func (*TokenMetadata) UnmarshalWithDecoder ¶
func (obj *TokenMetadata) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
type UpdateAuthority ¶
type UpdateAuthority struct { // New authority for the token metadata, or unset if `None` NewAuthority *common.PublicKey // [0] = [WRITE] metadata `Metadata` // [1] = [SIGNER] updateAuthority `Update authority` common.AccountMetaSlice `bin:"-"` // contains filtered or unexported fields }
UpdateAuthority Instruction
func NewUpdateAuthorityInstruction ¶
func NewUpdateAuthorityInstruction( newAuthority common.PublicKey, metadata common.PublicKey, updateAuthority common.PublicKey, ) *UpdateAuthority
NewUpdateAuthorityInstruction
Parameters:
newAuthority: New authority for the token metadata, or unset if `None` metadata: Metadata updateAuthority: Update authority
func NewUpdateAuthorityInstructionBuilder ¶
func NewUpdateAuthorityInstructionBuilder() *UpdateAuthority
NewUpdateAuthorityInstructionBuilder creates a new `UpdateAuthority` instruction builder.
func (*UpdateAuthority) Build ¶
func (obj *UpdateAuthority) Build() *Instruction
func (*UpdateAuthority) EncodeToTree ¶
func (obj *UpdateAuthority) EncodeToTree(parent treeout.Branches)
func (*UpdateAuthority) GetMetadataAccount ¶
func (obj *UpdateAuthority) GetMetadataAccount() *common.AccountMeta
GetMetadataAccount gets the "metadata" parameter. Metadata
func (*UpdateAuthority) GetUpdateAuthorityAccount ¶
func (obj *UpdateAuthority) GetUpdateAuthorityAccount() *common.AccountMeta
GetUpdateAuthorityAccount gets the "updateAuthority" parameter. Update authority
func (*UpdateAuthority) MarshalWithEncoder ¶
func (obj *UpdateAuthority) MarshalWithEncoder(encoder *binary.Encoder) (err error)
func (*UpdateAuthority) SetMetadataAccount ¶
func (obj *UpdateAuthority) SetMetadataAccount(metadata common.PublicKey) *UpdateAuthority
SetMetadataAccount sets the "metadata" parameter. Metadata
func (*UpdateAuthority) SetNewAuthority ¶
func (obj *UpdateAuthority) SetNewAuthority(newAuthority common.PublicKey) *UpdateAuthority
SetNewAuthority sets the "newAuthority" parameter.
func (*UpdateAuthority) SetProgramId ¶
func (obj *UpdateAuthority) SetProgramId(programId *common.PublicKey) *UpdateAuthority
func (*UpdateAuthority) SetUpdateAuthorityAccount ¶
func (obj *UpdateAuthority) SetUpdateAuthorityAccount(updateAuthority common.PublicKey, multiSigners ...common.PublicKey) *UpdateAuthority
SetUpdateAuthorityAccount sets the "updateAuthority" parameter. Update authority
func (*UpdateAuthority) UnmarshalWithDecoder ¶
func (obj *UpdateAuthority) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
func (*UpdateAuthority) Validate ¶
func (obj *UpdateAuthority) Validate() error
func (*UpdateAuthority) ValidateAndBuild ¶
func (obj *UpdateAuthority) 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 UpdateField ¶
type UpdateField struct { // Field to update in the metadata Field *Field // Value to write for the field Value *string // [0] = [WRITE] metadata `Metadata` // [1] = [SIGNER] updateAuthority `Update authority` common.AccountMetaSlice `bin:"-"` // contains filtered or unexported fields }
UpdateField Instruction
func NewUpdateFieldInstruction ¶
func NewUpdateFieldInstruction( field Field, value string, metadata common.PublicKey, updateAuthority common.PublicKey, ) *UpdateField
NewUpdateFieldInstruction
Parameters:
field: Field to update in the metadata value: Value to write for the field metadata: Metadata updateAuthority: Update authority
func NewUpdateFieldInstructionBuilder ¶
func NewUpdateFieldInstructionBuilder() *UpdateField
NewUpdateFieldInstructionBuilder creates a new `UpdateField` instruction builder.
func (*UpdateField) Build ¶
func (obj *UpdateField) Build() *Instruction
func (*UpdateField) EncodeToTree ¶
func (obj *UpdateField) EncodeToTree(parent treeout.Branches)
func (*UpdateField) GetMetadataAccount ¶
func (obj *UpdateField) GetMetadataAccount() *common.AccountMeta
GetMetadataAccount gets the "metadata" parameter. Metadata
func (*UpdateField) GetUpdateAuthorityAccount ¶
func (obj *UpdateField) GetUpdateAuthorityAccount() *common.AccountMeta
GetUpdateAuthorityAccount gets the "updateAuthority" parameter. Update authority
func (*UpdateField) MarshalWithEncoder ¶
func (obj *UpdateField) MarshalWithEncoder(encoder *binary.Encoder) (err error)
func (*UpdateField) SetField ¶
func (obj *UpdateField) SetField(field Field) *UpdateField
SetField sets the "field" parameter.
func (*UpdateField) SetMetadataAccount ¶
func (obj *UpdateField) SetMetadataAccount(metadata common.PublicKey) *UpdateField
SetMetadataAccount sets the "metadata" parameter. Metadata
func (*UpdateField) SetProgramId ¶
func (obj *UpdateField) SetProgramId(programId *common.PublicKey) *UpdateField
func (*UpdateField) SetUpdateAuthorityAccount ¶
func (obj *UpdateField) SetUpdateAuthorityAccount(updateAuthority common.PublicKey, multiSigners ...common.PublicKey) *UpdateField
SetUpdateAuthorityAccount sets the "updateAuthority" parameter. Update authority
func (*UpdateField) SetValue ¶
func (obj *UpdateField) SetValue(value string) *UpdateField
SetValue sets the "value" parameter.
func (*UpdateField) UnmarshalWithDecoder ¶
func (obj *UpdateField) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
func (*UpdateField) Validate ¶
func (obj *UpdateField) Validate() error
func (*UpdateField) ValidateAndBuild ¶
func (obj *UpdateField) 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.