degendata

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 18 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 ReadOSRawDataFiles added in v0.7.3

func ReadOSRawDataFiles(gb *gloomberg.Gloomberg, filePath string)

func ReadOpenSeaMetadataAndRanks added in v0.7.3

func ReadOpenSeaMetadataAndRanks(gb *gloomberg.Gloomberg, filePath string, slug string) 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 OpenSeaMetadata added in v0.7.3

type OpenSeaMetadata []struct {
	TokenIdentifier struct {
		ContractAddress string `json:"contract_address"`
		TokenID         int64  `json:"token_id"`
	} `json:"token_identifier"`
	MetadataDict  map[string]interface{} `json:"metadata_dict"`
	TokenStandard string                 `json:"token_standard"`
	Slug          string                 `json:"slug"`
}

type OpenSeaRanks added in v0.7.3

type OpenSeaRanks map[int]TokenRank

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"`
}

type TokenRank added in v0.7.3

type TokenRank struct {
	Rank  int64   `json:"rank"`
	Score float64 `json:"score"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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