utils

package
v1.3.1-0...-b23c8d6 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCadenceDictionary

func CreateCadenceDictionary(input map[string]string) (*cadence.Dictionary, error)

TODO: move to overflow?

func CreateSha3Hash

func CreateSha3Hash(input []uint64, types []string, salt string) string

Create a hash from the given ids and salt using '-' as the placeholder between salt an ids and , as the separator between ids

func CreateTraitCadenceDictionary

func CreateTraitCadenceDictionary(input map[string]string) (*cadence.Dictionary, error)

func CreateTraitListCadenceDictionary

func CreateTraitListCadenceDictionary(input map[uint64][]uint64) (cadence.Dictionary, error)

func GetNFTTraitListFromCsvInCadenceDictionary

func GetNFTTraitListFromCsvInCadenceDictionary(numberOfSlices, slice int) cadence.Dictionary

func RandomSalt

func RandomSalt() string

func ReadCsv

func ReadCsv(fileName string) (map[uint64]map[string]map[string]string, error)

func ReadCsvAsMapGroupOnKey

func ReadCsvAsMapGroupOnKey(input io.Reader, keyField string) (map[uint64]map[string]string, error)

/ Read a io.Reader as a map of id field to propertyBag

func ReadCsvAsMapGroupOnKeyFromFile

func ReadCsvAsMapGroupOnKeyFromFile(fileName string, keyField string) (map[uint64]map[string]string, error)

/ Read a filename.csv as a map of id field to propertyBag

func ReadMetadataCsvFileAsCadenceDict

func ReadMetadataCsvFileAsCadenceDict(filename, keyField string) (*cadence.Dictionary, error)

A Metadata csv field is a excel/csv file that has one field that should be key and the others should be values, this method will return a map of rowKey -> { columHeader : rowValue}

Types

type Trait

type Trait struct {
	DisplayType       string `json:"display_type"`
	Name              string `json:"name"`
	RarityDescription string `json:"rarity_description"`
	RarityMax         string `json:"rarity_max"`
	RarityScore       string `json:"rarity_score"`
	Value             string `json:"value"`
}

type TraitList

type TraitList struct {
	Background uint64 `json:"Background"`
	Clothes    uint64 `json:"Clothes"`
	Eyes       uint64 `json:"Eyes"`
	Head       uint64 `json:"Head"`
	Mouth      uint64 `json:"Mouth"`
	Skins      uint64 `json:"Skins"`
	Series     uint64 `json:"series"`
}

Jump to

Keyboard shortcuts

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