Extension API provides the functions that the standard (ERC-721) APIs do not offer.

Get NFT Royalty Information

Gets the royalty and the address who receives this royalty via the token ID (tokenId) and the NFT sales (salePrice). The royalty can be set upon minting an NFT with the contract implemented ERC-2981/CW-2981 interface.

Request URL

Live URL https://bc-api.qpyou.cn/core/v1/nft/extension/{contract}/royalty/{tokenId}
Sandbox URL https://sandbox-bc-api.qpyou.cn/core/v1/nft/extension/{contract}/royalty/{tokenId}
HTTP Method GET
Content-Type application/json

Path Parameters

Field Name Description Type Required
contract the NFT contract address string Y
tokenId NFT ID String Y

Header Parameters

Field Name Description Type Required
Authorization Authentication token required to call the API string Y
x-network the blockchain networks {ploygon, xpla} string Y

Query Parameters

Field Name Description Type Required
salePrice the amount of NFT sale string Y

Responses

Field Name Description Type
code api request result code, 0: success number
message the result message String
data API response data json
data.receiver the wallet address that receives the royalty string
data.amount the royalty amount string

Request Sample

Response Sample

Mint NFT

Creates a transaction that mint tokens to a specific address (to). You can call this API loading the required NFT information (mintMsg.tokenId, mintMsg.metadata, etc.) into an array, and this API will upload the NFT information to IPFS (InterPlanetary File System) and mint the NFT. This API extends the features of NFT API, able to mint maximum 200 tokens at the same time and to set royalty. from must be the account that has a right to mint.

Request URL

Live URL https://bc-api.qpyou.cn/core/v1/nft/extension/{contract}/mint
Sandbox URL https://sandbox-bc-api.qpyou.cn/core/v1/nft/extension/{contract}/mint
HTTP Method POST
Content-Type application/json

Path Parameters

Field Name Description Type Required
contract the NFT contract address string Y

Header Parameters

Field Name Description Type Required
Authorization Authentication token required to call the API string Y
x-network the blockchain networks {ploygon, xpla} string Y

Request Body

Field Name Description Type Required
from the account address that mints NFTs string Y
mintMsg This is the required information for minting. It is in JSON array format, so you can mint NFTs to multiple accounts. array Y
mintMsg.to the wallet address that receives NFTs string Y
mintMsg.tokenId This is the NFT ID. The NFT ID should be unique, and is defined by the NFT minter.

  • Polygon: Only strings and integers (0~2256-1) are allowed.
  • XPLA: Only strings are allowed.
string Y
mintMsg.royaltyPercentage This is the royalty percentage. It is the money given to the creator of an NFT or the claimant every time the NFT is sold or resold. The royalty rate is applied to the total amount of sale. This feature is supported for the NFT marketplaces that are willing to continuously fund artists and NFT creators. The marketplace checks the NFT royalty and pay it to the recipient. The royalty is not directly paid to the recipient when the NFT is sold (transferred). This feature is adopted for the OpenSea.

  • Polygon: Allowed to the 2 decimal places.
  • XPLA: Only an integer is allowed.
number N
mintMsg.metadata the metadata

  • You need to check type and url (animationUrl, youtubeUrl, externalUrl) formats. If this data is incorrect, the API request may fail.
  • The metadata will be saved in the snake case to be used for OpenSea when it is saved in IPFS (example: animationUrlanimation_url)
json Y
mintMsg.metadata.name the NFT name string Y
mintMsg.metadata.description the NFT description string N
mintMsg.metadata.image This is the NFT image address. This is the public website address or the public IPFS address for uploading images to IPFS. string Y
mintMsg.metadata.animationUrl the address for the NFT animation string N
mintMsg.metadata.youtubeUrl the Youtube address string N
mintMsg.metadata.imageData the NFT image information string N
mintMsg.metadata.externalUrl the external url string N
mintMsg.metadata.backgroundColor the background color info of the token (OpenSea) string N
mintMsg.metadata.attributes These are the information of the metadata attributes. These contain the additional info that are not described in the metadata. json N
mintMsg.metadata.attributes.traitType The names of the items that constitute attributes string N
mintMsg.metadata.attributes.maxValue the maximum value of trait number N
mintMsg.metadata.attributes.value This is the trait value. It should be less than mintMsg.metadata.attributes.maxValue. If mintMsg.metadata.attributes.displayType is date, set this value following unix timestamp (seconds) format. string or number N
mintMsg.metadata.attributes.displayType This is the display type of the trait. The default value is string.

  • number: numeric type
  • boost_percentage: percentage (OpenSea Boosts)
  • boost_number: numeric (OpenSea Boosts)
  • date: date type (example: Tuesday, January 1st, 2019)
string N
encoded whether the returned transaction is encoded or not

  • true: Receive the encoded raw transaction string (data.rawTx).
  • false: Receive the decoded data.rawTx (JSON).
boolean N

Responses

Field Name Description Type
code api request result code, 0: success number
message the result message String
data API response data json
data.rawTx the transaction data string or json
data.hashedTx This is hashed data.rawTx. This value is only returned when the API header x-network is “polygon” and the Request Body from is an multi sig wallet address. string
data.requestId the unique value that can identify each API request string

Request Sample

Response Sample

Deploy NFT Contract

Creates a transaction that deploys the NFT contract. The deployed contract supports ERC-721/CW-721 standard and the extension features.

  • Bulk Minting
  • Royalty (ERC-2981/CW-2981)

Request URL

Live URL https://bc-api.qpyou.cn/core/v1/nft/extension/contract
Sandbox URL https://sandbox-bc-api.qpyou.cn/core/v1/nft/extension/contract
HTTP Method POST
Content-Type application/json

Header Parameters

Field Name Description Type Required
Authorization Authentication token required to call the API string Y
x-network the blockchain networks {ploygon, xpla} string Y

Request Body

Field Name Description Type Required
from the wallet address that deploys the contract string Y
name the NFT contract name string Y
symbol the NFT contract symbol string Y
minter the wallet address of the account who can mint an NFT at this NFT contract string Y
encoded whether the returned transaction is encoded or not

  • true: Receive the encoded raw transaction string (data.rawTx).
  • false: Receive the decoded data.rawTx (JSON).
boolean N

Responses

Field Name Description Type
code api request result code, 0: success number
message the result message String
data API response data json
data.rawTx the transaction data string or json
data.hashedTx This is hashed data.rawTx. This value is only returned when the API header x-network is “polygon” and the Request Body from is an multi sig wallet address. string
data.requestId the unique value that can identify each API request string

Request Sample

Response Sample