NFTRainbow
NFTRainbow 控制台GithubWhat's an NFT?
  • NFTRainbow - NFT 彩虹桥 🌈🌉🦄
  • Tutorials
    • Mints
      • 铸造NFT快速指南
    • Interactive Flowchart
    • By Community
      • NFTRainbow 使用教程
    • Account Solutions
    • Guides
      • 控制台合约代付设置
      • 元数据管理
      • Rainbow 铸造工具简介
  • Docs
    • FAQs
    • Changelog
    • RoadMap
    • Conflux Sponsor
    • Terminology
    • Prices
  • Products
    • Conflux RPC Bridge
    • ERC-6551
    • Web3 Services
  • API Reference
    • Open-API
      • Login
      • Files
      • Metadata
      • Contract
      • Mints
      • Transfers
      • Transaction
      • NFT
      • Burns
    • Swagger-Doc
    • Postman Collection
    • SDKs
      • Go-SDK
    • Common Errors
  • ABOUT THE APIs
    • Authentication
    • Error codes
    • Quotas and rate limits
Powered by GitBook
On this page
  1. API Reference
  2. Open-API

NFT

The nft API provide users the entries to interact with the NFTs.

PreviousTransactionNextBurns

Last updated 1 year ago

Update NFT

Update NFT token uri

The Update NFT token uri API provides users to update the nft token uri according to the contract address and the token_id.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

token_id

The id of the nft

Path

string

address

The address of the contract

Path

string

token_uri

The updated token uri

body

string

contract_type

The type of the contract, which includes erc721 and erc1155

body

string

chain

The type of the chain, which includes conflux and conflux_test

body

string

Name
Meaning
Type

created_at

The time of creating the item in the database

string

updated_at

The time of updating the item in the database

string

deleted_at

The time of deleting the item in the database

string

id

The id of the item in the database

integer

TaskType

The type of the item in the transaction. 1-deploy, 2-mint, 3-batch mint, 4-transfer, 5-batch transfer, 6-burn, 7-batch burn, 8-update admin, 9-sponsor balance, 10-sponsor privilege, 11-update token_uri

integer

ChainType

The type of the chain, 1-cfx, 2-eth

integer

ChainId

The type of the chain, 1-testnet, 1029-mainnet

integer

From

The sender of the transaction

string

To

The receiver of the transaction

string

Nonce

The nonce of the transaction

string

Value

The value of the transaction

string

Data

The data of the transaction

string

Hash

The hash of the transaction

string

State

The state of the transaction

integer

epoch_number

The epoch number of the transaction

integer

error

The error of the transaction

string

GasPrice

The gas price of the transaction

string

Gas

The used gas of the transaction

string

StorageLimit

The storage limit of the transaction

string

EpochHeight

The epoch height of the transaction

string

pending_reason

The pending reason of the transaction

string

{
    "id": 181295,
    "created_at": "2023-02-15T10:19:00.166+08:00",
    "updated_at": "2023-02-15T10:19:00.166+08:00",
    "deleted_at": null,
    "TaskType": 11,
    "ChainType": 1,
    "ChainId": 1,
    "From": "cfxtest:aanygt6awrrj1rv9jtctu763t3j6f9hh4p1xc4bkdd",
    "To": "cfxtest:acdggzx0r58uykdz19t42fyab92xmdk4g6vazyywns",
    "Nonce": 0,
    "Value": "0",
    "Data": "0x18e97fd100000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000d7777772e62616964752e636f6d00000000000000000000000000000000000000",
    "Hash": "",
    "State": 0,
    "epoch_number": 0,
    "error": "",
    "GasPrice": "0",
    "Gas": "0",
    "StorageLimit": "0",
    "EpochHeight": "0",
    "pending_reason": ""
}
curl --request PUT \
  --url https://api.nftrainbow.cn/v1/nft/{address}/{token_id} \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'
  --data-raw '
  {
    "token_uri": "www.baidu.com",
    "contract_type": "erc1155",
    "chain": "conflux_test"
}'

Query NFT

Query specific NFT of specific account

The Query specific NFT of specific account API provides users to get the nft information according to the contract address and the token_id.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

token_id

The id of the nft

Path

string

address

The address of the contract

Path

string

type

The contract type: erc721, erc1155. Default is erc721

Query

string

Name
Meaning
Type

owner

The owner of the NFT

string

contract_address

The address of the contract

string

token_id

The id of the token

string

{
    "owner": "cfxtest:aakkfzezns4h8ymx1cgmcnd4x3aev6e2he38nnu8sv",
    "contract_address": "cfxtest:acd8eue6shtzvnc7mts66hh88nvw2gtnaez6c4s1a5",
    "token_id": "17",
    "token_uri": "https://nftrainbow.cn/assets/1.json"
}
curl --request GET \
  --url https://api.nftrainbow.cn/v1/nft/{address}/{token_id} \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'

The token_id is a number like "123", which type is string. If the type parameter pass erc1155, the response's owner field will be empty.

Query NFT Hold count

Get NFT info, mainly owner and metadata

get

Get NFT info, mainly owner and metadata

Path parameters
addressstringRequired

address

token_idstringRequired

token_id

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Responses
200
OK
application/json
400
Invalid request
application/json
500
Internal Server error
application/json
get
GET /v1/nft/{address}/{token_id} HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "contract_address": "text",
  "owner": "text",
  "token_id": "text",
  "token_uri": "text"
}
  • Update NFT
  • Update NFT token uri
  • PUTUpdate NFT token uri
  • Query NFT
  • Query specific NFT of specific account
  • GETGet NFT info, mainly owner and metadata
  • Query NFT Hold count

Update NFT token uri

put

Update NFT token uri

Path parameters
addressstringRequired

address

token_idstringRequired

token_id

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Body
chainstring · enumRequiredPossible values:
contract_typestring · enumRequiredPossible values:
token_uristringOptional
Responses
200
OK
application/json
400
Invalid request
application/json
put
PUT /v1/nft/{address}/{token_id}/tokenUri HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 63

{
  "chain": "conflux",
  "contract_type": "erc721",
  "token_uri": "text"
}
{
  "block_reason": 1,
  "chainId": 1,
  "chainType": 1,
  "created_at": "text",
  "data": "text",
  "deleted_at": {
    "time": "text",
    "valid": true
  },
  "epochHeight": 1,
  "epoch_number": 1,
  "error": "text",
  "from": "text",
  "gas": 1,
  "gasCoveredBySponsor": true,
  "gasFee": 1,
  "gasPrice": 1,
  "hash": "text",
  "id": 1,
  "nonce": 1,
  "pending_reason": "text",
  "pre_hashs": "text",
  "stage": 1,
  "state": -10,
  "status": 1,
  "storageCollateralized": 1,
  "storageCoveredBySponsor": true,
  "storageLimit": 1,
  "taskType": 1,
  "to": "text",
  "tryReceiptCnt": 1,
  "updated_at": "text",
  "value": 1
}