nft

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MintAssetId     = "c94ac88f-4671-3976-b60a-09064f1811e8"
	MintMinimumCost = "0.001"
)
View Source
const (
	NMPrefix  = "NFO"
	NMVersion = 0x00
)

Variables

View Source
var (
	NMDefaultCollectionKey = uuid.Nil.Bytes()

	NMDefaultChain uuid.UUID
	NMDefaultClass []byte
)

Functions

func BuildMintNFO

func BuildMintNFO(collection string, token []byte, hash crypto.Hash) []byte

Types

type Collection

type Collection struct {
	Key         []byte
	Creator     string
	Circulation int
}

type MintWorker

type MintWorker struct {
	// contains filtered or unexported fields
}

func NewMintWorker

func NewMintWorker(grp *mtg.Group, store Store) *MintWorker

func (*MintWorker) ProcessOutput

func (mw *MintWorker) ProcessOutput(ctx context.Context, out *mtg.Output)

type NFOMemo

type NFOMemo struct {
	Prefix  string
	Version byte

	Mask       uint64
	Chain      uuid.UUID // 16 bytes
	Class      []byte    // 64 bytes contract address
	Collection uuid.UUID // 16 bytes
	Token      []byte    // 64 bytes hash of content

	Extra []byte
}

func DecodeNFOMemo

func DecodeNFOMemo(b []byte) (*NFOMemo, error)

func (*NFOMemo) Encode

func (nm *NFOMemo) Encode() []byte

func (*NFOMemo) Indexes

func (nm *NFOMemo) Indexes() []int

func (*NFOMemo) Mark

func (nm *NFOMemo) Mark(indexes []int)

func (*NFOMemo) WillMint

func (nm *NFOMemo) WillMint() bool

type Store

type Store interface {
	WriteMintToken(collection []byte, id []byte, user string) error
	ReadMintCollection(collection []byte) (*Collection, error)
	ReadMintToken(collection, token []byte) (*Token, error)
}

type Token

type Token struct {
	Collection []byte
	Key        []byte
}

Jump to

Keyboard shortcuts

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