Documentation
¶
Index ¶
- Constants
- Variables
- func FindAssociatedTokenAddress2022(wallet solana.PublicKey, mint solana.PublicKey) (solana.PublicKey, uint8, error)
- type AccountMetaGettable
- type Create2022
- func (inst Create2022) Build() *Instruction
- func (inst *Create2022) EncodeToTree(parent treeout.Branches)
- func (inst Create2022) GetAccounts() []*solana.AccountMeta
- func (inst Create2022) MarshalWithEncoder(encoder *bin.Encoder) error
- func (inst *Create2022) SetMint(mint solana.PublicKey) *Create2022
- func (inst *Create2022) SetPayer(payer solana.PublicKey) *Create2022
- func (inst *Create2022) SetWallet(wallet solana.PublicKey) *Create2022
- func (inst *Create2022) UnmarshalWithDecoder(decoder *bin.Decoder) error
- func (inst *Create2022) Validate() error
- func (inst Create2022) ValidateAndBuild() (*Instruction, error)
- type Instruction
- func (inst *Instruction) Accounts() []*solana.AccountMeta
- func (inst *Instruction) Data() ([]byte, error)
- func (inst *Instruction) MarshalWithEncoder(encoder *bin.Encoder) error
- func (inst *Instruction) ProgramID() solana.PublicKey
- func (inst *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) error
- type InstructionImpl
Constants ¶
const ProgramName = "Associated Token Account Program"
ProgramName is the name of the Associated Token Account program for Token 2022
Variables ¶
var ProgramID = solana.SPLAssociatedTokenAccountProgramID
ProgramID is the ID of the Associated Token Account program
Functions ¶
Types ¶
type AccountMetaGettable ¶
type AccountMetaGettable interface {
GetAccounts() []*solana.AccountMeta
}
AccountMetaGettable is an interface for getting account metas
type Create2022 ¶
type Create2022 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
// ··········· Token 2022 program ID
//
// [6] = [] SysVarRent
// ··········· SysVarRentPubkey
solana.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}
func NewCreate2022Instruction ¶
func NewCreate2022Instruction( payer solana.PublicKey, walletAddress solana.PublicKey, splTokenMintAddress solana.PublicKey, ) *Create2022
NewCreate2022Instruction creates a new instruction for creating an associated token account for Token 2022
func NewCreate2022InstructionBuilder ¶
func NewCreate2022InstructionBuilder() *Create2022
NewCreate2022InstructionBuilder creates a new `Create2022` instruction builder.
func (Create2022) Build ¶
func (inst Create2022) Build() *Instruction
func (*Create2022) EncodeToTree ¶
func (inst *Create2022) EncodeToTree(parent treeout.Branches)
func (Create2022) GetAccounts ¶
func (inst Create2022) GetAccounts() []*solana.AccountMeta
GetAccounts implements the AccountMetaGettable interface
func (Create2022) MarshalWithEncoder ¶
func (inst Create2022) MarshalWithEncoder(encoder *bin.Encoder) error
func (*Create2022) SetMint ¶
func (inst *Create2022) SetMint(mint solana.PublicKey) *Create2022
func (*Create2022) SetPayer ¶
func (inst *Create2022) SetPayer(payer solana.PublicKey) *Create2022
func (*Create2022) SetWallet ¶
func (inst *Create2022) SetWallet(wallet solana.PublicKey) *Create2022
func (*Create2022) UnmarshalWithDecoder ¶
func (inst *Create2022) UnmarshalWithDecoder(decoder *bin.Decoder) error
func (*Create2022) Validate ¶
func (inst *Create2022) Validate() error
func (Create2022) ValidateAndBuild ¶
func (inst Create2022) 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
}
Instruction is a base type for all instructions.
func (*Instruction) Accounts ¶
func (inst *Instruction) Accounts() []*solana.AccountMeta
Accounts returns the list of accounts that this instruction requires.
func (*Instruction) Data ¶
func (inst *Instruction) Data() ([]byte, error)
Data serializes the instruction data.
func (*Instruction) MarshalWithEncoder ¶
func (inst *Instruction) MarshalWithEncoder(encoder *bin.Encoder) error
MarshalWithEncoder implements the bin.EncoderDecoder interface
func (*Instruction) ProgramID ¶
func (inst *Instruction) ProgramID() solana.PublicKey
ProgramID returns the program ID.
func (*Instruction) UnmarshalWithDecoder ¶
func (inst *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) error
UnmarshalWithDecoder implements the bin.EncoderDecoder interface
type InstructionImpl ¶
type InstructionImpl interface {
bin.EncoderDecoder
Validate() error
}
InstructionImpl is the interface that all instructions implement.