NFT Endpoints have seven different API sections:

  • Mint an NFT
  • NFT Transfer History
  • Transfer NFT
  • Burn NFT
  • Upload File to IPFS
  • Get NFT Details
  • Get NFT Image

These seven API sections contain specific information comprising various properties whenever the APIs are called.

Mint an NFT

This endpoint allows users to mint their NFTs to a particular gameId they choose. The newly minted NFTs can be found within your ChainEngine Console.

📘

Prerequisites:

Ensure that you have the following requirements ready before calling the Mint an NFT endpoints:

  • gameId: to mint the NFT to.
  • linkTo: to indicate the id. Currently, the supported value for this field is game.
  • API Secret: credential to call the endpoint.
  • API Key: credential to call the endpoint.

You can find each of the requirements mentioned above within your ChainEngine console.

Payload Response

The payload from the Mint an NFT endpoint returns the following attributes:

AttributeTypeDescription
idstringThe nftId of the NFT.
contractAddressstringThe contract address of the newly minted NFT.
onChainIdstringThe on-chain identifier of the newly minted NFT.
chainstringThe chain identifier of the newly minted NFT.
transactionHashstringThe transaction hash of the newly minted NFT.
accountIdstringThe account Id linked to the newly minted NFT.
gameIdstringThe game id to which the NFT is minted.
statusstringThe minted status of the NFT. There are three possible NFT statuses: 'Creating', 'OnChain', and 'Failed'.
metadatastringThe details of the newly minted NFT.
namestringThe name of the newly minted NFT.
imagestringThe image URL of the newly minted NFT.
URIstringThe Uniform Resource Identifier of the newly minted NFT.
supplyintegerThe total supply of the newly minted NFT.
supplyAvailableintegerThe available supply of the newly minted NFT.
createdAttimestampThe time at which the user minted the NFT.

Endpoint

Below is the available endpoints list for the Mint an NFT:

Endpoint
Mint NFT - POST/nfts/{linkTo}/{gameId}

Sample Object

An example object returned by the Mint NFT endpoint is shown below:

[
  {
    "id": "69d14f2e-6ed6-47c4-b5b1-777319a91923",
    "contractAddress": "0x0F2aa1D728AA38cf90C558fACD659113C4408303",
    "onChainId": "1",
    "chain": "mumbai",
    "transactionHash": "0x71eca460544865d7902f7339ec8f92935a75f9dbe1a748492830a5e4fad562b0",
    "accountId": "015eeff0-0133-4fb9-9a44-dcc832d96c3d",
    "gameId": "6a18d45f-d0aa-47c7-9e3e-373a3e691a66",
    "status": "ONCHAIN",
    "metadata": {
      "name": "Aegist's Shield",
      "description": "Shield of Aegist",
      "image": "http://api.chainengine.xyz/nfts/69d14f2e-6ed6-47c4-b5b1-777319a91923/image",
      "URI": "ipfs://QmP1v2moEFZCjkL3MrpCBkSYU7Li94n9YyX3BPUwdUUwai"
    },
    "supply": 5,
    "supplyAvailable": 5,
    "createdAt": "2022-09-20T08:46:18.245Z"
  }
]

NFT Transfer History

This endpoint allows the users to get a detailed transaction history of the given nftId, including its sender, recipient, and the amount of supply transferred.

📘

Prerequisites:

Ensure that you have the following requirements ready before calling the NFT Transfer History endpoints:

  • nftId: to fetch the NFT.
  • API Secret: credential to call the endpoint.
  • API Key: credential to call the endpoint.

You can find each of the requirements mentioned above within your ChainEngine console.

Payload Response

The payload from the NFT Transfer History endpoint returns the following attributes:

AttributeTypeDescription
blockNumberstringThe Block Number of the transaction.
blockTimestamptimestampThe time when the transaction occurs.
blockHashstringThe block hash of the transaction of the given nftId.
transactionHashstringThe transaction hash of the transaction of the given nftId.
transactionIndexintegerThe transaction index of the transaction of the given nftId.
logIndexintegerThe log index of the transaction of the given nftId.
valuestringThe value of the transaction.
contractTypestringThe contract type of the transaction of the given nftId.
transactionTypestringThe transaction type of the transaction of the given nftId.
tokenAddressstringThe token address used on the transaction of the given nftId.
tokenIdstringThe token id is used on the transaction of the given nftId.
fromAddressstringThe sender of the transaction of the given nftId.
toAddressstringThe recipient of the transaction of the given nftId.
amountstringThe total amount of supply occurred on the transaction of the given nftId.
operatorstringThe operator used on the transaction of the given nftId.

Endpoint

Below is the available endpoints list for the NFT Transfer History:

Endpoint
Get Transfer History for the given NFT - GET/nfts/{nftId}/transfers

Sample Object

An example object returned by the Get Transfer History for the given NFT endpoint is shown below:

[
  {
    "blockNumber": "27955233",
    "blockTimestamp": "2022-09-06T04:38:31.000Z",
    "blockHash": "0x43ba8482c9df7f88ee5ad43c783da7ad8490f18490d4174ebe49916a1c82717f",
    "transactionHash": "0xc4292b6c3d62d5267966b9325ed953a6b1dac7d236053ac84e80ce37c70287a7",
    "transactionIndex": 1,
    "logIndex": 2,
    "value": "0",
    "contractType": "ERC1155",
    "transactionType": "Single",
    "tokenAddress": "0x4978fdb799010d73e1d57530666b4c66a16d1854",
    "tokenId": "19",
    "fromAddress": "0x0000000000000000000000000000000000000000",
    "toAddress": "0x03aeffc2a553e7a375e8b4ca581494ab49be0ef6",
    "amount": "1",
    "operator": "0x03aeffc2a553e7a375e8b4ca581494ab49be0ef6"
  }
]

Transfer NFT

This API allows the user to directly transfer a specified NFT to any players present in the game.

📘

Prerequisites:

Ensure that you have the following requirements ready before calling the Transfer NFT endpoints:

  • nftId: to fetch the NFT.
  • playerId: to transfer the NFT to.
  • API Secret: credential to call the endpoint.
  • API Key: credential to call the endpoint.

You can find each of the requirements mentioned above within your ChainEngine console.

Payload Response

The payload from the Transfer NFT endpoint returns the following attributes:

AttributeTypeDescription
idstringThe NFT Id.
contractAddressstringThe contract address of the transferred NFT.
onChainIdstringThe on-chain identifier of the transferred NFT.
chainstringThe chain identifier of the transferred NFT.
transactionHashstringThe transaction hash of the transferred NFT.
accountIdstringAccount ID associated with the transferred NFT.
gameIdstringThe game ID that the NFT was linked to.
statusstringThe transferred status of the NFT. There are three possible NFT statuses: 'Creating', 'OnChain', and 'Failed'.
metadataarray of stringsThe details of the transferred NFT.
namestringThe name of the transferred NFT.
descriptionstringThe description of the transferred NFT.
imagestringThe image URL of the transferred NFT.
attributesstringThe custom properties of the transferred NFT.
URIstringThe Uniform Resource Identifier of the transferred NFT.
holdersarray of objectThe list of the players who currently have the given nftId.
supplyintegerThe total supply of the transferred NFT.
supplyAvailableintegerThe available supply of the transferred NFT.
createdAttimestampThe time at which the NFT was transferred.

Endpoint

Below is the available endpoints list for the Transfer NFT:

Endpoint
Transfer NFT from the Developer Account - POST/nfts/{nftId}/transfers

Sample Object

An example object returned by the Transfer NFT from the Developer Account endpoint is shown below:

{
  "id": "78be034f-817a-4e39-9157-e1a1da9808c6",
  "contractAddress": "0x4978fdb799010d73E1d57530666B4c66A16D1854",
  "onChainId": "64",
  "chain": "mumbai",
  "transactionHash": "0x0a277c51c4e7d16269d23329e5504ce472a326a81de0622cb575ba8d70e16af3",
  "accountId": "015eeff0-0133-4fb9-9a44-dcc832d96c3d",
  "gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
  "status": "ONCHAIN",
  "metadata": {
    "name": "Traditional Armor",
    "description": "Traditional armor, will strength your endurance",
    "image": "https://c8.alamy.com/comp/RT9D1F/warrior-with-traditional-armor-and-weapon-RT9D1F.jpg",
    "attributes": {
      "weight": "1kg",
      "color": "blue",
      "material": "Wool and Wood",
      "manufacturer": "by Farmer",
      "model": "Armor"
    },
    "URI": "ipfs://Qmdwr99iUQsnAGVkxrfEN3AHycD8w4hMxM4maPdsEE6nQK"
  },
  "holders": {
    "0b80f768-77ee-46bf-8ea7-386b15533bcd": "11111001111",
    "327a6728-c42a-4b2d-8fac-5ffab06566c3": "111111111",
    "fec232f9-7cbe-4ee2-b388-9cebdd290b27": 10,
    "4bfc556b-321d-409c-8d1b-ede8f79ba88d": 5,
    "aa73532f-c3ae-46ce-80ae-6fc462fe2a23": 5
  },
  "supply": 334,
  "supplyAvailable": 296,
  "createdAt": "2022-09-13T15:27:55.233Z"
}

Burn NFT

This endpoint allows you to burn your NFTs from your developer account.

📘

Prerequisites:

Ensure that you have the following requirements ready before calling the Burn NFT endpoints:

  • nftId: of the NFT you wish to burn.
  • API Secret: credential to call the endpoint.
  • API Key: credential to call the endpoint.

You can find each of the requirements mentioned above within your ChainEngine console.

Payload Response

The payload from the Burn NFT endpoint returns the following attributes:

AttributeTypeDescription
idstringThe NFT Id.
contractAddressstringThe contract address of the NFT.
onChainIdstringThe on-chain identifier of the NFT.
chainstringThe chain identifier of the NFT.
transactionHashstringThe transaction hash of the NFT.
accountIdstringAccount ID associated with the NFT.
gameIdstringThe game ID that the NFT was linked to.
statusstringThe status of the NFT. There are three possible NFT statuses: 'Creating', 'OnChain', and 'Failed'.
metadataarray of stringThe details of the NFT.
namestringThe name of the NFT.
descriptionstringThe description of the NFT.
imagestringThe image URL of the NFT.
attributesstringThe custom properties of the NFT.
URIstringThe Uniform Resource Identifier of the NFT.
holdersarray of objectThe list of the players who currently have the given nftId.
supplyintegerThe total supply of the NFT.
supplyAvailableintegerThe available supply of the NFT.
createdAttimestampThe time at which the NFT was created.

Endpoint

Below is the available endpoints list for the Burn NFT:

Endpoint
Burn NFT from the Developer Account - POST/nfts/{nftId}/burn

Sample Object

An example object returned by the Burn NFT from the Developer Account endpoint is shown below:

{
  "id": "9905d985-30b6-434a-b452-ad1f3af9030e",
  "contractAddress": "0x4978fdb799010d73E1d57530666B4c66A16D1854",
  "onChainId": "59",
  "chain": "mumbai",
  "transactionHash": "0x502e4251705809c8457c49c8f40cf6becc1ff99b6a32a3afffa3ea8a6efeb190",
  "accountId": "015eeff0-0133-4fb9-9a44-dcc832d96c3d",
  "gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
  "status": "ONCHAIN",
  "metadata": {
    "name": "Wooden Axe",
    "description": "Wooden Axe for strength your Ability",
    "image": "https://c8.alamy.com/comp/2GPXK6J/wooden-axe-icon-in-cartoon-style-2GPXK6J.jpg",
    "attributes": {
      "weight": "1kg",
      "color": "blue",
      "material": "Wooden and Iron",
      "manufacturer": "From Farmer",
      "model": "Axe"
    },
    "URI": "ipfs://Qmeyb6pB8US5nTKhUUckN2gchL1nAXbnp3JwuUmGfATn4q"
  },
  "holders": {
    "0b80f768-77ee-46bf-8ea7-386b15533bcd": "1111111010",
    "327a6728-c42a-4b2d-8fac-5ffab06566c3": "1"
  },
  "supply": 747,
  "supplyAvailable": 736,
  "createdAt": "2022-09-13T15:05:17.039Z"
}

Upload to IPFS

This endpoint allows uploading your file to IPFS.

📘

Prerequisites:

Ensure that you have the following requirements ready before calling the Upload to IPFS endpoints:

  • API Secret: credential to call the endpoint.
  • API Key: credential to call the endpoint.

You can find each of the requirements mentioned above within your ChainEngine console.

Payload Response

The payload from the Upload to IPFS endpoint returns the following attributes:

AttributeTypeDescription
urlstringThe Uniform Resource Identifier of the uploaded file.

Endpoint

Below is the available endpoints list for the Upload to IPFS:

Endpoint
Upload to IPFS - PUT/nfts/image

Sample Object

An example object returned by the Upload to IPFS endpoint is shown below.

{
  "url": "ipfs://QmXW7ZhnaAmBHXVLm8mbizeT5mUFhDzfQ4k1fQ68MLxMrA"
}

Get NFT Details by Object Id

This endpoint allows the user to obtain detailed information on the NFT by nftId/playerId/gameId/accountId. Get NFT by Id returns a record of the NFT's information. This includes the NFT's identifier, name, and description.

📘

Prerequisites:

Ensure that you have the following requirements ready before calling the Get NFT Details by Object Id endpoints:

  • objectId: to fetch the NFT. Object Id can be gameId, playerId or accountId.
  • queryBy: specifies what objectId is used.
  • API Secret: credential to call the endpoint.
  • API Key: credential to call the endpoint.

You can find each of the requirements mentioned above within your ChainEngine console.

Payload Response

The payload from the Get NFT Details by Object Id endpoint returns the following attributes:

AttributeTypeDescription
idstringThe nftId of the NFT.
contractAddressstringThe contract address of the NFT.
onChainIdstringThe on-chain identifier of the NFT.
chainstringThe chain identifier of the NFT.
transactionHashstringThe transaction hash of the NFT.
accountIdstringThe account id linked to the NFT.
gameIdstringThe ID of the game to which the NFT belongs.
statusstringThe status of the NFT. There are three possible NFT statuses: 'Creating', 'OnChain', and 'Failed'.
metadataarray of stringsThe details of the NFT.
namestringThe name of the NFT.
descriptionstringThe description of the NFT.
imagestringThe image URL of the NFT.
attributesstringThe custom properties of the NFT
URIstringThe Uniform Resource Identifier of the NFT.
supplyintegerThe total supply of the NFT.
supplyAvailableintegerThe available supply of the NFT.
createdAttimestampThe time at which the NFT was created.

Endpoint

Below is the available endpoints list for the Get NFT Details by Object Id:

Endpoint
Get NFT by Id - GET/nfts/{nftId}
Fetch NFTs for Given Player/Game/Account - GET/nfts

Sample Object

An example object returned by the Fetch NFTs for Given Player/Game/Account endpoint is shown below.

{
  "page": 1,
  "offset": 0,
  "total": 1,
  "items": [
    {
      "nfts": [
        {
          "id": "78be034f-817a-4e39-9157-e1a1da9808c6",
          "contractAddress": "0x4978fdb799010d73E1d57530666B4c66A16D1854",
          "onChainId": "64",
          "chain": "mumbai",
          "transactionHash": "0x0a277c51c4e7d16269d23329e5504ce472a326a81de0622cb575ba8d70e16af3",
          "accountId": "015eeff0-0133-4fb9-9a44-dcc832d96c3d",
          "gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
          "status": "ONCHAIN",
          "metadata": {
            "name": "Traditional Armor",
            "description": "Traditional armor, will strength your endurance",
            "image": "http://api.chainengine.xyz/nfts/78be034f-817a-4e39-9157-e1a1da9808c6/image",
            "attributes": {
              "weight": "1kg",
              "color": "blue",
              "material": "Wool and Wood",
              "manufacturer": "by Farmer",
              "model": "Armor"
            },
            "URI": "ipfs://Qmdwr99iUQsnAGVkxrfEN3AHycD8w4hMxM4maPdsEE6nQK"
          },
          "holders": {
            "0b80f768-77ee-46bf-8ea7-386b15533bcd": "11111001111",
            "327a6728-c42a-4b2d-8fac-5ffab06566c3": "111111111",
            "fec232f9-7cbe-4ee2-b388-9cebdd290b27": 10,
            "4bfc556b-321d-409c-8d1b-ede8f79ba88d": 5,
            "aa73532f-c3ae-46ce-80ae-6fc462fe2a23": 5
          },
          "supply": 334,
          "supplyAvailable": 296,
          "createdAt": "2022-09-13T15:27:55.233Z"
        }
      ]
    }
  ]
}

Get NFT Image

This endpoint allows the users to get the image of the given nftId. This endpoint only returns the image of the NFT.

📘

Prerequisites:

Ensure that you have the following requirements ready before calling the Get NFT Image endpoints:

  • nftId: to fetch the NFT's image.
  • API Secret: credential to call the endpoint.
  • API Key: credential to call the endpoint.

You can find each of the requirements mentioned above within your ChainEngine console.

Payload Response
Only a picture of the NFT will be returned when you run Get NFT Image. The image supports the following file formats: JPG, JPEG, PNG, and GIF.

Endpoint

Below is the available endpoints list for the Get NFT Image:

Endpoint
Get NFT Image by Id - GET/nfts/{nftId}/image

Sample Object

An example object returned by the Get NFT Image by Id endpoint is shown below:

344