Documentation
¶
Index ¶
- Constants
- Variables
- func IsInstruction(data []byte) bool
- type IDLClose
- type IDLCreate
- type IDLCreateBuffer
- type IDLResize
- type IDLSetAuthority
- type IDLSetBuffer
- type IDLWrite
- type Instruction
- func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta)
- func (inst *Instruction) Data() ([]byte, error)
- func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error
- func (inst *Instruction) ProgramID() ag_solanago.PublicKey
- func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error
Constants ¶
View Source
const ( InstructionCreate uint8 = iota // One-time initializer for creating the program's IDL account. InstructionCreateBuffer // Creates a new IDL account buffer. Can be called several times. InstructionWrite // Appends the given data to the end of the IDL account buffer. InstructionSetBuffer // Sets a new data buffer for the IdlAccount. InstructionSetAuthority // Sets a new authority on the IdlAccount. InstructionClose // Closes the IDL PDA account. InstructionResize // Increases account size for accounts that need over 10kb. )
View Source
const ProgramName = "AnchorIDL"
Variables ¶
View Source
var Discriminator = []byte{64, 244, 188, 120, 167, 233, 105, 10}
Discriminator is the fixed 8-byte Anchor discriminator that identifies IDL instructions.
View Source
var InstructionImplDef = ag_binary.NewVariantDefinition( ag_binary.Uint8TypeIDEncoding, []ag_binary.VariantType{ {Name: "create", Type: (*IDLCreate)(nil)}, {Name: "create_buffer", Type: (*IDLCreateBuffer)(nil)}, {Name: "write", Type: (*IDLWrite)(nil)}, {Name: "set_buffer", Type: (*IDLSetBuffer)(nil)}, {Name: "set_authority", Type: (*IDLSetAuthority)(nil)}, {Name: "close", Type: (*IDLClose)(nil)}, {Name: "resize", Type: (*IDLResize)(nil)}, }, )
View Source
var ProgramID ag_solanago.PublicKey
ProgramID is a zero sentinel since IDL instructions are sent to the target program rather than a dedicated IDL program address.
Functions ¶
func IsInstruction ¶
IsInstruction reports whether data starts with the IDL instruction discriminator.
Types ¶
type IDLCreateBuffer ¶
type IDLCreateBuffer struct{}
func (*IDLCreateBuffer) UnmarshalWithDecoder ¶
func (inst *IDLCreateBuffer) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error
type IDLSetAuthority ¶
type IDLSetAuthority struct{ NewAuthority ag_solanago.PublicKey }
func (*IDLSetAuthority) UnmarshalWithDecoder ¶
func (inst *IDLSetAuthority) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error
type IDLSetBuffer ¶
type IDLSetBuffer struct{}
func (*IDLSetBuffer) UnmarshalWithDecoder ¶
func (inst *IDLSetBuffer) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error
type Instruction ¶
type Instruction struct {
ag_binary.BaseVariant
}
func DecodeInstruction ¶
func DecodeInstruction(accounts []*ag_solanago.AccountMeta, data []byte) (*Instruction, error)
DecodeInstruction decodes a Solana IDL instruction from the given accounts and data. The data must start with the 8-byte IDL discriminator followed by a 1-byte instruction type.
func (*Instruction) Accounts ¶
func (inst *Instruction) Accounts() (out []*ag_solanago.AccountMeta)
func (*Instruction) Data ¶
func (inst *Instruction) Data() ([]byte, error)
func (*Instruction) MarshalWithEncoder ¶
func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error
func (*Instruction) ProgramID ¶
func (inst *Instruction) ProgramID() ag_solanago.PublicKey
func (*Instruction) UnmarshalWithDecoder ¶
func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error
Click to show internal directories.
Click to hide internal directories.