tep64

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedContentType = errors.New("unsupported content type")
)

Functions

This section is empty.

Types

type ContentLayout

type ContentLayout int
const (
	Undefined ContentLayout = iota
	OffChain
	OnChain
	SemiChain
)

type FullContent

type FullContent struct {
	Layout ContentLayout
	Data   []byte
	// OnchainMetadata contains a decoded metadata when the layout is onchain.
	OnchainMetadata *Metadata
	// OffchainURL contains a link to JSON when the layout is offchain.
	OffchainURL string
}

FullContent is either a link to metadata or metadata itself depending on the layout.

func DecodeFullContent

func DecodeFullContent(content tlb.FullContent) (FullContent, error)

func DecodeFullContentFromCell added in v1.1.0

func DecodeFullContentFromCell(cell *boc.Cell) (FullContent, error)

type Metadata

type Metadata struct {
	// Uri points to JSON document with metadata. Used by SemiChain layout. ASCII string.
	Uri         string `json:"uri,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Image       string `json:"image,omitempty"`
	ImageData   []byte `json:"image_data,omitempty"`
	Symbol      string `json:"symbol,omitempty"`
	Decimals    string `json:"decimals,omitempty"`
	RenderType  string `json:"render_type,omitempty"`
	AmountStyle string `json:"amount_style,omitempty"`
}

func ConvertOnchainData added in v1.0.14

func ConvertOnchainData(content tlb.FullContent) (Metadata, error)

TEP-64 Token Data Standard https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md

func (*Metadata) Merge added in v1.2.1

func (m *Metadata) Merge(other *Metadata)

Jump to

Keyboard shortcuts

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