Building an NFT System
Before integrating NFT APIs, please proceed with the following steps.
- Sign Up
- Generating Wallet
- Issuing API Tokens
- Register API Callable IP
Once you generate a custodial wallet or semi-custodial wallet, you can integrate NFT APIs.
If you want to use NFT APIs, please contact [email protected].
NFT Contracts
Deployment Process
To mint NFT items, you need an NFT contract. The contract is deployed by the following process.
- Request contract deployment.
- Generate transaction.
- Calculates the optimal fees and propagates the transactions.
- Deployment is completed when the transactions are confirmed in the blocks.
Deploying
1. Deploy from the Console
You can deploy a new contract from [NFT Management] on the console.
2. Deploy with API
You can request the deployment of a new contract by calling the Request NFT Contract Deployment API. The uuid
value will be returned when the deployment request is successful. The value can be used to check the deployment progress.
Response example
{
"uuid": "948019e6-fc25-4278-9b73-b089aaa1e1c1"
}
Deployment Confirmation
You can check the progress of a specific deployment transaction by calling the Access NFT Contract List API.
Response example
[
{
"symbol": "HEX",
"nameKo": "hexlant-octet",
"nameEn": "hexlant-octet",
"status": "ACTIVATED",
"type": "ERC721",
"contractAddress": "0x05fb500DBCD9828AD7Bb9EaE3bD6E436860e14fE",
"iconUrl": "https://tetco-user-console-frontend.blockchainapi.io/images/logo-icon.png",
"isExternal": false,
"createdDate": "2022-05-17T02:03:21.110Z",
"modifiedDate": "2022-05-17T02:03:21.110Z"
}
]
Deployment Status
Status name | Description |
---|---|
PENDING | Deployment transaction is generated |
UNFINALIZED | Deployment transaction is included in the blocks |
FINALIZED | Deployment transaction is included in the blocks and the next block have been generated |
FAILED | Deployment transaction failed |
Deployment fees
Contract deployment fees will be deducted from the main address. Therefore, the main address should have assets (ETH, MATIC, etc.) to pay the fee. The deployment will not proceed if the deployment fee is insufficient.
NFT Item
Minting Process
Mints NFT items from the deployed contract to a specific address. Each item has a unique ID, which consists of numbers. For this, each item must contain metadata.
What is Metadata?
Metadata is data in JSON format containing assets (images, videos, etc.) included in the NFT item. The data is stored using a trusted method of the client or a distributed file system such as IPFS. When minting an NFT item, enter the URI directing the metadata in JSON format. Generate metadata URI by referring to the following guide.
Minting
1. Mint from the Console
You can mint a new NFT item from [NFT Management] - Select a contract - [Mint Item] on the console.
2. Mint with API
You can mint a new NFT item by calling the Request NFT Item Minting API. Minted items can be checked by calling the Access NFT Item List API.
Response example
{
"uuid": "eefec795-cce1-43e2-b678-6e84dcc83a8a"
}
Minting Confirmation
You can check the progress of a specific itemโs minting transaction by calling the Access NFT Item List API.
Response example
[
{
"tokenId": "2205171109",
"amount": 1,
"tokenUri": "https://ipfs.io/ipfs/QmPNa2dXPuvZKGDiuAAnQDy4EeMkvdfXT3vZD7S3cEMU37/1",
"status": "ACTIVATED",
"createdDate": "2022-05-17T02:33:20.896Z",
"modifiedDate": "2022-05-17T02:33:22.035Z",
"nftItemBalances": [
{
"amount": 1,
"address": {
"idx": 54,
"address": "0x71b5De2970A32eEf6362AE7Bc3B73103b4392bB0",
"name": "NotMainAddress",
"derivationIndex": 0,
"type": "ETHEREUM_EOA",
"status": "ACTIVATED",
"createdDate": "2021-12-23T08:51:29.499Z",
"modifiedDate": "2022-05-17T02:33:11.000Z"
}
}
]
}
]
Minting Status
Status name | Description |
---|---|
PENDING | Minting transaction is generated |
UNFINALIZED | Minting transaction is included in the blocks |
FINALIZED | Minting transaction is included in the blocks and the next block have been generated |
FAILED | Minting transaction failed |
Minting Fees
Item minting fees will be deducted from the main address. Therefore, the main address should have assets (ETH, MATIC, etc.) to pay the fee. Minting will not proceed if the minting fee is insufficient.
NFT Withdrawal
Withdrawal Process
Both custodial wallets and semi-custodial wallets withdraw NFT items from the main and child addresses to the outside. NFTs deposited from custodial wallets to child addresses are not gathered at the main address, so NFT item withdrawal from child addresses is possible.
- Request withdrawal.
- Generate transaction.
- Calculates the optimal fees and propagates the transactions.
- Withdrawal is completed when the transactions are confirmed in the blocks.
Withdraw
1. Withdraw from the main address
You can request NFT item withdrawals from the main address to the outside by calling the Request NFT Item Withdrawal from Main Address API. The uuid value will be returned when the withdrawal request is successful. The value can be used to access the withdrawal process.
2. Withdrawal from the child address
You can request NFT item withdrawals from the child address to the outside by calling the Request NFT Item Withdrawal from Child Address API. The uuid value will be returned when the withdrawal request is successful. The value can be used to access the withdrawal process.
Response example
{
"uuid": "0c0ee2d8-cdcd-40aa-9b7f-fc596dd3178c"
}
Withdrawal Confirmation
You can check the progress of a specific withdrawal transaction by calling Access Withdrawal Request Information for NFT Item API.
Response example
{
"idx": 24,
"uuid": "0c0ee2d8-cdcd-40aa-9b7f-fc596dd3178c",
"fromAddress": "0x71b5De2970A32eEf6362AE7Bc3B73103b4392bB0",
"toAddress": "0x46063261EEd9BfAFf092E94350Fd4f039Ca0B28b",
"amount": 1,
"memo": null,
"requestId": "2205171558",
"type": "API",
"description": "test withdrawal",
"requiredApprovalCount": 2,
"useApiAutoApproval": false,
"useFeeDelegation": false,
"feePayerAddress": null,
"status": "AWAITING_DECISION",
"createdDate": "2022-05-17T06:59:45.134Z",
"modifiedDate": "2022-05-17T06:59:45.134Z",
"rejectedDate": null,
"nft": {
"symbol": "HEX",
"nameKo": "hexlant-octet",
"nameEn": "hexlant-octet",
"status": "ACTIVATED",
"type": "ERC721",
"contractAddress": "0x05fb500DBCD9828AD7Bb9EaE3bD6E436860e14fE",
"iconUrl": "https://tetco-user-console-frontend.blockchainapi.io/images/logo-icon.png",
"isExternal": false,
"createdDate": "2022-05-17T02:03:21.110Z",
"modifiedDate": "2022-05-17T02:03:21.110Z"
},
"nftItem": {
"tokenId": "2205171109",
"amount": 1,
"tokenUri": "https://ipfs.io/ipfs/QmPNa2dXPuvZKGDiuAAnQDy4EeMkvdfXT3vZD7S3cEMU37/1",
"status": "ACTIVATED",
"createdDate": "2022-05-17T02:33:20.896Z",
"modifiedDate": "2022-05-17T02:33:22.035Z"
},
"nftTransaction": null
}
Withdrawal Status
NFT withdrawal is finalized(FINALIZED
) at the moment when the NFT withdrawal transaction is included in the blocks.
Withdrawal Request Status
Status name | Description |
---|---|
AWAITING_DECISION | Awaiting withdrawal approval |
AWAITING_WITHDRAWAL | Approved and awaiting withdrawal |
REJECTED | Withdrawal is denied |
SENT | Withdrawal transaction is generated |
Transaction Status
Status name | Description |
---|---|
PENDING | Withdrawal transaction is generated |
FINALIZED | Withdrawal transaction is included in the blocks |
FAILED | Withdrawal transaction failed |
Withdrawal Fees
For this, withdrawal fees will be deducted from the address to be withdrawn. Therefore, the address to be withdrawn should have assets (ETH, MATIC, etc.) to pay the fee. Withdrawal will not proceed if the withdrawal fee is insufficient.
TIP
However, the fee delegation feature is available for Klaytn. By making the value of theuseFeeDelegation
fieldtrue
, withdrawal fees will be deducted from the fee address.
Updated about 1 year ago