nft

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

A simple NFT contract example based on WASM wrapper

Index

Constants

View Source
const (
	// Fields in default Object
	NFTNameKey        = "name"         // NFT name
	NFTSymbolKey      = "symbol"       // NFT symbol
	NFTTotalSupplyKey = "total_supply" // Total supply
	NFTTokenURIKey    = "token_uri"    // Token URI
	NFTTokenIDKey     = "token_id"     // Token ID
	NFTTokenOwnerKey  = "owner"        // Token owner
)

Constants - Field names in objects

Variables

This section is empty.

Functions

func Burn

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

Burn NFT

func GetNFTInfo

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

Get NFT information

func GetOwner

func GetOwner(ctx core.Context) core.Address

Get contract owner

func InitializeNFT

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

Initialize NFT contract

func Mint

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

Mint new NFT (owner only)

func OwnerOf

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

Get NFT owner

func TokenURI

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

Get NFT URI

func Transfer

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

Transfer NFT

Types

This section is empty.

Jump to

Keyboard shortcuts

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