types

package
v0.0.0-...-c21ee82 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: GPL-3.0 Imports: 16 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 AllApprovedBookHint = hint.MustNewHint("mitum-nft-all-approved-book-v0.0.1")
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 MaxAllApproved = 10
View Source
var MaxCreators = 10
View Source
var MaxNFTHashLength = 1024
View Source
var MaxNFTIndex uint64 = 10000
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 NFTHint = hint.MustNewHint("mitum-nft-nft-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 AllApprovedBook

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

func NewAllApprovedBook

func NewAllApprovedBook(allApproved []mitumbase.Address) AllApprovedBook

func (AllApprovedBook) AllApproved

func (ob AllApprovedBook) AllApproved() []mitumbase.Address

func (*AllApprovedBook) Append

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

func (AllApprovedBook) Bytes

func (ob AllApprovedBook) Bytes() []byte

func (*AllApprovedBook) DecodeBSON

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

func (*AllApprovedBook) DecodeJSON

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

func (AllApprovedBook) Equal

func (ob AllApprovedBook) Equal(b AllApprovedBook) bool

func (AllApprovedBook) Exists

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

func (AllApprovedBook) GenerateHash

func (ob AllApprovedBook) GenerateHash() util.Hash

func (AllApprovedBook) Get

func (AllApprovedBook) Hash

func (ob AllApprovedBook) Hash() util.Hash

func (AllApprovedBook) IsEmpty

func (ob AllApprovedBook) IsEmpty() bool

func (AllApprovedBook) IsValid

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

func (AllApprovedBook) MarshalBSON

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

func (AllApprovedBook) MarshalJSON

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

func (*AllApprovedBook) Remove

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

func (*AllApprovedBook) Sort

func (ob *AllApprovedBook) Sort(ascending bool)

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(contract 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:"minter_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:"minter_whitelist"`
}

type Design

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

func NewDesign

func NewDesign(contract 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) Contract

func (de Design) Contract() mitumbase.Address

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) Policy

func (de Design) Policy() BasePolicy

type DesignBSONUnmarshaler

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

type DesignJSONMarshaler

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

type DesignJSONUnmarshaler

type DesignJSONUnmarshaler struct {
	Hint     hint.Hint       `json:"_hint"`
	Contract string          `json:"contract"`
	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:"nft_idx"`
	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 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:"nft_idx"`
	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:"nft_idx"`
	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 OperatorsBookBSONUnmarshaler

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

type OperatorsBookJSONMarshaler

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

type OperatorsBookJSONUnmarshaler

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

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:"minter_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) Address

func (sgn Signer) Address() 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(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 (sgns 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

type SignersBSONUnmarshaler

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

type SignersJSONMarshaler

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

type SignersJSONUnmarshaler

type SignersJSONUnmarshaler struct {
	Hint    hint.Hint       `json:"_hint"`
	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