nft

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

基于wasm包装层的简单NFT合约示例

Index

Constants

View Source
const (
	// 默认Object中的字段
	NFTNameKey        = "name"         // NFT名称
	NFTSymbolKey      = "symbol"       // NFT符号
	NFTTotalSupplyKey = "total_supply" // 总供应量
	NFTTokenURIKey    = "token_uri"    // Token URI
	NFTTokenIDKey     = "token_id"     // Token ID
	NFTTokenOwnerKey  = "owner"        // Token所有者
)

常量定义 - 对象中的字段名

Variables

This section is empty.

Functions

func Burn

func Burn(ctx core.Context, tokenId core.ObjectID) bool

销毁NFT

func GetNFTInfo

func GetNFTInfo(ctx core.Context) (string, string, uint64)

获取NFT信息

func GetOwner

func GetOwner(ctx core.Context) core.Address

获取所有者

func InitializeNFT

func InitializeNFT(ctx core.Context, name string, symbol string) core.ObjectID

初始化NFT合约

func Mint

func Mint(ctx core.Context, to core.Address, tokenURI string) (uint64, bool)

铸造新NFT(仅限所有者)

func OwnerOf

func OwnerOf(ctx core.Context, tokenId core.ObjectID) core.Address

获取NFT所有者

func TokenURI

func TokenURI(ctx core.Context, tokenId core.ObjectID) string

获取NFT URI

func Transfer

func Transfer(ctx core.Context, from core.Address, to core.Address, tokenId core.ObjectID) bool

转移NFT

Types

This section is empty.

Jump to

Keyboard shortcuts

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