token

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 9 Imported by: 103

Documentation

Overview

Code generated by rice embed-go; DO NOT EDIT.

Index

Constants

View Source
const MINT_SIZE = 82

Variables

View Source
var InstructionDefVariant = bin.NewVariantDefinition(bin.Uint8TypeIDEncoding, []bin.VariantType{
	{"initialize_mint", (*InitializeMint)(nil)},
	{"initialize_account", (*InitializeAccount)(nil)},
	{"InitializeMultisig", (*InitializeMultisig)(nil)},
	{"Transfer", (*Transfer)(nil)},
	{"Approve", (*Approve)(nil)},
	{"Revoke", (*Revoke)(nil)},
	{"SetAuthority", (*SetAuthority)(nil)},
	{"MintTo", (*MintTo)(nil)},
	{"Burn", (*Burn)(nil)},
	{"CloseAccount", (*CloseAccount)(nil)},
	{"FreezeAccount", (*FreezeAccount)(nil)},
	{"ThawAccount", (*ThawAccount)(nil)},
	{"TransferChecked", (*TransferChecked)(nil)},
	{"ApproveChecked", (*ApproveChecked)(nil)},
	{"MintToChecked", (*MintToChecked)(nil)},
	{"BurnChecked", (*BurnChecked)(nil)},
})
View Source
var TOKEN_PROGRAM_ID = solana.MustPublicKeyFromBase58("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")

Functions

This section is empty.

Types

type Account

type Account struct {
	Mint            solana.PublicKey
	Owner           solana.PublicKey
	Amount          bin.Uint64
	IsDelegateSet   uint32
	Delegate        solana.PublicKey
	IsInitialized   bool
	IsNative        bool
	Padding         [2]byte `json:"-"`
	DelegatedAmount bin.Uint64
}

type Approve

type Approve struct {
	Accounts *ApproveAccounts
}

type ApproveAccounts

type ApproveAccounts struct {
}

type ApproveChecked

type ApproveChecked struct {
	Accounts *ApproveCheckedAccounts
}

type ApproveCheckedAccounts

type ApproveCheckedAccounts struct {
}

type Burn

type Burn struct {
	Accounts *BurnAccounts
}

type BurnAccounts

type BurnAccounts struct {
}

type BurnChecked

type BurnChecked struct {
	Accounts *BurnCheckedAccounts
}

type BurnCheckedAccounts

type BurnCheckedAccounts struct {
}

type CloseAccount

type CloseAccount struct {
	Accounts *CloseAccountAccounts
}

type CloseAccountAccounts

type CloseAccountAccounts struct {
}

type FreezeAccount

type FreezeAccount struct {
	Accounts *FreezeAccountAccounts
}

type FreezeAccountAccounts

type FreezeAccountAccounts struct {
}

type InitializeAccount

type InitializeAccount struct {
	Accounts *InitializeAccountAccounts `bin:"-"`
}

func (*InitializeAccount) SetAccounts

func (i *InitializeAccount) SetAccounts(accounts []*solana.AccountMeta) error

type InitializeAccountAccounts

type InitializeAccountAccounts struct {
	Account    *solana.AccountMeta `text:"linear,notype"`
	Mint       *solana.AccountMeta `text:"linear,notype"`
	Owner      *solana.AccountMeta `text:"linear,notype"`
	RentSysvar *solana.AccountMeta `text:"linear,notype"`
}

type InitializeMint

type InitializeMint struct {
	Accounts *InitializeMintAccounts
}

type InitializeMintAccounts

type InitializeMintAccounts struct {
}

type InitializeMultisig

type InitializeMultisig struct {
	Accounts *InitializeMultisigAccounts
}

type InitializeMultisigAccounts

type InitializeMultisigAccounts struct {
}

type Instruction

type Instruction struct {
	bin.BaseVariant
}

func DecodeInstruction

func DecodeInstruction(accounts []*solana.AccountMeta, data []byte) (*Instruction, error)

func (*Instruction) MarshalWithEncoder added in v0.4.0

func (i *Instruction) MarshalWithEncoder(encoder *bin.Encoder) error

func (*Instruction) TextEncode

func (i *Instruction) TextEncode(encoder *text.Encoder, option *text.Option) error

func (*Instruction) UnmarshalWithDecoder added in v0.4.0

func (i *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type Mint

type Mint struct {
	MintAuthorityOption   uint32
	MintAuthority         solana.PublicKey
	Supply                bin.Uint64
	Decimals              uint8
	IsInitialized         bool
	FreezeAuthorityOption uint32
	FreezeAuthority       solana.PublicKey
}

func FetchMints

func FetchMints(ctx context.Context, rpcCli *rpc.Client) (out []*Mint, err error)

func (*Mint) Decode

func (m *Mint) Decode(in []byte) error

type MintMeta

type MintMeta struct {
	TokenSymbol string
	MintAddress solana.PublicKey
	TokenName   string
	IconURL     string `json:"icon"`
}

type MintTo

type MintTo struct {
	Accounts *MintToAccounts
}

type MintToAccounts

type MintToAccounts struct {
}

type MintToChecked

type MintToChecked struct {
	Accounts *MintToCheckedAccounts
}

type MintToCheckedAccounts

type MintToCheckedAccounts struct {
}

type Multisig

type Multisig struct {
	M             byte
	N             byte
	IsInitialized bool
	Signers       [11]solana.PublicKey
}

type Revoke

type Revoke struct {
	Accounts *RevokeAccounts
}

type RevokeAccounts

type RevokeAccounts struct {
}

type SetAuthority

type SetAuthority struct {
	Accounts *SetAuthorityAccounts
}

type SetAuthorityAccounts

type SetAuthorityAccounts struct {
}

type ThawAccount

type ThawAccount struct {
	Accounts *ThawAccountAccounts
}

type ThawAccountAccounts

type ThawAccountAccounts struct {
}

type Token

type Token struct {
	ProgramID string
	Mint      string
}

func New

func New(programID string, mint string) *Token

type Transfer

type Transfer struct {
	Accounts *TransferAccounts
}

type TransferAccounts

type TransferAccounts struct {
}

type TransferChecked

type TransferChecked struct {
	Accounts *TransferCheckedAccounts
}

type TransferCheckedAccounts

type TransferCheckedAccounts struct {
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL