For the complete documentation index, see llms.txt. This page is also available as Markdown.

5. Mint Assets

Register users

  • Before users can mint/collect assets and create projects on Zecrey, they must register as Zecrey users. Please follow this procedure.

Set Categories

  • Zecrey NFT Marketplace has set several default categories to divide the collections. When creating a collection, you must select between one of the categories.

Upload Media

  • Upload pictures

Example

package main

import (
   "fmt"
   "github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)


func main() {
    filePath := "/Users/alice/Documents/20221112-142909.jpg"
    result, err := sdk.UploadMedia(filePath)
    if err != nil { panic(err) }
    
    data, _ := json.Marshal(result)    
    fmt.Println(string(data))
}

Example result

{
    "public_id":"collection/tsgqu4cgj57wrxncllky", //unique Id of the picture
    "url":"https://res.cloudinary.com/zecrey/image/upload/v1668506730/collection/tsgqu4cgj57wrxncllky.jpg" //link of the picture
}

Example

Example result

Create a Collection

  • When minting an NFT, it will be identified in a collection to distinguish different styles or topics. Collections will be submitted to the L1 chain by Zecrey. All collections created through Zecrey will be searchable in the NFT Marketplace.

  • The transaction of creating a collection will be confirmed by Zecrey. Once Zecrey confirms this collection, it will be submitted to L1.

  • Parameters needed for creating a collection:

Parameter

Parameter usage and meaning

Required vs Optional

accountName

The account name used to initialize the client

✅

seed

The user's L2 seed used to initialize the client

✅

ShortName

Used to create and identify a collection; cannot be duplicated with other collections

✅

CategoryId

Used to create a collection

✅

CollectionUrl

The background image displayed for mobile users

ExternalLink

External link to the collection

TwitterLink

Twitter link to the collection

InstagramLink

Instagram link to the collection

TelegramLink

Telegram link to the collection

DiscordLink

Discord link of the collection

LogoImage

The logo image id of the collection

FeaturedImage

The feature image id of the collection

BannerImage

The Banner image id of the collection

Description

The description of the collection, and filling in "-" is recommended if there is no description

CreatorEarningRate

Creator royalities

✅

PaymentAssetIds

Asset types used to settle

📚SDK REFERENCE

Example

  • Create a collection with the ShortName "Alice's space"

    1. Initialize the client

    2. Create a collection

Example result

Example

  • Create a collection with the ShortName "Alice's space"

    1. Initialize the client

    2. Create a collection

With the private key:

With the wallet:

Example result

Mint NFT

  • Every account has a default collection ID. If the collection ID is not filled in, the NFT will be associated with the default collection ID = 0. Transaction of minting an NFT will be confirmed by Zecrey and once the NFT is confirmed, Zecrey will submit it to L1.

  • L2 allows the change of ownership for the NFT. However, the creator of the NFT will never change. Each time an NFT is transferred, the creator will receive a royalty, which is calculated by the NFT's TreasuryRate set by its creator.

📚SDK REFERENCE

  • Parameters needed for creating an NFT:

    Parameter

    Parameter usage and meaning

    Required or not

    accountName

    The account name used to initialize the client

    ✅

    seed

    The user's L2 seed used to initialize the client

    ✅

    NftUrl

    The logo image displayed for mobile users

    ✅

    Name

    NFT name

    ✅

    Description

    The description of the NFT, and filling in "-" is recommended if there is no description

    ✅

    assetProperty

    Custom properties

    ✅

    assetLevel

    Custom levels

    ✅

    assetStats

    Custom stats

    ✅

    TreasuryRate

    Creator royalties will be charged at this rate and the percentage will be in proportion to 10000 during NFT transactions. For example, filling in 50000 means the rate will be 5000/10000 % = 0.5%

    ✅

  • Create an NFT with the name "Alice's BestNft"

    1. Initialize the client

    2. Use json Marshal to transform the properties, levels and stats into string type

    3. Create an NFT

Example

Example result

Example

With the private key:

With the wallet:

Example result

Last updated

Was this helpful?