Documentation ¶
Index ¶
- Constants
- Variables
- type Approve
- type ApproveAccounts
- type ApproveChecked
- type ApproveCheckedAccounts
- type AuthorityType
- type Burn
- type BurnAccounts
- type BurnChecked
- type BurnCheckedAccounts
- type CloseAccount
- type CloseAccountAccounts
- type FreezeAccount
- type FreezeAccountAccounts
- type InitializeAccount
- type InitializeAccountAccounts
- type InitializeMint
- type InitializeMintAccounts
- type InitializeMultisig
- type InitializeMultisigAccounts
- type Instruction
- func DecodeInstruction(accounts []*types.AccountMeta, data []byte) (*Instruction, error)
- func NewBurnToInstruction(amount uint64, account types.PublicKey, mint types.PublicKey, ...) *Instruction
- func NewCloseAccountInstruction(account types.PublicKey, destination types.PublicKey, owner types.PublicKey) *Instruction
- func NewInitializeMintInstruction(decimals uint8, mint types.PublicKey, mintAuthority types.PublicKey, ...) *Instruction
- func NewMintToInstruction(amount uint64, mint types.PublicKey, account types.PublicKey, ...) *Instruction
- func NewSetAuthorityInstruction(account types.PublicKey, newAuthority types.PublicKey, ...) *Instruction
- func NewTransferInstruction(amount uint64, source types.PublicKey, destination types.PublicKey, ...) *Instruction
- type MintTo
- type MintToAccounts
- type MintToChecked
- type MintToCheckedAccounts
- type Revoke
- type RevokeAccounts
- type SetAuthority
- type SetAuthorityAccounts
- type ThawAccount
- type ThawAccountAccounts
- type Transfer
- type TransferAccounts
- type TransferChecked
- type TransferCheckedAccounts
Constants ¶
const ( InitializeMintTypeID uint32 = iota TransferTypeID = 3 // 3 SetAuthorityTypeID = 6 // 6 MintToTypeID = 7 // 7 BurnTypeID = 8 // 8 CloseAccountTypeID = 9 // 9 )
typeID constants
Variables ¶
var InstructionDefVariant = bin.NewVariantDefinition(bin.Uint8TypeIDEncoding, []bin.VariantType{ {Name: "initialize_mint", Type: (*InitializeMint)(nil)}, {Name: "initialize_account", Type: (*InitializeAccount)(nil)}, {Name: "InitializeMultisig", Type: (*InitializeMultisig)(nil)}, {Name: "Transfer", Type: (*Transfer)(nil)}, {Name: "Approve", Type: (*Approve)(nil)}, {Name: "Revoke", Type: (*Revoke)(nil)}, {Name: "SetAuthority", Type: (*SetAuthority)(nil)}, {Name: "MintTo", Type: (*MintTo)(nil)}, {Name: "Burn", Type: (*Burn)(nil)}, {Name: "CloseAccount", Type: (*CloseAccount)(nil)}, {Name: "FreezeAccount", Type: (*FreezeAccount)(nil)}, {Name: "ThawAccount", Type: (*ThawAccount)(nil)}, {Name: "TransferChecked", Type: (*TransferChecked)(nil)}, {Name: "ApproveChecked", Type: (*ApproveChecked)(nil)}, {Name: "MintToChecked", Type: (*MintToChecked)(nil)}, {Name: "BurnChecked", Type: (*BurnChecked)(nil)}, })
InstructionDefVariant default variant
var (
TokenProgramID = types.MustPublicKeyFromBase58("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")
)
programID contants
Functions ¶
This section is empty.
Types ¶
type ApproveChecked ¶
type ApproveChecked struct {
Accounts *ApproveCheckedAccounts
}
ApproveChecked type
type AuthorityType ¶
type AuthorityType byte
AuthorityType type
const ( MintTokensAuthorityType AuthorityType = iota FreezeAccountAuthorityType AccountOwnerAuthorityType CloseAccountAuthorityType )
AuthorityType constants
type BurnAccounts ¶
type BurnAccounts struct { Account *types.AccountMeta Mint *types.AccountMeta Owner *types.AccountMeta }
BurnAccounts type
type CloseAccountAccounts ¶
type CloseAccountAccounts struct { Account *types.AccountMeta Desination *types.AccountMeta Owner *types.AccountMeta }
CloseAccountAccounts type
type FreezeAccount ¶
type FreezeAccount struct {
Accounts *FreezeAccountAccounts
}
FreezeAccount type
type InitializeAccount ¶
type InitializeAccount struct {
Accounts *InitializeAccountAccounts `bin:"-"`
}
InitializeAccount type
func (*InitializeAccount) SetAccounts ¶
func (i *InitializeAccount) SetAccounts(accounts []*types.AccountMeta) error
SetAccounts set accounts
type InitializeAccountAccounts ¶
type InitializeAccountAccounts struct { Account *types.AccountMeta `text:"linear,notype"` Mint *types.AccountMeta `text:"linear,notype"` Owner *types.AccountMeta `text:"linear,notype"` RentSysvar *types.AccountMeta `text:"linear,notype"` }
InitializeAccountAccounts type
type InitializeMint ¶
type InitializeMint struct { /// Number of base 10 digits to the right of the decimal place. Decimals uint8 /// The authority/multisignature to mint tokens. MintAuthority types.PublicKey Option uint8 /// The freeze authority/multisignature of the mint. FreezeAuthority *types.PublicKey Accounts *InitializeMintAccounts `bin:"-"` }
InitializeMint type
func (*InitializeMint) SetAccounts ¶
func (i *InitializeMint) SetAccounts(accounts []*types.AccountMeta) error
SetAccounts set accounts
type InitializeMintAccounts ¶
type InitializeMintAccounts struct { Mint *types.AccountMeta RentProgram *types.AccountMeta }
InitializeMintAccounts type
type InitializeMultisig ¶
type InitializeMultisig struct {
Accounts *InitializeMultisigAccounts
}
InitializeMultisig type
type InitializeMultisigAccounts ¶
type InitializeMultisigAccounts struct { }
InitializeMultisigAccounts type
type Instruction ¶
type Instruction struct {
bin.BaseVariant
}
Instruction type
func DecodeInstruction ¶
func DecodeInstruction(accounts []*types.AccountMeta, data []byte) (*Instruction, error)
DecodeInstruction decode instruction
func NewBurnToInstruction ¶
func NewBurnToInstruction( amount uint64, account types.PublicKey, mint types.PublicKey, owner types.PublicKey, ) *Instruction
NewBurnToInstruction new MintTo instruction
func NewCloseAccountInstruction ¶
func NewCloseAccountInstruction( account types.PublicKey, destination types.PublicKey, owner types.PublicKey, ) *Instruction
NewCloseAccountInstruction new CloseAccount instruction
func NewInitializeMintInstruction ¶
func NewInitializeMintInstruction( decimals uint8, mint types.PublicKey, mintAuthority types.PublicKey, freezeAuthority *types.PublicKey, rentProgram types.PublicKey, ) *Instruction
NewInitializeMintInstruction new InitializeMint instruction
func NewMintToInstruction ¶
func NewMintToInstruction( amount uint64, mint types.PublicKey, account types.PublicKey, minter types.PublicKey, ) *Instruction
NewMintToInstruction new MintTo instruction
func NewSetAuthorityInstruction ¶
func NewSetAuthorityInstruction( account types.PublicKey, newAuthority types.PublicKey, authorityType AuthorityType, currentAuthority types.PublicKey, ) *Instruction
NewSetAuthorityInstruction new SetAuthority instruction
func NewTransferInstruction ¶
func NewTransferInstruction( amount uint64, source types.PublicKey, destination types.PublicKey, from types.PublicKey, ) *Instruction
NewTransferInstruction new Transfer instruction
func (*Instruction) Accounts ¶
func (i *Instruction) Accounts() (out []*types.AccountMeta)
Accounts get accounts
func (*Instruction) MarshalBinary ¶
func (i *Instruction) MarshalBinary(encoder *bin.Encoder) error
MarshalBinary marshal binary
func (*Instruction) ProgramID ¶
func (i *Instruction) ProgramID() types.PublicKey
ProgramID get proram ID
func (*Instruction) UnmarshalBinary ¶
func (i *Instruction) UnmarshalBinary(decoder *bin.Decoder) (err error)
UnmarshalBinary unmarshal binary
type MintToAccounts ¶
type MintToAccounts struct { Mint *types.AccountMeta Account *types.AccountMeta Minter *types.AccountMeta }
MintToAccounts type
type MintToChecked ¶
type MintToChecked struct {
Accounts *MintToCheckedAccounts
}
MintToChecked type
type SetAuthority ¶
type SetAuthority struct { AuthorityType AuthorityType NewAuthorityKey types.PublicKey `bin:"optional"` Accounts *SetAuthorityAccounts `bin:"-"` }
SetAuthority type
type SetAuthorityAccounts ¶
type SetAuthorityAccounts struct { Account *types.AccountMeta CurrentAuthority *types.AccountMeta }
SetAuthorityAccounts type
type Transfer ¶
type Transfer struct { Amount uint64 Accounts *TransferAccounts }
Transfer transfer type
type TransferAccounts ¶
type TransferAccounts struct { Source *types.AccountMeta Destination *types.AccountMeta From *types.AccountMeta }
TransferAccounts type
type TransferChecked ¶
type TransferChecked struct {
Accounts *TransferCheckedAccounts
}
TransferChecked type