degendata

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Metadatas         = make(map[common.Address]map[int64]Metadata, 0)
	ErrNoMetadataFile = errors.New("no metadata file found")

	DegendataDir = "degendata"

	LoadedMetadata = make(map[common.Address]interface{}, 0)
)

Functions

func LoadMetadatas

func LoadMetadatas() error

func SortMapByValue

func SortMapByValue(m map[string]int64, reverse bool) []string

func WriteDataToFile

func WriteDataToFile(data interface{}, filePath string)

func ZstdCompress

func ZstdCompress(in io.Reader, out io.Writer) error

Types

type Metadata

type Metadata struct {
	Attributes      []MetadataAttribute `json:"-"`
	Name            string              `json:"name"`
	Description     string              `json:"description"`
	Image           string              `json:"image"`
	TokenID         int64               `json:"token_id"`
	ContractAddress common.Address      `json:"-"`
	Score           Score               `json:"score,omitempty"`
}

func ReadMetadataFromFile

func ReadMetadataFromFile(filePath string) ([]Metadata, error)

type MetadataAttribute

type MetadataAttribute struct {
	TraitType string `json:"-"`
	Name      string `json:"name"`
	Value     string `json:"value"`
}

type Score

type Score struct {
	TokenID       int64   `json:"token_id"`
	Rank          int64   `json:"rank"`
	Score         float64 `json:"score"`
	TokenFeatures struct {
		UniqueAttributeCount int `json:"unique_attribute_count"`
	} `json:"token_features"`
	TokenMetadata map[string]interface{} `json:"token_metadata"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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