Smart Contract and NFT Management

Define the smart contracts and NFTs that are used within a product.

Good to know: These services are not provided for a developer to use in-game. Please log into your developer dashboard at www.gaimin.tech

Allowlist Smart Contract and NFTs

Auth: PRODUCT

Allowlist a smart contract and selected NFTs.

POST https://api.gaimin.gg/api/public/v1/product/tokens

Allowlist a smart contract and selected NFTs. After allowlisting, NFTs will be connected to the product and can be retireved as a repsonse in endpoints for receiving NFTs metadata.

Headers

NameTypeDescription

accept*

String

*/*

X-Api-Key*

String

apiKey

Content-Type*

String

application/json

Request Body

NameTypeDescription

chain

Enum

POLYGON, BSC

contractAddress*

String

Smart contract address containing the NFT data

2..100

contractDescription*

String

Description of the smart contract

10..2000

tokens*

List <String>

List of tokens

ProductNftDto:
- tokenId
- address
- chain

Example Request:

curl --location 'https://api.qa.gaimin.gg/api/public/v1/product/tokens' \
--header 'accept: */*' \
--header 'X-Api-Key: 8dcaa202-7048-4c19-a30c-f7c7a9e5658c' \
--header 'Content-Type: application/json' \
--data '{
  "contractAddress": "0x868676dcaf5495c31955466561b8a3c786f87dba",
  "contractDescription": "GAIMIN Alpha Pack",
  "tokens": [
    "1", "2", "3", "26", "27", "28"
  ],
  "chain": "POLYGON"
}'

Example Response:

{
  "data": [
    {
      "tokenId": "1",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    },
    {
      "tokenId": "2",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    },
    {
      "tokenId": "3",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    },
    {
      "tokenId": "26",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    },
    {
      "tokenId": "27",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    },
    {
      "tokenId": "28",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    }
  ],
  "success": true
}

Get Allowed NFTs

Auth: PRODUCT

GET https://api.gaimin.gg/api/public/v1/product/tokens

Get the NFTs from a smart contract that are to be used within a game.

Headers

NameTypeDescription

accept*

String

*/*

X-Api-Key*

String

apiKey

ProductNftDto:
- tokenId
- address
- chain

Example Response

{
  "data": [
    {
      "tokenId": "1",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    },
    {
      "tokenId": "2",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    },
    {
      "tokenId": "3",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    }
  ],
  "success": true
}

Example Request:

curl --location 'https://api.qa.gaimin.gg/api/public/v1/product/tokens' \
--header 'accept: */*' \
--header 'X-Api-Key: 8dcaa202-7048-4c19-a30c-f7c7a9e5658c'

Example Response:

{
  "data": [
    {
      "tokenId": "696",
      "address": "0xe09d7962886a06d305f7122ea08ca184f535575a",
      "chain": "BSC"
    },
    {
      "tokenId": "27",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    },
    {
      "tokenId": "1",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    },
    {
      "tokenId": "3",
      "address": "0xf7c72cc843b019415c5caeb4fa2669716901ccac",
      "chain": "MUMBAI"
    },
    {
      "tokenId": "3",
      "address": "0x868676dcaf5495c31955466561b8a3c786f87dba",
      "chain": "POLYGON"
    }
  ],
  "success": true
}

Unbind Smart Contract

Auth: PRODUCT

Unbind a smart contract attributed to a game

DELETE https://api.gaimin.gg/api/public/v1/product/contract

Delete the smart contract that has previously been connected to the product by allowlisting

Headers

NameTypeDescription

accept*

String

*/*

X-Api-Key*

String

apiKey

Request Body

NameTypeDescription

contractAddress*

String

Address of smart contract to be deleted

chain*

String

Chain on which the smart contract is stored

TBA

Example Request:

curl --location --request DELETE 'https://api.qa.gaimin.gg/api/public/v1/product/contract?contractAddress=0x868676dcaf5495c31955466561b8a3c786f87dba&chain=POLYGON' \
--header 'accept: */*' \
--header 'X-Api-Key: 8dcaa202-7048-4c19-a30c-f7c7a9e5658c'

Example Response:

{
  "data": {
    "message": "Successfully deleted"
  },
  "success": true
}

Unbind Allowed NFTs

Auth: PRODUCT

Delete a smart contract and selected NFTs previously connected to the product through allowlisting

DELETE https://api.gaimin.gg/api/public/v1/product/tokens

Delete a smart contract and selected NFTs previously connected through the allowlisting call.

Headers

NameTypeDescription

accept*

String

*/*

X-Api-Key*

String

apiKey

Request Body

NameTypeDescription

contractAddress*

String

Address of Smart Contract

tokens*

List <String>

List of tokens to be deletd

chain*

String

Chain on which Smart Contract operates

{
    // Response
}

Example Request:

curl --location --request DELETE 'https://api.qa.gaimin.gg/api/public/v1/product/tokens?contractAddress=0x868676dcaf5495c31955466561b8a3c786f87dba&tokens=2&tokens=26&tokens=28&chain=POLYGON' \
--header 'accept: */*' \
--header 'X-Api-Key: 8dcaa202-7048-4c19-a30c-f7c7a9e5658c'

Example Response:

{
  "data": {
    "message": "Successfully deleted"
  },
  "success": true
}

Refresh Metadata

Auth: PRODUCT

Identify changes in a smart contract and obtain refreshed data

POST https://api.gaimin.gg/api/public/v1/tokens/refresh

Request Body

NameTypeDescription

smartContract*

String

Address of smart contract

ProductNftDto:
- tokenId
- address
- chain

Last updated