Documentation
¶
Index ¶
- Constants
- Variables
- func Approve(sourcePubkey, delegatePubkey, authPubkey common.PublicKey, ...) types.Instruction
- func ApproveChecked(sourcePubkey, mintPubkey, delegatePubkey, authPubkey common.PublicKey, ...) types.Instruction
- func Burn(accountPubkey, mintPubkey, authPubkey common.PublicKey, ...) types.Instruction
- func BurnChecked(accountPubkey, mintPubkey, authPubkey common.PublicKey, ...) types.Instruction
- func CloseAccount(accountPubkey, destPubkey, authPubkey common.PublicKey, ...) types.Instruction
- func FreezeAccount(accountPubkey, mintPubkey, authPubkey common.PublicKey, ...) types.Instruction
- func InitializeAccount(accountPublicKey, mintPublicKey, ownerPublickey common.PublicKey) types.Instruction
- func InitializeAccount2(accountPubkey, mintPubkey, ownerPubkey common.PublicKey) types.Instruction
- func InitializeMint(decimals uint8, mint, mintAuthority common.PublicKey, ...) types.Instruction
- func InitializeMultisig(authPubkey common.PublicKey, signerPubkeys []common.PublicKey, ...) types.Instruction
- func MintTo(mintPubkey, destPubkey, authPubkey common.PublicKey, ...) types.Instruction
- func MintToChecked(mintPubkey, destPubkey, authPubkey common.PublicKey, ...) types.Instruction
- func Revoke(srcPubkey, authPubkey common.PublicKey, signerPubkeys []common.PublicKey) types.Instruction
- func SetAuthority(accountPubkey, newAuthPubkey common.PublicKey, authType AuthorityType, ...) types.Instruction
- func SyncNative(accountPubkey common.PublicKey) types.Instruction
- func ThawAccount(accountPubkey, mintPubkey, authPubkey common.PublicKey, ...) types.Instruction
- func Transfer(srcPubkey, destPubkey, authPubkey common.PublicKey, ...) types.Instruction
- func TransferChecked(srcPubkey, destPubkey, mintPubkey, authPubkey common.PublicKey, ...) types.Instruction
- type AuthorityType
- type Instruction
- type MintAccount
- type TokenAccount
- type TokenAccountState
Constants ¶
View Source
const MintAccountSize = 82
View Source
const MultisigAccountSize uint64 = 355
View Source
const TokenAccountSize = 165
Variables ¶
View Source
var ( Some = []byte{1, 0, 0, 0} None = []byte{0, 0, 0, 0} )
Functions ¶
func ApproveChecked ¶
func BurnChecked ¶
func CloseAccount ¶
func CloseAccount(accountPubkey, destPubkey, authPubkey common.PublicKey, signerPubkeys []common.PublicKey) types.Instruction
Close an account and transfer its all SOL to dest, only account's token balance is zero can be closed.
func FreezeAccount ¶
func InitializeAccount ¶
func InitializeAccount(accountPublicKey, mintPublicKey, ownerPublickey common.PublicKey) types.Instruction
InitializeAccount init a token account which can receive token
func InitializeAccount2 ¶
func InitializeAccount2(accountPubkey, mintPubkey, ownerPubkey common.PublicKey) types.Instruction
func InitializeMint ¶
func InitializeMint(decimals uint8, mint, mintAuthority common.PublicKey, freezeAuthority common.PublicKey) types.Instruction
InitializeMint init a mint, if you don't need to freeze, pass the empty pubKey common.PublicKey{}
func InitializeMultisig ¶
func MintToChecked ¶
func SetAuthority ¶
func SetAuthority(accountPubkey, newAuthPubkey common.PublicKey, authType AuthorityType, authPubkey common.PublicKey, signerPubkeys []common.PublicKey) types.Instruction
func SyncNative ¶
func SyncNative(accountPubkey common.PublicKey) types.Instruction
SyncNative will update your wrapped SOL balance
func ThawAccount ¶
func TransferChecked ¶
Types ¶
type AuthorityType ¶
type AuthorityType uint8
const ( AuthorityTypeMintTokens AuthorityType = iota AuthorityTypeFreezeAccount AuthorityTypeAccountOwner AuthorityTypeCloseAccount )
type Instruction ¶
type Instruction uint8
const ( InstructionInitializeMint Instruction = iota InstructionInitializeAccount InstructionInitializeMultisig InstructionTransfer InstructionApprove InstructionRevoke InstructionSetAuthority InstructionMintTo InstructionBurn InstructionCloseAccount InstructionFreezeAccount InstructionThawAccount InstructionTransferChecked InstructionApproveChecked InstructionMintToChecked InstructionBurnChecked InstructionInitializeAccount2 InstructionSyncNative InitializeAccount3 InitializeMultisig2 InitializeMint2 )
type MintAccount ¶
type TokenAccount ¶
type TokenAccount struct { Mint common.PublicKey Owner common.PublicKey Amount uint64 Delegate *common.PublicKey State TokenAccountState IsNative *uint64 DelegatedAmount uint64 CloseAuthority *common.PublicKey }
TokenAccount is token program account
func TokenAccountFromData ¶
func TokenAccountFromData(data []byte) (*TokenAccount, error)
type TokenAccountState ¶
type TokenAccountState uint8
const ( TokenAccountStateUninitialized TokenAccountState = iota TokenAccountStateInitialized TokenAccountFrozen )
Click to show internal directories.
Click to hide internal directories.