tokenmeta

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TOKEN_META_SIZE = 229

Variables

View Source
var InstructionDefVariant = encodbin.NewVariantDefinition(encodbin.Uint32TypeIDEncoding, []encodbin.VariantType{
	{"register_token", (*RegisterToken)(nil)},
})

Functions

func AsciiString

func AsciiString(data []byte) string

func ProgramID

func ProgramID() common.Address

Types

type Instruction

type Instruction struct {
	encodbin.BaseVariant
}

func NewRegisterTokenInstruction

func NewRegisterTokenInstruction(logo Logo, name Name, symbol Symbol, website Website, tokenMetaKey, ownerKey, tokenKey common.Address) *Instruction

func (*Instruction) Accounts

func (i *Instruction) Accounts() (out []*base.AccountMeta)

func (*Instruction) Data

func (i *Instruction) Data() ([]byte, error)

func (Instruction) MarshalWithEncoder

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

func (*Instruction) ProgramID

func (i *Instruction) ProgramID() common.Address

func (*Instruction) TextEncode

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

func (*Instruction) UnmarshalWithDecoder

func (i *Instruction) UnmarshalWithDecoder(decoder *encodbin.Decoder) (err error)
type Logo [64]byte

func LogoFromString

func LogoFromString(logo string) (Logo, error)

func (Logo) String

func (l Logo) String() string

type Name

type Name [32]byte

func NameFromString

func NameFromString(name string) (Name, error)

func (Name) String

func (n Name) String() string

type RegisterToken

type RegisterToken struct {
	Name     Name
	Website  Website
	Symbol   Symbol
	Accounts *RegisterTokenAccounts `bin:"-"`
}

func (*RegisterToken) SetAccounts

func (r *RegisterToken) SetAccounts(accounts []*base.AccountMeta) error

type RegisterTokenAccounts

type RegisterTokenAccounts struct {
	TokenMeta *base.AccountMeta `text:"linear,notype"`
	Owner     *base.AccountMeta `text:"linear,notype"`
	Token     *base.AccountMeta `text:"linear,notype"`
}

type Symbol

type Symbol [32]byte

func SymbolFromString

func SymbolFromString(symbol string) (Symbol, error)

func (Symbol) String

func (s Symbol) String() string

type TokenMeta

type TokenMeta struct {
	IsInitialized         bool
	Reg                   [3]byte `text:"-"`
	DataType              byte
	MintAddress           *common.Address
	RegistrationAuthority *common.Address
	Name                  Name
	Website               Website
	Symbol                Symbol
}

func DecodeTokenMeta

func DecodeTokenMeta(in []byte) (*TokenMeta, error)

type Website

type Website [32]byte

func WebsiteFromString

func WebsiteFromString(symbol string) (Website, error)

func (Website) String

func (s Website) String() string

Jump to

Keyboard shortcuts

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