model

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TransferTopicId = common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")
)

Functions

This section is empty.

Types

type CollectionMetadata

type CollectionMetadata struct {
	Name                 string                    `json:"name"`
	Symbol               string                    `json:"symbol"`
	SellerFeeBasisPoints int64                     `json:"seller_fee_basis_points"`
	Description          string                    `json:"description"`
	ExternalLink         string                    `json:"external_link"`
	Url                  string                    `json:"url"`
	Image                string                    `json:"image"`
	Background           string                    `json:"background"`
	Creators             []MetadataCreatorProperty `json:"creators"`
	IsMutable            bool                      `json:"is_mutable"`
	PrimarySaleHappened  bool                      `json:"primary_sale_happened"`
}

CollectionMetadata represents ERC1155 token standard collection metadata

type MetadataAttributeTraitType

type MetadataAttributeTraitType string
const (
	NumberTrait          MetadataAttributeTraitType = "number" // is default
	StringTrait          MetadataAttributeTraitType = "string"
	BoostPercentageTrait MetadataAttributeTraitType = "boost_percentage"
)

func (MetadataAttributeTraitType) String

func (matt MetadataAttributeTraitType) String() string

type MetadataCreatorProperty

type MetadataCreatorProperty struct {
	Address string `json:"address"`
	Share   string `json:"share"`
}

type MetadataDefaultProperty

type MetadataDefaultProperty struct {
	Name  string `json:"name"`
	Value any    `json:"value"`
}

type MetadataFileProperty

type MetadataFileProperty struct {
	Uri  string `json:"uri"`
	Type string `json:"type"`
}

type NFTCollectionResponse

type NFTCollectionResponse struct {
	NFTContractBaseMetadata
	*CollectionMetadata
	InterfaceID string `json:"interface_id"`
}

func (NFTCollectionResponse) String

func (c NFTCollectionResponse) String() string

type NFTContractBaseMetadata

type NFTContractBaseMetadata struct {
	Address   common.Address `json:"address"`
	Owner     common.Address `json:"owner"`
	IsERC721  bool           `json:"is_erc_721"`
	IsERC1155 bool           `json:"is_erc_1155"`
}

type NFTOwnershipResponse

type NFTOwnershipResponse struct {
	NFTContractBaseMetadata
	AssetsCount         int64                    `json:"assets_count"`
	CollectionsCount    int64                    `json:"collections_count"`
	AssetsPerCollection map[common.Address]int64 `json:"assets_per_collection"`
}

type TokenMetadata

type TokenMetadata struct {
	Symbol       string                     `json:"symbol"`
	Name         string                     `json:"name"`
	Description  string                     `json:"description"`
	Image        string                     `json:"image"`
	ImageData    string                     `json:"image_data"`
	Background   string                     `json:"background_color"`
	ExternalUrl  string                     `json:"external_url"`
	AnimationUrl string                     `json:"animation_url"`
	AudioUrl     string                     `json:"audio_url"`
	VideoUrl     string                     `json:"video_url"`
	YoutubeUrl   string                     `json:"youtube_url"`
	Attributes   []TokenMetadataAttribute   `json:"attributes"`
	Properties   []any                      `json:"properties"`
	Collection   TokenMetadataCollectionRef `json:"collection"`
}

TokenMetadata represents ERC1155/Metaplex token metadata standard with a bit of enhancements

func (TokenMetadata) Validate

func (t TokenMetadata) Validate() error

type TokenMetadataAttribute

type TokenMetadataAttribute struct {
	Value        string                     `json:"value"`
	MaxValue     string                     `json:"max_value"`
	DisplayValue string                     `json:"display_value"`
	TraitType    MetadataAttributeTraitType `json:"trait_type"`
	DisplayType  string                     `json:"display_type"`
}

TokenMetadataAttribute represents NFT Metadata rich attribute

type TokenMetadataCollectionRef

type TokenMetadataCollectionRef struct {
	Name   string `json:"name"`
	Family string `json:"family"`
}

TokenMetadataCollectionRef represents collection metadata reference

type TokenMetadataProperties

type TokenMetadataProperties[T TokenMetadataProperty] []any

type TokenMetadataProperty

type TokenMetadataProperty interface {
	MetadataDefaultProperty | MetadataCreatorProperty | MetadataFileProperty
}

TokenMetadataProperty defines generic type for metadata properties

Jump to

Keyboard shortcuts

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