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 CreateIdempotent
- func (inst CreateIdempotent) Build() *Instruction
- func (inst *CreateIdempotent) EncodeToTree(parent treeout.Branches)
- func (inst CreateIdempotent) MarshalWithEncoder(encoder *bin.Encoder) error
- func (inst *CreateIdempotent) SetMint(mint solana.PublicKey) *CreateIdempotent
- func (inst *CreateIdempotent) SetPayer(payer solana.PublicKey) *CreateIdempotent
- func (inst *CreateIdempotent) SetWallet(wallet solana.PublicKey) *CreateIdempotent
- func (inst *CreateIdempotent) UnmarshalWithDecoder(decoder *bin.Decoder) error
- func (inst *CreateIdempotent) Validate() error
- func (inst CreateIdempotent) 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 ( Instruction_Create uint8 = iota Instruction_CreateIdempotent )
View Source
const ProgramName = "AssociatedTokenAccount"
Variables ¶
View Source
var InstructionImplDef = bin.NewVariantDefinition( bin.Uint8TypeIDEncoding, []bin.VariantType{ { "Create", (*Create)(nil), }, { "CreateIdempotent", (*CreateIdempotent)(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 CreateIdempotent ¶
type CreateIdempotent 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 NewCreateIdempotentInstructionBuilder ¶
func NewCreateIdempotentInstructionBuilder() *CreateIdempotent
NewCreateIdempotentInstructionBuilder creates a new `CreateIdempotent` instruction builder.
func (CreateIdempotent) Build ¶
func (inst CreateIdempotent) Build() *Instruction
func (*CreateIdempotent) EncodeToTree ¶
func (inst *CreateIdempotent) EncodeToTree(parent treeout.Branches)
func (CreateIdempotent) MarshalWithEncoder ¶
func (inst CreateIdempotent) MarshalWithEncoder(encoder *bin.Encoder) error
func (*CreateIdempotent) SetMint ¶
func (inst *CreateIdempotent) SetMint(mint solana.PublicKey) *CreateIdempotent
func (*CreateIdempotent) SetPayer ¶
func (inst *CreateIdempotent) SetPayer(payer solana.PublicKey) *CreateIdempotent
func (*CreateIdempotent) SetWallet ¶
func (inst *CreateIdempotent) SetWallet(wallet solana.PublicKey) *CreateIdempotent
func (*CreateIdempotent) UnmarshalWithDecoder ¶
func (inst *CreateIdempotent) UnmarshalWithDecoder(decoder *bin.Decoder) error
func (*CreateIdempotent) Validate ¶
func (inst *CreateIdempotent) Validate() error
func (CreateIdempotent) ValidateAndBuild ¶
func (inst CreateIdempotent) 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.