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 isgame
.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:
Attribute | Type | Description |
---|---|---|
id | string | The nftId of the NFT. |
contractAddress | string | The contract address of the newly minted NFT. |
onChainId | string | The on-chain identifier of the newly minted NFT. |
chain | string | The chain identifier of the newly minted NFT. |
transactionHash | string | The transaction hash of the newly minted NFT. |
accountId | string | The account Id linked to the newly minted NFT. |
gameId | string | The game id to which the NFT is minted. |
status | string | The minted status of the NFT. There are three possible NFT statuses: 'Creating', 'OnChain', and 'Failed'. |
metadata | string | The details of the newly minted NFT. |
name | string | The name of the newly minted NFT. |
image | string | The image URL of the newly minted NFT. |
URI | string | The Uniform Resource Identifier of the newly minted NFT. |
supply | integer | The total supply of the newly minted NFT. |
supplyAvailable | integer | The available supply of the newly minted NFT. |
createdAt | timestamp | The 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:
Attribute | Type | Description |
---|---|---|
blockNumber | string | The Block Number of the transaction. |
blockTimestamp | timestamp | The time when the transaction occurs. |
blockHash | string | The block hash of the transaction of the given nftId . |
transactionHash | string | The transaction hash of the transaction of the given nftId . |
transactionIndex | integer | The transaction index of the transaction of the given nftId . |
logIndex | integer | The log index of the transaction of the given nftId . |
value | string | The value of the transaction. |
contractType | string | The contract type of the transaction of the given nftId . |
transactionType | string | The transaction type of the transaction of the given nftId . |
tokenAddress | string | The token address used on the transaction of the given nftId . |
tokenId | string | The token id is used on the transaction of the given nftId . |
fromAddress | string | The sender of the transaction of the given nftId . |
toAddress | string | The recipient of the transaction of the given nftId . |
amount | string | The total amount of supply occurred on the transaction of the given nftId . |
operator | string | The 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:
Attribute | Type | Description |
---|---|---|
id | string | The NFT Id. |
contractAddress | string | The contract address of the transferred NFT. |
onChainId | string | The on-chain identifier of the transferred NFT. |
chain | string | The chain identifier of the transferred NFT. |
transactionHash | string | The transaction hash of the transferred NFT. |
accountId | string | Account ID associated with the transferred NFT. |
gameId | string | The game ID that the NFT was linked to. |
status | string | The transferred status of the NFT. There are three possible NFT statuses: 'Creating', 'OnChain', and 'Failed'. |
metadata | array of strings | The details of the transferred NFT. |
name | string | The name of the transferred NFT. |
description | string | The description of the transferred NFT. |
image | string | The image URL of the transferred NFT. |
attributes | string | The custom properties of the transferred NFT. |
URI | string | The Uniform Resource Identifier of the transferred NFT. |
holders | array of object | The list of the players who currently have the given nftId . |
supply | integer | The total supply of the transferred NFT. |
supplyAvailable | integer | The available supply of the transferred NFT. |
createdAt | timestamp | The 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:
Attribute | Type | Description |
---|---|---|
id | string | The NFT Id. |
contractAddress | string | The contract address of the NFT. |
onChainId | string | The on-chain identifier of the NFT. |
chain | string | The chain identifier of the NFT. |
transactionHash | string | The transaction hash of the NFT. |
accountId | string | Account ID associated with the NFT. |
gameId | string | The game ID that the NFT was linked to. |
status | string | The status of the NFT. There are three possible NFT statuses: 'Creating', 'OnChain', and 'Failed'. |
metadata | array of string | The details of the NFT. |
name | string | The name of the NFT. |
description | string | The description of the NFT. |
image | string | The image URL of the NFT. |
attributes | string | The custom properties of the NFT. |
URI | string | The Uniform Resource Identifier of the NFT. |
holders | array of object | The list of the players who currently have the given nftId . |
supply | integer | The total supply of the NFT. |
supplyAvailable | integer | The available supply of the NFT. |
createdAt | timestamp | The 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:
Attribute | Type | Description |
---|---|---|
url | string | The 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 begameId
,playerId
oraccountId
.queryBy
: specifies whatobjectId
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:
Attribute | Type | Description |
---|---|---|
id | string | The nftId of the NFT. |
contractAddress | string | The contract address of the NFT. |
onChainId | string | The on-chain identifier of the NFT. |
chain | string | The chain identifier of the NFT. |
transactionHash | string | The transaction hash of the NFT. |
accountId | string | The account id linked to the NFT. |
gameId | string | The ID of the game to which the NFT belongs. |
status | string | The status of the NFT. There are three possible NFT statuses: 'Creating', 'OnChain', and 'Failed'. |
metadata | array of strings | The details of the NFT. |
name | string | The name of the NFT. |
description | string | The description of the NFT. |
image | string | The image URL of the NFT. |
attributes | string | The custom properties of the NFT |
URI | string | The Uniform Resource Identifier of the NFT. |
supply | integer | The total supply of the NFT. |
supplyAvailable | integer | The available supply of the NFT. |
createdAt | timestamp | The 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:
![shield.png 344](https://files.readme.io/818da32-shield.png)