Documentation ¶
Index ¶
- Constants
- Variables
- func InstructionIDToName(id uint8) string
- func SetProgramID(pubkey common.PublicKey)
- type CpiGuard
- type Disable
- func (obj *Disable) Build() *Instruction
- func (obj *Disable) EncodeToTree(parent treeout.Branches)
- func (obj *Disable) GetAccountAccount() *common.AccountMeta
- func (obj *Disable) GetOwnerAccount() *common.AccountMeta
- func (obj *Disable) MarshalWithEncoder(encoder *binary.Encoder) (err error)
- func (obj *Disable) SetAccountAccount(account common.PublicKey) *Disable
- func (obj *Disable) SetOwnerAccount(owner common.PublicKey, multiSigners ...common.PublicKey) *Disable
- func (obj *Disable) SetProgramId(programId *common.PublicKey) *Disable
- func (obj *Disable) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
- func (obj *Disable) Validate() error
- func (obj *Disable) ValidateAndBuild() (*Instruction, error)
- type Enable
- func (obj *Enable) Build() *Instruction
- func (obj *Enable) EncodeToTree(parent treeout.Branches)
- func (obj *Enable) GetAccountAccount() *common.AccountMeta
- func (obj *Enable) GetOwnerAccount() *common.AccountMeta
- func (obj *Enable) MarshalWithEncoder(encoder *binary.Encoder) (err error)
- func (obj *Enable) SetAccountAccount(account common.PublicKey) *Enable
- func (obj *Enable) SetOwnerAccount(owner common.PublicKey, multiSigners ...common.PublicKey) *Enable
- func (obj *Enable) SetProgramId(programId *common.PublicKey) *Enable
- func (obj *Enable) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
- func (obj *Enable) Validate() error
- func (obj *Enable) 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
Constants ¶
const CPI_GUARD_SIZE = 1
const ProgramName = "cpi_guard"
Variables ¶
var ( Instruction_Enable uint8 = 0 Instruction_Disable uint8 = 1 )
var InstructionImplDef = binary.NewVariantDefinition(binary.Uint8TypeIDEncoding, []binary.VariantType{ { "enable", (*Enable)(nil), }, { "disable", (*Disable)(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 CpiGuard ¶
type CpiGuard struct { // Lock privileged token operations from happening via CPI LockCpi bool }
CpiGuard Struct
func (*CpiGuard) MarshalWithEncoder ¶
type Disable ¶
type Disable struct { // [0] = [WRITE] account `The account to update.` // [1] = [SIGNER] owner `The account's owner.` common.AccountMetaSlice `bin:"-"` // contains filtered or unexported fields }
Disable Instruction
func NewDisableInstruction ¶
NewDisableInstruction
Parameters:
account: The account to update. owner: The account's owner.
func NewDisableInstructionBuilder ¶
func NewDisableInstructionBuilder() *Disable
NewDisableInstructionBuilder creates a new `Disable` instruction builder.
func (*Disable) Build ¶
func (obj *Disable) Build() *Instruction
func (*Disable) EncodeToTree ¶
func (*Disable) GetAccountAccount ¶
func (obj *Disable) GetAccountAccount() *common.AccountMeta
GetAccountAccount gets the "account" parameter. The account to update.
func (*Disable) GetOwnerAccount ¶
func (obj *Disable) GetOwnerAccount() *common.AccountMeta
GetOwnerAccount gets the "owner" parameter. The account's owner.
func (*Disable) MarshalWithEncoder ¶
func (*Disable) SetAccountAccount ¶
SetAccountAccount sets the "account" parameter. The account to update.
func (*Disable) SetOwnerAccount ¶
func (obj *Disable) SetOwnerAccount(owner common.PublicKey, multiSigners ...common.PublicKey) *Disable
SetOwnerAccount sets the "owner" parameter. The account's owner.
func (*Disable) SetProgramId ¶
func (*Disable) UnmarshalWithDecoder ¶
func (*Disable) ValidateAndBuild ¶
func (obj *Disable) 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 Enable ¶
type Enable struct { // [0] = [WRITE] account `The account to update.` // [1] = [SIGNER] owner `The account's owner.` common.AccountMetaSlice `bin:"-"` // contains filtered or unexported fields }
Enable Instruction
func NewEnableInstruction ¶
NewEnableInstruction
Parameters:
account: The account to update. owner: The account's owner.
func NewEnableInstructionBuilder ¶
func NewEnableInstructionBuilder() *Enable
NewEnableInstructionBuilder creates a new `Enable` instruction builder.
func (*Enable) Build ¶
func (obj *Enable) Build() *Instruction
func (*Enable) EncodeToTree ¶
func (*Enable) GetAccountAccount ¶
func (obj *Enable) GetAccountAccount() *common.AccountMeta
GetAccountAccount gets the "account" parameter. The account to update.
func (*Enable) GetOwnerAccount ¶
func (obj *Enable) GetOwnerAccount() *common.AccountMeta
GetOwnerAccount gets the "owner" parameter. The account's owner.
func (*Enable) MarshalWithEncoder ¶
func (*Enable) SetAccountAccount ¶
SetAccountAccount sets the "account" parameter. The account to update.
func (*Enable) SetOwnerAccount ¶
func (obj *Enable) SetOwnerAccount(owner common.PublicKey, multiSigners ...common.PublicKey) *Enable
SetOwnerAccount sets the "owner" parameter. The account's owner.
func (*Enable) UnmarshalWithDecoder ¶
func (*Enable) ValidateAndBuild ¶
func (obj *Enable) 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