In-game NFTs (ERC721)

Custom NFT Tokens generated in-game

In-Game NFTs are ERC721 tokens that offer transparency in minting and transactions. They enable games to create virtual assets without the pain of deploying a smart contract. Developers can easily create In-Game NFTs using ZooGames API and control them securely.

Use Cases

  1. Virtual Assets: Earn or purchase In-Game NFTs for in-game items, upgrades, or unlocking levels.

  2. In-Game Economy: engage in player-driven economies within the game.

  3. Reward System: Distribute NFTs as rewards for achievements, competitions, or milestones.

  4. Social Interaction: Gift or trade NFTs, foster community engagement.

  5. Airdrops and Promotions: Airdrop NFTs to players, attract new users or introduce special events.

  6. Limited Edition Collectibles: Create rare NFTs for trading and collecting.

You can choose to send In-Game NFTs to either the Mirror wallet or the Primary wallet of users. Sending NFTs to the Primary wallet allows users to trade them on our official NFT store, OPENZOO.IO. Once your NFT collection is registered, you can add them to Openzoo and claim transaction royalties.

Initiating In-Game NFTs Creation

To create an In-Game NFTs token using the ZooGames API, you can follow these steps:

  1. Send a request to the API endpoint, providing the desired Token name and symbol in the request payload.

  2. The API will process your request and generate a new In-Game NFTs token with the specified Token name and symbol.

  3. Upon successful creation, you will receive a response containing relevant information about the newly created token, such as its contract address and other necessary details.

  4. You can now incorporate this In-Game NFTs token into your game environment, allowing players to interact with and own unique virtual assets.

Initialize ERC721 before using the token

POST API_END_POINT_URL/API_KEY/erc721/create

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

name*

String

Name of this ERC721 Token

symbol*

String

Token Symbol

{
  success: true,
  data: {
    tokenAddress: '0xe3c4937ee22e1f2eb80d2d7a881e7777',
    createTxHash: '0x12345648945648784564687845647887',
    type:'erc721'
  }
}

You need to keep Token Address for the future usage

Batch Mint

This function empowers game developers to generate new NFT tokens on-demand, granting them flexibility and control over the in-game economy. You have the ability to mint NFTs in batches using an array.

Mint Tokens by batch

POST API_END_POINT_URL/API_KEY/erc721/batchMint

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

tokenAddress*

Address

Address of Token you have created or target Token to be minted

tokenIds*

Array of Number

Array of IDs to be minted ex:

[1,2,3,4,5] and must not be duplicated or ['0x00a'] as a hex number (Starting with 0x)

to*

String

The recipient primary address (tradable) or Mirror address (not tradable)

tokenJsons*

Array of Json Objects

Array of Json objects to be minted

ex:

[ {token_id: 1, name: 'NFT 1', description:'',image:'<url>'}, {token_id: 1, name: 'NFT 2', description:'',image:'<url>'} ]

{
  success: true,
  data: {
    tokenAddress: '0x3dD99feA434E323EAF274148712226eD2d549dA3',
    to: '0x6D2A8B3683293442fACa52e9B6537Faaad0AE576',
    tokenIds: [ 1, 2, 3 ],
    tokenUris: [
      'https://openzoo.mypinata.cloud/ipfs/QmbyNPqUeahZxxkpSiSvYS6Rpu2SRXtJLU5rumUFFaheDx',
      'https://openzoo.mypinata.cloud/ipfs/QmPhY2yrmDCVKMEkzQyA39JQ2zTuacNU3eWFQTrU54jHsx',
      'https://openzoo.mypinata.cloud/ipfs/QmTZkvvRzdocDxqCSjG7jKu35GzYk7ehA4wC7n5MNearWB'
    ],
    mintTxHash: '0x158364cab5489e8a85ce7683bcb58154f8b5ce0bf647ce2b6a2ccd190dd8d9f2'
  }
}

Please ensure that only unique TokenIDs are used when minting NFTs, or if you are using a running number system, make sure to use the latest TokenIDs to maintain uniqueness.

Batch Burn

This function enables game developers to remove existing NFT tokens from circulation, granting them control over the in-game economy and token supply. You can burn NFTs in batches using an array, effectively eliminating them from the system and ensuring their scarcity and value.

Burn Tokens by amount from ZooGamesID

POST API_END_POINT_URL/API_KEY/erc721/batchBurn

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

tokenAddress*

Address

Address of Token you have created or target Token to be burnt

tokenIds*

Array of Number

Array of IDs to be burnt ex:

[1,2,3]

{
  success: true,
  data: {
    tokenAddress: '0x3dD98feA434E323EAF274148712226eD2d549dA3',
    tokenIds: [ 1, 2 ],
    burnTxHash: '0x923b3c52bb17a6293d15e37c554824df0a26213abadedb274ff76cc2643ea502'
  }
}

Please ensure that each minted NFT has a unique token ID and avoids reusing any duplicate IDs, regardless of whether the ID has been previously burned. This will ensure the uniqueness and integrity of the NFTs within the system.

Total Mint count

The Total Mint Count API retrieves the total number of operations in your collection. By making a request to this API, you can obtain the count of NFTs operations that have been minted for a specific collection, providing valuable information about the size and scale of your collection.

Token Minted Counter operation (Not NFT supply)

POST API_END_POINT_URL/API_KEY/erc721/totalMintCount

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

tokenAddress*

Address

Address of Token you have created or target Token to be checked

{
  success: true,
  data: '3',
}

Get user In-Game NFTs

The Get In-Game NFTs API allows you to retrieve In-Game NFTs based on either the user's ZooGamesID or their Primary Address. You can use this API to obtain multiple NFT collections associated with a user, providing access to their owned NFTs within the game ecosystem.

Retrieve the list of In-Game items based on the ZooGamesID or Primary Address.

GET API_END_POINT_URL/API_KEY/userInfo/nft/inGameNft/[ZooGamesID or Address]

Example:

https://api-testnet.zoo.games/api/783061c8130f55455bd203fc2e6f5385/userInfo/nft/inGameNft/cryptofennectest?collection_in=0x3dD99feA434E323EAF274148712226eD2d549dA3&first=100&skip=0

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

ZooGamesID or Address*

String

If you use ZooGamesID it will get NFT list by linking user Addresses

If you use Address it will get NFT list by an address

collection_in*

Addresses

Contract address of NFTs

You can use comma (,) to get many collections you want.

first

Number

Limitation of the list. Default is 100

skip

Number

It's an Offset (Start from). Default is 0

{
    "success": true,
    "data": [
        {
            "collection": "0x3dd99fea434e323eaf274148712226ed2d549da3",
            "tokenId": "1",
            "address": "0x5d2a8b3683292442faca52e9b6537faaad0ae576",
            "chainId": "999",
            "timestamp": "1685951205",
            "uri": "https://openzoo.mypinata.cloud/ipfs/QmbyNPqUeahZxxkpSiSvYS6Rpu2SRXtJLU5rumUFFaheDx",
            "token_id": 1,
            "name": "NFT1",
            "description": "NFT Demo",
            "image": "https://picsum.photos/200/300"
        }
            ]
}

Currently, this API supports retrieving the list of NFTs based on the ZooGamesID and Primary Address or any other addresses associated with the user. However, it does not provide the functionality to fetch the list of linked Secondary addresses by the ZooGamesID.

Last updated