v2

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PrefixNFT        = []byte{0x01}
	PrefixOwners     = []byte{0x02} // key for a owner
	PrefixCollection = []byte{0x03} // key for balance of NFTs held by the denom
	PrefixDenom      = []byte{0x04} // key for denom of the nft
	PrefixDenomName  = []byte{0x05} // key for denom name of the nft

)

Functions

func KeyCollection

func KeyCollection(denomID string) []byte

KeyCollection gets the storeKey by the collection

func KeyDenom

func KeyDenom(id string) []byte

KeyDenom gets the storeKey by the denom id

func KeyDenomName

func KeyDenomName(name string) []byte

KeyDenomName gets the storeKey by the denom name

func KeyNFT

func KeyNFT(denomID, tokenID string) []byte

KeyNFT gets the key of nft stored by an denom and id

func KeyOwner

func KeyOwner(address sdk.AccAddress, denomID, tokenID string) []byte

KeyOwner gets the key of a collection owned by an account address

func Migrate

func Migrate(ctx sdk.Context,
	storeKey storetypes.StoreKey,
	cdc codec.Codec,
	logger log.Logger,
	saveDenom SaveDenom,
) error

Migrate is used to migrate nft data from furymod/nft to x/nft

func UnsafeBytesToStr

func UnsafeBytesToStr(b []byte) string

UnsafeBytesToStr is meant to make a zero allocation conversion from []byte -> string to speed up operations, it is not meant to be used generally, but for a specific pattern to delete keys from a map.

func UnsafeStrToBytes

func UnsafeStrToBytes(s string) []byte

UnsafeStrToBytes uses unsafe to convert string into byte array. Returned bytes must not be altered after this function is called as it will cause a segmentation fault.

Types

type SaveDenom

type SaveDenom func(ctx sdk.Context, id, name, schema,
	symbol string,
	creator sdk.AccAddress,
	mintRestricted,
	updateRestricted bool,
	description,
	uri,
	uriHash,
	data string,
) error

SaveDenom save the denom of class

Jump to

Keyboard shortcuts

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