v2

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "onft"
)

Variables

View Source
var (
	PrefixONFT        = []byte{0x01}
	PrefixOwners      = []byte{0x02}
	PrefixCollection  = []byte{0x03}
	PrefixDenom       = []byte{0x04}
	PrefixDenomSymbol = []byte{0x05}
	PrefixCreator     = []byte{0x06}
)
View Source
var ParamsKey = []byte{0x07}

Functions

func KeyCollection

func KeyCollection(denomID string) []byte

func KeyDenomCreator

func KeyDenomCreator(address sdk.AccAddress, denomId string) []byte

func KeyDenomID

func KeyDenomID(id string) []byte

func KeyDenomSymbol

func KeyDenomSymbol(symbol string) []byte

func KeyONFT

func KeyONFT(denomID, onftID string) []byte

func KeyOwner

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

func Migrate

func Migrate(
	ctx sdk.Context,
	storeKey storetypes.StoreKey,
	legacySubspace exported.Subspace,
	cdc codec.BinaryCodec,
	nftKeeper NFTKeeper,
) error

func MigrateCollections

func MigrateCollections(ctx sdk.Context,
	storeKey storetypes.StoreKey,
	logger log.Logger,
	k keeper,
) error

MigrateCollections is used to migrate nft data from onft to x/nft

func MigrateParams

func MigrateParams(
	ctx sdk.Context,
	legacySubspace exported.Subspace,
	k keeper,
) error

MigrateParams migrates the onft module state from the consensus version 1 to version 2. Specifically, it takes the parameters that are currently stored and managed by the x/params modules and stores them directly into the onft module state.

func SplitKeyDenom

func SplitKeyDenom(key []byte) (denomID, nftID string, err error)

func SplitKeyOwner

func SplitKeyOwner(key []byte) (address sdk.AccAddress, denom, id string, err error)

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 NFTKeeper

type NFTKeeper interface {
	SaveDenom(
		ctx sdk.Context,
		id,
		symbol,
		name,
		schema string,
		creator sdk.AccAddress,
		description,
		previewUri string,
		uri,
		uriHash,
		data string,
	) error
}

NFTKeeper save the denom of class

Jump to

Keyboard shortcuts

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