state

package
v2.0.0-...-b904e79 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NilKey = iota
	CollectionKey
	OperatorsKey
	LastIDXKey
	NFTBoxKey
	NFTKey
)

Variables

View Source
var (
	NFTPrefix                = "nft"
	StateKeyCollectionSuffix = "collection"
	StateKeyOperatorsSuffix  = "operators"
	StateKeyLastNFTIDXSuffix = "lastnftidx"
	StateKeyNFTBoxSuffix     = "nftbox"
	StateKeyNFTSuffix        = "nft"
)
View Source
var CollectionStateValueHint = hint.MustNewHint("collection-state-value-v0.0.1")
View Source
var LastNFTIndexStateValueHint = hint.MustNewHint("collection-last-nft-index-state-value-v0.0.1")
View Source
var NFTBoxStateValueHint = hint.MustNewHint("nft-box-state-value-v0.0.1")
View Source
var (
	NFTStateValueHint = hint.MustNewHint("nft-state-value-v0.0.1")
)
View Source
var OperatorsBookStateValueHint = hint.MustNewHint("operators-book-state-value-v0.0.1")

Functions

func NFTStateKey

func NFTStateKey(
	contract mitumbase.Address,
	keyType StateKey,
) string

func StateCollectionValue

func StateCollectionValue(st mitumbase.State) (*types.Design, error)

func StateKeyNFT

func StateKeyNFT(contract mitumbase.Address, id uint64) string

func StateKeyNFTPrefix

func StateKeyNFTPrefix(addr mitumbase.Address) string

func StateKeyOperators

func StateKeyOperators(contract mitumbase.Address, addr mitumbase.Address) string

func StateLastNFTIndexValue

func StateLastNFTIndexValue(st mitumbase.State) (uint64, error)

func StateNFTBoxValue

func StateNFTBoxValue(st mitumbase.State) (types.NFTBox, error)

func StateNFTValue

func StateNFTValue(st mitumbase.State) (*types.NFT, error)

func StateOperatorsBookValue

func StateOperatorsBookValue(st mitumbase.State) (*types.OperatorsBook, error)

Types

type CollectionDesignStateValueJSONMarshaler

type CollectionDesignStateValueJSONMarshaler struct {
	hint.BaseHinter
	Design types.Design `json:"collectiondesign"`
}

type CollectionDesignStateValueJSONUnmarshaler

type CollectionDesignStateValueJSONUnmarshaler struct {
	Hint   hint.Hint       `json:"_hint"`
	Design json.RawMessage `json:"collectiondesign"`
}

type CollectionLastNFTIndexStateValueBSONUnmarshaler

type CollectionLastNFTIndexStateValueBSONUnmarshaler struct {
	Hint  string `bson:"_hint"`
	Index uint64 `bson:"index"`
}

type CollectionStateValue

type CollectionStateValue struct {
	hint.BaseHinter
	Design types.Design
}

func NewCollectionStateValue

func NewCollectionStateValue(design types.Design) CollectionStateValue

func (*CollectionStateValue) DecodeBSON

func (s *CollectionStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*CollectionStateValue) DecodeJSON

func (s *CollectionStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (CollectionStateValue) HashBytes

func (cs CollectionStateValue) HashBytes() []byte

func (CollectionStateValue) Hint

func (cs CollectionStateValue) Hint() hint.Hint

func (CollectionStateValue) IsValid

func (cs CollectionStateValue) IsValid([]byte) error

func (CollectionStateValue) MarshalBSON

func (s CollectionStateValue) MarshalBSON() ([]byte, error)

func (CollectionStateValue) MarshalJSON

func (s CollectionStateValue) MarshalJSON() ([]byte, error)

type CollectionStateValueBSONUnmarshaler

type CollectionStateValueBSONUnmarshaler struct {
	Hint   string   `bson:"_hint"`
	Design bson.Raw `bson:"collectiondesign"`
}

type LastNFTIndexStateValue

type LastNFTIndexStateValue struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewLastNFTIndexStateValue

func NewLastNFTIndexStateValue(id uint64) LastNFTIndexStateValue

func (*LastNFTIndexStateValue) DecodeBSON

func (s *LastNFTIndexStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*LastNFTIndexStateValue) DecodeJSON

func (s *LastNFTIndexStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (LastNFTIndexStateValue) HashBytes

func (is LastNFTIndexStateValue) HashBytes() []byte

func (LastNFTIndexStateValue) Hint

func (is LastNFTIndexStateValue) Hint() hint.Hint

func (LastNFTIndexStateValue) IsValid

func (is LastNFTIndexStateValue) IsValid([]byte) error

func (LastNFTIndexStateValue) MarshalBSON

func (s LastNFTIndexStateValue) MarshalBSON() ([]byte, error)

func (LastNFTIndexStateValue) MarshalJSON

func (s LastNFTIndexStateValue) MarshalJSON() ([]byte, error)

type LastNFTIndexStateValueJSONMarshaler

type LastNFTIndexStateValueJSONMarshaler struct {
	hint.BaseHinter
	Index uint64 `json:"index"`
}

type LastNFTIndexStateValueJSONUnmarshaler

type LastNFTIndexStateValueJSONUnmarshaler struct {
	Hint  hint.Hint `json:"_hint"`
	Index uint64    `json:"index"`
}

type NFTBoxStateValue

type NFTBoxStateValue struct {
	hint.BaseHinter
	Box types.NFTBox
}

func NewNFTBoxStateValue

func NewNFTBoxStateValue(box types.NFTBox) NFTBoxStateValue

func (*NFTBoxStateValue) DecodeBSON

func (s *NFTBoxStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*NFTBoxStateValue) DecodeJSON

func (s *NFTBoxStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (NFTBoxStateValue) HashBytes

func (nb NFTBoxStateValue) HashBytes() []byte

func (NFTBoxStateValue) Hint

func (nb NFTBoxStateValue) Hint() hint.Hint

func (NFTBoxStateValue) IsValid

func (nb NFTBoxStateValue) IsValid([]byte) error

func (NFTBoxStateValue) MarshalBSON

func (s NFTBoxStateValue) MarshalBSON() ([]byte, error)

func (NFTBoxStateValue) MarshalJSON

func (s NFTBoxStateValue) MarshalJSON() ([]byte, error)

type NFTBoxStateValueBSONUnmarshaler

type NFTBoxStateValueBSONUnmarshaler struct {
	Hint string   `bson:"_hint"`
	Box  bson.Raw `bson:"nftbox"`
}

type NFTBoxStateValueJSONMarshaler

type NFTBoxStateValueJSONMarshaler struct {
	hint.BaseHinter
	Box types.NFTBox `json:"nftbox"`
}

type NFTBoxStateValueJSONUnmarshaler

type NFTBoxStateValueJSONUnmarshaler struct {
	Hint hint.Hint       `json:"_hint"`
	Box  json.RawMessage `json:"nftbox"`
}

type NFTStateValue

type NFTStateValue struct {
	hint.BaseHinter
	NFT types.NFT
}

func NewNFTStateValue

func NewNFTStateValue(n types.NFT) NFTStateValue

func (*NFTStateValue) DecodeBSON

func (s *NFTStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*NFTStateValue) DecodeJSON

func (s *NFTStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (NFTStateValue) HashBytes

func (ns NFTStateValue) HashBytes() []byte

func (NFTStateValue) Hint

func (ns NFTStateValue) Hint() hint.Hint

func (NFTStateValue) IsValid

func (ns NFTStateValue) IsValid([]byte) error

func (NFTStateValue) MarshalBSON

func (s NFTStateValue) MarshalBSON() ([]byte, error)

func (NFTStateValue) MarshalJSON

func (s NFTStateValue) MarshalJSON() ([]byte, error)

type NFTStateValueBSONUnmarshaler

type NFTStateValueBSONUnmarshaler struct {
	Hint string   `bson:"_hint"`
	NFT  bson.Raw `bson:"nft"`
}

type NFTStateValueJSONMarshaler

type NFTStateValueJSONMarshaler struct {
	hint.BaseHinter
	NFT types.NFT `json:"nft"`
}

type NFTStateValueJSONUnmarshaler

type NFTStateValueJSONUnmarshaler struct {
	Hint hint.Hint       `json:"_hint"`
	NFT  json.RawMessage `json:"nft"`
}

type OperatorsBookStateValue

type OperatorsBookStateValue struct {
	hint.BaseHinter
	Operators types.OperatorsBook
}

func NewOperatorsBookStateValue

func NewOperatorsBookStateValue(operators types.OperatorsBook) OperatorsBookStateValue

func (*OperatorsBookStateValue) DecodeBSON

func (s *OperatorsBookStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*OperatorsBookStateValue) DecodeJSON

func (s *OperatorsBookStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (OperatorsBookStateValue) HashBytes

func (ob OperatorsBookStateValue) HashBytes() []byte

func (OperatorsBookStateValue) Hint

func (ob OperatorsBookStateValue) Hint() hint.Hint

func (OperatorsBookStateValue) IsValid

func (ob OperatorsBookStateValue) IsValid([]byte) error

func (OperatorsBookStateValue) MarshalBSON

func (s OperatorsBookStateValue) MarshalBSON() ([]byte, error)

func (OperatorsBookStateValue) MarshalJSON

func (s OperatorsBookStateValue) MarshalJSON() ([]byte, error)

type OperatorsBookStateValueBSONUnmarshaler

type OperatorsBookStateValueBSONUnmarshaler struct {
	Hint      string   `bson:"_hint"`
	Operators bson.Raw `bson:"operatorsbook"`
}

type OperatorsBookStateValueJSONMarshaler

type OperatorsBookStateValueJSONMarshaler struct {
	hint.BaseHinter
	Operators types.OperatorsBook `json:"operatorsbook"`
}

type OperatorsBookStateValueJSONUnmarshaler

type OperatorsBookStateValueJSONUnmarshaler struct {
	Hint      hint.Hint       `json:"_hint"`
	Operators json.RawMessage `json:"operatorsbook"`
}

type StateKey

type StateKey int

func ParseNFTStateKey

func ParseNFTStateKey(key string) (StateKey, error)

Jump to

Keyboard shortcuts

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