tokenregistry

package
v0.0.0-...-e22020f Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2021 github.com/gagliardetto This file has been modified by github.com/gagliardetto

Copyright 2020 dfuse Platform Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const TOKEN_META_SIZE = 229

Variables

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

Functions

func AsciiString

func AsciiString(data []byte) string

func ProgramID

func ProgramID() solana.PublicKey

Types

type Instruction

type Instruction struct {
	bin.BaseVariant
}

func DecodeInstruction

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

func NewRegisterTokenInstruction

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

func (*Instruction) Accounts

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

func (*Instruction) Data

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

func (Instruction) MarshalWithEncoder

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

func (*Instruction) ProgramID

func (i *Instruction) ProgramID() solana.PublicKey

func (*Instruction) TextEncode

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

func (*Instruction) UnmarshalWithDecoder

func (i *Instruction) UnmarshalWithDecoder(decoder *bin.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 (i *RegisterToken) SetAccounts(accounts []*solana.AccountMeta) error

type RegisterTokenAccounts

type RegisterTokenAccounts struct {
	TokenMeta *solana.AccountMeta `text:"linear,notype"`
	Owner     *solana.AccountMeta `text:"linear,notype"`
	Token     *solana.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           *solana.PublicKey
	RegistrationAuthority *solana.PublicKey
	Name                  Name
	Website               Website
	Symbol                Symbol
}

func DecodeTokenMeta

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

func GetEntries

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

func GetTokenRegistryEntry

func GetTokenRegistryEntry(ctx context.Context, rpcCli *rpc.Client, mintAddress solana.PublicKey) (*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