Documentation ¶
Index ¶
- Constants
- Variables
- func Approve(param ApproveParam) types.Instruction
- func ApproveChecked(param ApproveCheckedParam) types.Instruction
- func Burn(param BurnParam) types.Instruction
- func BurnChecked(param BurnCheckedParam) types.Instruction
- func CloseAccount(param CloseAccountParam) types.Instruction
- func FreezeAccount(param FreezeAccountParam) types.Instruction
- func InitializeAccount(param InitializeAccountParam) types.Instruction
- func InitializeAccount2(param InitializeAccount2Param) types.Instruction
- func InitializeAccount3(param InitializeAccount3Param) types.Instruction
- func InitializeMint(param InitializeMintParam) types.Instruction
- func InitializeMint2(param InitializeMint2Param) types.Instruction
- func InitializeMultisig(param InitializeMultisigParam) types.Instruction
- func InitializeMultisig2(param InitializeMultisig2Param) types.Instruction
- func MintTo(param MintToParam) types.Instruction
- func MintToChecked(param MintToCheckedParam) types.Instruction
- func Revoke(param RevokeParam) types.Instruction
- func SetAuthority(param SetAuthorityParam) types.Instruction
- func SyncNative(param SyncNativeParam) types.Instruction
- func ThawAccount(param ThawAccountParam) types.Instruction
- func Transfer(param TransferParam) types.Instruction
- func TransferChecked(param TransferCheckedParam) types.Instruction
- type ApproveCheckedParam
- type ApproveParam
- type AuthorityType
- type BurnCheckedParam
- type BurnParam
- type CloseAccountParam
- type FreezeAccountParam
- type InitializeAccount2Param
- type InitializeAccount3Param
- type InitializeAccountParam
- type InitializeMint2Param
- type InitializeMintParam
- type InitializeMultisig2Param
- type InitializeMultisigParam
- type Instruction
- type MintAccount
- type MintToCheckedParam
- type MintToParam
- type MultisigAccount
- type RevokeParam
- type SetAuthorityParam
- type SyncNativeParam
- type ThawAccountParam
- type TokenAccount
- type TokenAccountState
- type TransferCheckedParam
- type TransferParam
Constants ¶
View Source
const MaxSigners = 11
View Source
const MintAccountSize = 82
View Source
const MultisigAccountSize = 355
View Source
const TokenAccountSize = 165
Variables ¶
View Source
var ( ErrInvalidAccountOwner = errors.New("invalid account owner") ErrInvalidAccountDataSize = errors.New("invalid account data size") )
View Source
var ( Some = []byte{1, 0, 0, 0} None = []byte{0, 0, 0, 0} )
Functions ¶
func Approve ¶
func Approve(param ApproveParam) types.Instruction
func ApproveChecked ¶
func ApproveChecked(param ApproveCheckedParam) types.Instruction
func Burn ¶
func Burn(param BurnParam) types.Instruction
func BurnChecked ¶
func BurnChecked(param BurnCheckedParam) types.Instruction
func CloseAccount ¶
func CloseAccount(param CloseAccountParam) 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 FreezeAccount(param FreezeAccountParam) types.Instruction
func InitializeAccount ¶
func InitializeAccount(param InitializeAccountParam) types.Instruction
InitializeAccount init a token account which can receive token
func InitializeAccount2 ¶
func InitializeAccount2(param InitializeAccount2Param) types.Instruction
func InitializeAccount3 ¶
func InitializeAccount3(param InitializeAccount3Param) types.Instruction
func InitializeMint ¶
func InitializeMint(param InitializeMintParam) types.Instruction
InitializeMint init a mint, if you don't need to freeze, pass the empty pubKey common.PublicKey{}
func InitializeMint2 ¶
func InitializeMint2(param InitializeMint2Param) types.Instruction
func InitializeMultisig ¶
func InitializeMultisig(param InitializeMultisigParam) types.Instruction
func InitializeMultisig2 ¶
func InitializeMultisig2(param InitializeMultisig2Param) types.Instruction
func MintTo ¶
func MintTo(param MintToParam) types.Instruction
func MintToChecked ¶
func MintToChecked(param MintToCheckedParam) types.Instruction
func Revoke ¶
func Revoke(param RevokeParam) types.Instruction
func SetAuthority ¶
func SetAuthority(param SetAuthorityParam) types.Instruction
func SyncNative ¶
func SyncNative(param SyncNativeParam) types.Instruction
SyncNative will update your wrapped SOL balance
func ThawAccount ¶
func ThawAccount(param ThawAccountParam) types.Instruction
func Transfer ¶
func Transfer(param TransferParam) types.Instruction
func TransferChecked ¶
func TransferChecked(param TransferCheckedParam) types.Instruction
Types ¶
type ApproveCheckedParam ¶
type ApproveParam ¶
type AuthorityType ¶
type AuthorityType uint8
const ( AuthorityTypeMintTokens AuthorityType = iota AuthorityTypeFreezeAccount AuthorityTypeAccountOwner AuthorityTypeCloseAccount )
type BurnCheckedParam ¶
type CloseAccountParam ¶
type FreezeAccountParam ¶
type InitializeAccount2Param ¶
type InitializeAccount3Param ¶
type InitializeAccountParam ¶
type InitializeMint2Param ¶
type InitializeMintParam ¶
type InitializeMultisigParam ¶
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 InstructionInitializeAccount3 InstructionInitializeMultisig2 InstructionInitializeMint2 )
type MintAccount ¶
type MintAccount struct { MintAuthority *common.PublicKey Supply uint64 Decimals uint8 IsInitialized bool FreezeAuthority *common.PublicKey }
func MintAccountFromData ¶
func MintAccountFromData(data []byte) (MintAccount, error)
type MintToCheckedParam ¶
type MintToParam ¶
type MultisigAccount ¶
type MultisigAccount struct { M uint8 // Number of signers required N uint8 // Number of valid signers IsInitialized bool Signers []common.PublicKey }
func MultisigAccountFromData ¶
func MultisigAccountFromData(data []byte) (MultisigAccount, error)
type RevokeParam ¶
type SetAuthorityParam ¶
type SyncNativeParam ¶
type ThawAccountParam ¶
type TokenAccount ¶
type TokenAccount struct { Mint common.PublicKey Owner common.PublicKey Amount uint64 Delegate *common.PublicKey State TokenAccountState // if is wrapped SOL, IsNative is the rent-exempt value IsNative *uint64 DelegatedAmount uint64 CloseAuthority *common.PublicKey }
TokenAccount is token program account
func DeserializeTokenAccount ¶
func DeserializeTokenAccount(data []byte, accountOwner common.PublicKey) (TokenAccount, error)
func TokenAccountFromData ¶
func TokenAccountFromData(data []byte) (TokenAccount, error)
type TokenAccountState ¶
type TokenAccountState uint8
const ( TokenAccountStateUninitialized TokenAccountState = iota TokenAccountStateInitialized TokenAccountFrozen )
type TransferCheckedParam ¶
Click to show internal directories.
Click to hide internal directories.