Documentation ¶
Index ¶
- Constants
- Variables
- func SetProgramID(pubkey solana.PublicKey)
- type Create
- func (inst Create) Build() *Instruction
- func (inst *Create) EncodeToTree(parent treeout.Branches)
- func (inst Create) MarshalWithEncoder(encoder *bin.Encoder) error
- func (inst *Create) SetMint(mint solana.PublicKey) *Create
- func (inst *Create) SetPayer(payer solana.PublicKey) *Create
- func (inst *Create) SetWallet(wallet solana.PublicKey) *Create
- func (inst *Create) UnmarshalWithDecoder(decoder *bin.Decoder) error
- func (inst *Create) Validate() error
- func (inst Create) ValidateAndBuild() (*Instruction, error)
- type Instruction
- func (inst *Instruction) Accounts() (out []*solana.AccountMeta)
- func (inst *Instruction) Data() ([]byte, error)
- func (inst *Instruction) EncodeToTree(parent treeout.Branches)
- func (inst Instruction) MarshalWithEncoder(encoder *bin.Encoder) error
- func (inst *Instruction) ProgramID() solana.PublicKey
- func (inst *Instruction) TextEncode(encoder *text.Encoder, option *text.Option) error
- func (inst *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) error
Constants ¶
View Source
const ProgramName = "AssociatedTokenAccount"
Variables ¶
View Source
var InstructionImplDef = bin.NewVariantDefinition( bin.NoTypeIDEncoding, []bin.VariantType{ { "Create", (*Create)(nil), }, }, )
View Source
var ProgramID solana.PublicKey = solana.SPLAssociatedTokenAccountProgramID
Functions ¶
func SetProgramID ¶
Types ¶
type Create ¶
type Create struct { Payer solana.PublicKey `bin:"-" borsh_skip:"true"` Wallet solana.PublicKey `bin:"-" borsh_skip:"true"` Mint solana.PublicKey `bin:"-" borsh_skip:"true"` // [0] = [WRITE, SIGNER] Payer // ··········· Funding account // // [1] = [WRITE] AssociatedTokenAccount // ··········· Associated token account address to be created // // [2] = [] Wallet // ··········· Wallet address for the new associated token account // // [3] = [] TokenMint // ··········· The token mint for the new associated token account // // [4] = [] SystemProgram // ··········· System program ID // // [5] = [] TokenProgram // ··········· SPL token program ID // // [6] = [] SysVarRent // ··········· SysVarRentPubkey solana.AccountMetaSlice `bin:"-" borsh_skip:"true"` }
func NewCreateInstruction ¶
func NewCreateInstructionBuilder ¶
func NewCreateInstructionBuilder() *Create
NewCreateInstructionBuilder creates a new `Create` instruction builder.
func (Create) Build ¶
func (inst Create) Build() *Instruction
func (*Create) EncodeToTree ¶
func (Create) MarshalWithEncoder ¶
func (*Create) UnmarshalWithDecoder ¶
func (Create) ValidateAndBuild ¶
func (inst Create) ValidateAndBuild() (*Instruction, error)
ValidateAndBuild validates the instruction accounts. If there is a validation error, return the error. Otherwise, build and return the instruction.
type Instruction ¶
type Instruction struct {
bin.BaseVariant
}
func DecodeInstruction ¶
func DecodeInstruction(accounts []*solana.AccountMeta, data []byte) (*Instruction, error)
func (*Instruction) Accounts ¶
func (inst *Instruction) Accounts() (out []*solana.AccountMeta)
func (*Instruction) Data ¶
func (inst *Instruction) Data() ([]byte, error)
func (*Instruction) EncodeToTree ¶
func (inst *Instruction) EncodeToTree(parent treeout.Branches)
func (Instruction) MarshalWithEncoder ¶
func (inst Instruction) MarshalWithEncoder(encoder *bin.Encoder) error
func (*Instruction) ProgramID ¶
func (inst *Instruction) ProgramID() solana.PublicKey
func (*Instruction) TextEncode ¶
func (*Instruction) UnmarshalWithDecoder ¶
func (inst *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) error
Click to show internal directories.
Click to hide internal directories.