types

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MinLengthCollectionName = 3
	MaxLengthCollectionName = 30
	ReValidCollectionName   = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9\s]+$`)
)
View Source
var (
	MaxTotalShare uint = 100
	MaxSigners         = 10
)
View Source
var CollectionDesignHint = hint.MustNewHint("mitum-nft-collection-design-v0.0.1")
View Source
var CollectionPolicyHint = hint.MustNewHint("mitum-nft-collection-policy-v0.0.1")
View Source
var DesignHint = hint.MustNewHint("mitum-nft-design-v0.0.1")
View Source
var MaxCreators = 10
View Source
var MaxNFTHashLength = 1024
View Source
var MaxNFTIndex uint64 = 10000
View Source
var MaxOperators = 10
View Source
var MaxPaymentParameter uint = 99
View Source
var MaxSignerShare uint = 100
View Source
var MaxURILength = 1000
View Source
var MaxWhitelist = 10
View Source
var NFTBoxHint = hint.MustNewHint("mitum-nft-nft-box-v0.0.1")
View Source
var NFTHint = hint.MustNewHint("mitum-nft-nft-v0.0.1")
View Source
var OperatorsBookHint = hint.MustNewHint("mitum-nft-operator-book-v0.0.1")
View Source
var SignerHint = hint.MustNewHint("mitum-nft-signer-v0.0.1")
View Source
var SignersHint = hint.MustNewHint("mitum-nft-signers-v0.0.1")

Functions

This section is empty.

Types

type BasePolicy

type BasePolicy interface {
	util.IsValider
	Bytes() []byte
	Addresses() ([]mitumbase.Address, error)
	Equal(c BasePolicy) bool
}

type CollectionDesign

type CollectionDesign struct {
	Design
}

func NewCollectionDesign

func NewCollectionDesign(parent mitumbase.Address, creator mitumbase.Address, active bool, policy CollectionPolicy) CollectionDesign

type CollectionName

type CollectionName string

func (CollectionName) Bytes

func (cn CollectionName) Bytes() []byte

func (CollectionName) IsValid

func (cn CollectionName) IsValid([]byte) error

func (CollectionName) String

func (cn CollectionName) String() string

type CollectionPolicy

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

func NewCollectionPolicy

func NewCollectionPolicy(name CollectionName, royalty PaymentParameter, uri URI, whitelist []mitumbase.Address) CollectionPolicy

func (CollectionPolicy) Addresses

func (policy CollectionPolicy) Addresses() ([]mitumbase.Address, error)

func (CollectionPolicy) Bytes

func (policy CollectionPolicy) Bytes() []byte

func (*CollectionPolicy) DecodeBSON

func (policy *CollectionPolicy) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*CollectionPolicy) DecodeJSON

func (policy *CollectionPolicy) DecodeJSON(b []byte, enc encoder.Encoder) error

func (CollectionPolicy) Equal

func (policy CollectionPolicy) Equal(c BasePolicy) bool

func (CollectionPolicy) IsValid

func (policy CollectionPolicy) IsValid([]byte) error

func (CollectionPolicy) MarshalBSON

func (policy CollectionPolicy) MarshalBSON() ([]byte, error)

func (CollectionPolicy) MarshalJSON

func (policy CollectionPolicy) MarshalJSON() ([]byte, error)

func (CollectionPolicy) Name

func (policy CollectionPolicy) Name() CollectionName

func (CollectionPolicy) Royalty

func (policy CollectionPolicy) Royalty() PaymentParameter

func (CollectionPolicy) URI

func (policy CollectionPolicy) URI() URI

func (CollectionPolicy) Whitelist

func (policy CollectionPolicy) Whitelist() []mitumbase.Address

type CollectionPolicyJSONMarshaler

type CollectionPolicyJSONMarshaler struct {
	hint.BaseHinter
	Name      CollectionName   `json:"name"`
	Royalty   PaymentParameter `json:"royalty"`
	URI       URI              `json:"uri"`
	Whitelist []base.Address   `json:"whitelist"`
}

type CollectionPolicyJSONUnmarshaler

type CollectionPolicyJSONUnmarshaler struct {
	Hint      hint.Hint `json:"_hint"`
	Name      string    `json:"name"`
	Royalty   uint      `json:"royalty"`
	URI       string    `json:"uri"`
	Whitelist []string  `json:"whitelist"`
}

type Design

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

func NewDesign

func NewDesign(parent mitumbase.Address, creator mitumbase.Address, active bool, policy BasePolicy) Design

func (Design) Active

func (de Design) Active() bool

func (Design) Addresses

func (de Design) Addresses() ([]mitumbase.Address, error)

func (Design) Bytes

func (de Design) Bytes() []byte

func (Design) Creator

func (de Design) Creator() mitumbase.Address

func (*Design) DecodeBSON

func (de *Design) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*Design) DecodeJSON

func (de *Design) DecodeJSON(b []byte, enc encoder.Encoder) error

func (Design) Equal

func (de Design) Equal(cd Design) bool

func (Design) GenerateHash

func (de Design) GenerateHash() util.Hash

func (Design) Hash

func (de Design) Hash() util.Hash

func (Design) IsValid

func (de Design) IsValid([]byte) error

func (Design) MarshalBSON

func (de Design) MarshalBSON() ([]byte, error)

func (Design) MarshalJSON

func (de Design) MarshalJSON() ([]byte, error)

func (Design) Parent

func (de Design) Parent() mitumbase.Address

func (Design) Policy

func (de Design) Policy() BasePolicy

type DesignBSONUnmarshaler

type DesignBSONUnmarshaler struct {
	Hint    string   `bson:"_hint"`
	Parent  string   `bson:"parent"`
	Creator string   `bson:"creator"`
	Active  bool     `bson:"active"`
	Policy  bson.Raw `bson:"policy"`
}

type DesignJSONMarshaler

type DesignJSONMarshaler struct {
	hint.BaseHinter
	Parent  mitumbase.Address `json:"parent"`
	Creator mitumbase.Address `json:"creator"`
	Active  bool              `json:"active"`
	Policy  BasePolicy        `json:"policy"`
}

type DesignJSONUnmarshaler

type DesignJSONUnmarshaler struct {
	Hint    hint.Hint       `json:"_hint"`
	Parent  string          `json:"parent"`
	Creator string          `json:"creator"`
	Active  bool            `json:"active"`
	Policy  json.RawMessage `json:"policy"`
}

type NFT

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

func NewNFT

func NewNFT(
	id uint64,
	active bool,
	owner base.Address,
	hash NFTHash,
	uri URI,
	approved base.Address,
	creators Signers,
) NFT

func (NFT) Active

func (n NFT) Active() bool

func (NFT) Addresses

func (n NFT) Addresses() []base.Address

func (NFT) Approved

func (n NFT) Approved() base.Address

func (NFT) Bytes

func (n NFT) Bytes() []byte

func (NFT) Creators

func (n NFT) Creators() Signers

func (*NFT) DecodeBSON

func (n *NFT) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*NFT) DecodeJSON

func (n *NFT) DecodeJSON(b []byte, enc encoder.Encoder) error

func (NFT) Equal

func (n NFT) Equal(cn NFT) bool

func (NFT) ExistsApproved

func (n NFT) ExistsApproved() bool

func (NFT) ID

func (n NFT) ID() uint64

func (NFT) IsValid

func (n NFT) IsValid([]byte) error

func (NFT) MarshalBSON

func (n NFT) MarshalBSON() ([]byte, error)

func (NFT) MarshalJSON

func (n NFT) MarshalJSON() ([]byte, error)

func (NFT) NFTHash

func (n NFT) NFTHash() NFTHash

func (NFT) Owner

func (n NFT) Owner() base.Address

func (NFT) URI

func (n NFT) URI() URI

type NFTBSONUnmarshaler

type NFTBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	ID       uint64   `bson:"id"`
	Active   bool     `bson:"active"`
	Owner    string   `bson:"owner"`
	Hash     string   `bson:"hash"`
	URI      string   `bson:"uri"`
	Approved string   `bson:"approved"`
	Creators bson.Raw `bson:"creators"`
}

type NFTBox

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

func NewNFTBox

func NewNFTBox(nfts []uint64) NFTBox

func (*NFTBox) Append

func (nbx *NFTBox) Append(n uint64) error

func (NFTBox) Bytes

func (nbx NFTBox) Bytes() []byte

func (*NFTBox) DecodeBSON

func (nbx *NFTBox) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*NFTBox) DecodeJSON

func (nbx *NFTBox) DecodeJSON(b []byte, enc encoder.Encoder) error

func (NFTBox) Equal

func (nbx NFTBox) Equal(b NFTBox) bool

func (NFTBox) Exists

func (nbx NFTBox) Exists(id uint64) bool

func (NFTBox) GenerateHash

func (nbx NFTBox) GenerateHash() util.Hash

func (NFTBox) Hash

func (nbx NFTBox) Hash() util.Hash

func (NFTBox) Hint

func (nbx NFTBox) Hint() hint.Hint

func (NFTBox) IsEmpty

func (nbx NFTBox) IsEmpty() bool

func (NFTBox) IsValid

func (nbx NFTBox) IsValid([]byte) error

func (NFTBox) MarshalBSON

func (nbx NFTBox) MarshalBSON() ([]byte, error)

func (NFTBox) MarshalJSON

func (nbx NFTBox) MarshalJSON() ([]byte, error)

func (NFTBox) NFTs

func (nbx NFTBox) NFTs() []uint64

func (*NFTBox) Remove

func (nbx *NFTBox) Remove(n uint64) error

func (*NFTBox) Sort

func (nbx *NFTBox) Sort(ascending bool)

type NFTBoxBSONUnmarshaler

type NFTBoxBSONUnmarshaler struct {
	Hint string   `bson:"_hint"`
	NFTs []uint64 `bson:"nfts"`
}

type NFTBoxJSONMarshaler

type NFTBoxJSONMarshaler struct {
	hint.BaseHinter
	NFTs []uint64 `json:"nfts"`
}

type NFTBoxJSONUnmarshaler

type NFTBoxJSONUnmarshaler struct {
	Hint hint.Hint `json:"_hint"`
	NFTs []uint64  `json:"nfts"`
}

type NFTHash

type NFTHash string

func (NFTHash) Bytes

func (hs NFTHash) Bytes() []byte

func (NFTHash) IsValid

func (hs NFTHash) IsValid([]byte) error

func (NFTHash) String

func (hs NFTHash) String() string

type NFTJSONMarshaler

type NFTJSONMarshaler struct {
	hint.BaseHinter
	ID       uint64       `json:"id"`
	Active   bool         `json:"active"`
	Owner    base.Address `json:"owner"`
	Hash     NFTHash      `json:"hash"`
	URI      URI          `json:"uri"`
	Approved base.Address `json:"approved"`
	Creators Signers      `json:"creators"`
}

type NFTJSONUnmarshaler

type NFTJSONUnmarshaler struct {
	Hint     hint.Hint       `json:"_hint"`
	ID       uint64          `json:"id"`
	Active   bool            `json:"active"`
	Owner    string          `json:"owner"`
	Hash     string          `json:"hash"`
	URI      string          `json:"uri"`
	Approved string          `json:"approved"`
	Creators json.RawMessage `json:"creators"`
}

type OperatorsBook

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

func NewOperatorsBook

func NewOperatorsBook(operators []mitumbase.Address) OperatorsBook

func (*OperatorsBook) Append

func (ob *OperatorsBook) Append(ag mitumbase.Address) error

func (OperatorsBook) Bytes

func (ob OperatorsBook) Bytes() []byte

func (*OperatorsBook) DecodeBSON

func (ob *OperatorsBook) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*OperatorsBook) DecodeJSON

func (ob *OperatorsBook) DecodeJSON(b []byte, enc encoder.Encoder) error

func (OperatorsBook) Equal

func (ob OperatorsBook) Equal(b OperatorsBook) bool

func (OperatorsBook) Exists

func (ob OperatorsBook) Exists(ag mitumbase.Address) bool

func (OperatorsBook) GenerateHash

func (ob OperatorsBook) GenerateHash() util.Hash

func (OperatorsBook) Get

func (OperatorsBook) Hash

func (ob OperatorsBook) Hash() util.Hash

func (OperatorsBook) IsEmpty

func (ob OperatorsBook) IsEmpty() bool

func (OperatorsBook) IsValid

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

func (OperatorsBook) MarshalBSON

func (ob OperatorsBook) MarshalBSON() ([]byte, error)

func (OperatorsBook) MarshalJSON

func (ob OperatorsBook) MarshalJSON() ([]byte, error)

func (OperatorsBook) Operators

func (ob OperatorsBook) Operators() []mitumbase.Address

func (*OperatorsBook) Remove

func (ob *OperatorsBook) Remove(ag mitumbase.Address) error

func (*OperatorsBook) Sort

func (ob *OperatorsBook) Sort(ascending bool)

type OperatorsBookBSONUnmarshaler

type OperatorsBookBSONUnmarshaler struct {
	Hint      string   `bson:"_hint"`
	Operators []string `bson:"operators"`
}

type OperatorsBookJSONMarshaler

type OperatorsBookJSONMarshaler struct {
	hint.BaseHinter
	Operators []base.Address `json:"operators"`
}

type OperatorsBookJSONUnmarshaler

type OperatorsBookJSONUnmarshaler struct {
	Hint      hint.Hint `json:"_hint"`
	Operators []string  `json:"operators"`
}

type PaymentParameter

type PaymentParameter uint

func (PaymentParameter) Bytes

func (pp PaymentParameter) Bytes() []byte

func (PaymentParameter) IsValid

func (pp PaymentParameter) IsValid([]byte) error

func (PaymentParameter) Uint

func (pp PaymentParameter) Uint() uint

type PolicyBSONUnmarshaler

type PolicyBSONUnmarshaler struct {
	Hint    string   `bson:"_hint"`
	Name    string   `bson:"name"`
	Royalty uint     `bson:"royalty"`
	URI     string   `bson:"uri"`
	Whites  []string `bson:"whitelist"`
}

type Signer

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

func NewSigner

func NewSigner(account base.Address, share uint, signed bool) Signer

func (Signer) Account

func (sgn Signer) Account() base.Address

func (Signer) Bytes

func (sgn Signer) Bytes() []byte

func (*Signer) DecodeBSON

func (sgn *Signer) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*Signer) DecodeJSON

func (sgn *Signer) DecodeJSON(b []byte, enc encoder.Encoder) error

func (Signer) Equal

func (sgn Signer) Equal(csigner Signer) bool

func (Signer) IsValid

func (sgn Signer) IsValid([]byte) error

func (Signer) MarshalBSON

func (sgn Signer) MarshalBSON() ([]byte, error)

func (Signer) MarshalJSON

func (sgn Signer) MarshalJSON() ([]byte, error)

func (Signer) Share

func (sgn Signer) Share() uint

func (Signer) Signed

func (sgn Signer) Signed() bool

type SignerBSONUnmarshaler

type SignerBSONUnmarshaler struct {
	Hint    string `bson:"_hint"`
	Account string `bson:"account"`
	Share   uint   `bson:"share"`
	Signed  bool   `bson:"signed"`
}

type SignerJSONMarshaler

type SignerJSONMarshaler struct {
	hint.BaseHinter
	Account base.Address `json:"account"`
	Share   uint         `json:"share"`
	Signed  bool         `json:"signed"`
}

type SignerJSONUnmarshaler

type SignerJSONUnmarshaler struct {
	Hint    hint.Hint `json:"_hint"`
	Account string    `json:"account"`
	Share   uint      `json:"share"`
	Signed  bool      `json:"signed"`
}

type Signers

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

func NewSigners

func NewSigners(total uint, signers []Signer) Signers

func (Signers) Addresses

func (sgns Signers) Addresses() []base.Address

func (Signers) Bytes

func (sgns Signers) Bytes() []byte

func (*Signers) DecodeBSON

func (sgns *Signers) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*Signers) DecodeJSON

func (sgns *Signers) DecodeJSON(b []byte, enc encoder.Encoder) error

func (Signers) Equal

func (xs Signers) Equal(ys Signers) bool

func (Signers) Exists

func (sgns Signers) Exists(signer Signer) bool

func (Signers) Index

func (sgns Signers) Index(signer Signer) int

func (Signers) IndexByAddress

func (sgns Signers) IndexByAddress(address base.Address) int

func (Signers) IsSigned

func (sgns Signers) IsSigned(sgn Signer) bool

func (Signers) IsSignedByAddress

func (sgns Signers) IsSignedByAddress(address base.Address) bool

func (Signers) IsValid

func (sgns Signers) IsValid([]byte) error

func (Signers) MarshalBSON

func (sgns Signers) MarshalBSON() ([]byte, error)

func (Signers) MarshalJSON

func (sgns Signers) MarshalJSON() ([]byte, error)

func (*Signers) SetSigner

func (sgns *Signers) SetSigner(sgn Signer) error

func (Signers) Signers

func (sgns Signers) Signers() []Signer

func (Signers) Total

func (sgns Signers) Total() uint

type SignersBSONUnmarshaler

type SignersBSONUnmarshaler struct {
	Hint    string   `bson:"_hint"`
	Total   uint     `bson:"total"`
	Signers bson.Raw `bson:"signers"`
}

type SignersJSONMarshaler

type SignersJSONMarshaler struct {
	hint.BaseHinter
	Total   uint     `json:"total"`
	Signers []Signer `json:"signers"`
}

type SignersJSONUnmarshaler

type SignersJSONUnmarshaler struct {
	Hint    hint.Hint       `json:"_hint"`
	Total   uint            `json:"total"`
	Signers json.RawMessage `json:"signers"`
}

type URI

type URI string

func (URI) Bytes

func (uri URI) Bytes() []byte

func (URI) IsValid

func (uri URI) IsValid([]byte) error

func (URI) String

func (uri URI) String() string

Jump to

Keyboard shortcuts

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