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

Transfers

The Transfer APIs provide users the entries to tranfer the NFTs easily.

PreviousMintsNextTransaction

Last updated 1 year ago

Transfer Actions

The Transfer APIs provide two methods to help users transfer NFTs, including the tranfer or batch transfer NFTs.

Transfer NFT

The Transfer NFT provides users with the entry to transfer the NFT.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Type
Required

contract_type

The type of the contract, which includes erc721 and erc1155

body

string

token_id

The id of the NFT

body

string

chain

The chain type. The types include conflux and conflux_test

body

string

transfer_from_address

The sender of the sending NFT

body

string

contract_address

The address of the contract

body

string

transfer_to_address

The receiver of the sending NFT

body

string

amount

The amount of the sending NFT

body

integer

{
    "chain": "conflux_test",
    "contract_address": "cfxtest:accy6epch754uamc4x55mcv3pzgae8vfvaufj6v4uj",
    "contract_type":"erc1155",
    "transfer_from_address": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
    "transfer_to_address": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
    "token_id":"20",
    "amount":1
}
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

app_id

The id of the app

integer

chain_type

The type of the chain. 1-CFX, 2-ETH.

integer

chain_id

The id of the chain. 1029-mainnet, 1-testnet

integer

contract

The address of the contract

string

contract_type

The type of the contract. 1-ERC721, 2-ERC1155

integer

token_id

The id of the token

string

transfer_from

The sender of the sending NFT

string

transfer_to

The receiver of the sending NFT

string

amount

The amount of the sending NFT

integer

status

The status of the transaction. 0-pending, 1-success, 2-failed

integer

hash

The hash of the transaction

string

tx_id

The id of the transaction

integer

error

The error during executing the transaction

string

{
    "id": 1,
    "created_at": "2022-08-24T07:33:59.985Z",
    "updated_at": "2022-08-24T07:33:59.985Z",
    "deleted_at": null,
    "app_id": 2,
    "chain_type": 1,
    "chain_id": 1,
    "contract": "cfxtest:accy6epch754uamc4x55mcv3pzgae8vfvaufj6v4uj",
    "contract_type": 2,
    "tx_id": 8127,
    "hash": "",
    "status": 0,
    "error": "",
    "transfer_from": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
    "transfer_to": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
    "token_id": "20",
    "amount": 1
}
curl --request POST \
  --url https://api.nftrainbow.cn/v1/transfers/customizable \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json' \ 
  --data-raw '{
    "chain": "conflux_test",
    "contract_address": "cfxtest:accy6epch754uamc4x55mcv3pzgae8vfvaufj6v4uj",
    "contract_type":"erc1155",
    "transfer_from_address": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
    "transfer_to_address": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
    "token_id":"20",
    "amount":1
}'

The token_id is the number like "123", which type is string

Batch Transfer NFTs

The Batch Transfer NFTs API provides users with the entry to transfer several NFTs once.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Type
Required

chain

The chain type. The types include conflux and conflux_test

body

string

contract_type

The type of the contract, which includes erc721 and erc1155

body

string

contract_address

The address of the contract

body

string

items

The mint tasks

body

The array of the TransferItem

The TransferItem construct is presented in the following.

Name
Meaning
Param Type
Type
Required

transfer_from_address

The sender of the sending NFT

body

string

transfer_to_address

The receiver of the sending NFT

body

string

amount

The amount of the NFTs

body

integer

token_id

The id of the token

body

string

{
    "chain": "conflux_test",
    "contract_address": "cfxtest:accy6epch754uamc4x55mcv3pzgae8vfvaufj6v4uj",
    "contract_type": "erc1155",
    "items": [
        {
            "transfer_from_address": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
            "transfer_to_address": "cfxtest:aanpu16mtgc7dke5xhuktyfyef8f00pz8a2z5mc14g",
            "token_id": "20",
            "amount": 2
        },
        {
            "transfer_from_address": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
            "transfer_to_address": "cfxtest:aang4d91rejdbpgmgtmspdyefxkubj2bbywrwm9j3z",
            "token_id": "21",
            "amount": 1
        }
    ]
}

The response is the array of transferTask construct. The construct is showed in the following.

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

app_id

The id of the app

integer

chain_type

The type of the chain. 1-CFX, 2-ETH.

integer

chain_id

The id of the chain. 1029-mainnet, 1-testnet

integer

contract

The address of the contract

string

contract_type

The type of the contract. 1-ERC721, 2-ERC1155

integer

status

The status of the transaction. 0-pending, 1-success, 2-failed

integer

hash

The hash of the transaction

string

tx_id

The id of the transaction

integer

error

The error during executing the transaction

string

transfer_to

The receiver of the sending NFT

string

transfer_from

The sender of the sending NFT

string

token_id

The id of the token

integer

amount

The amount of the sending NFT

integer

[
    {
        "id": 1,
        "created_at": "2022-08-24T07:47:48.558Z",
        "updated_at": "2022-08-24T07:47:48.558Z",
        "deleted_at": null,
        "app_id": 2,
        "chain_type": 1,
        "chain_id": 1,
        "contract": "cfxtest:acbf8taf6zzy99kncvu7d81vyavaz2ay5254ca3j7c",
        "contract_type": 1,
        "tx_id": 8474,
        "hash": "",
        "status": 0,
        "error": "",
        "transfer_from": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
        "transfer_to": "cfxtest:aanpu16mtgc7dke5xhuktyfyef8f00pz8a2z5mc14g",
        "token_id": "20",
        "amount": 2,
    },
    {
        "id": 2,
        "created_at": "2022-08-24T07:47:48.558Z",
        "updated_at": "2022-08-24T07:47:48.558Z",
        "deleted_at": null,
        "app_id": 2,
        "chain_type": 1,
        "chain_id": 1,
        "contract": "cfxtest:acbf8taf6zzy99kncvu7d81vyavaz2ay5254ca3j7c",
        "contract_type": 1,
        "tx_id": 8474,
        "hash": "",
        "status": 0,
        "error": "",
        "transfer_from": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
        "transfer_to": "cfxtest:aang4d91rejdbpgmgtmspdyefxkubj2bbywrwm9j3z",
        "token_id": "21",
        "amount": 1,
    }
]
curl --request POST \
  --url https://api.nftrainbow.cn/v1/transfers/customizable/batch \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json' \ 
  --data-raw '{
    "chain": "conflux_test",
    "contract_address": "cfxtest:accy6epch754uamc4x55mcv3pzgae8vfvaufj6v4uj",
    "contract_type": "erc1155",
    "items": [
        {
            "transfer_from_address": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
            "transfer_to_address": "cfxtest:aanpu16mtgc7dke5xhuktyfyef8f00pz8a2z5mc14g",
            "token_id": "20",
            "amount": 2
        },
        {
            "transfer_from_address": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
            "transfer_to_address": "cfxtest:aang4d91rejdbpgmgtmspdyefxkubj2bbywrwm9j3z",
            "token_id": "21",
            "amount": 1
        }
    ]
}'

Obtain Informations

Obtain transferred NFT list

The Obtain transferred NFT list API provides users with the entry to query the transferred NFTs information.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required
Default

page

Page Query

query

integer

1

limit

Page Query

query

integer

10

Name
Meaning
Type

count

The number of the tranferred NFTs

integer

items

The nfts information

[]TransferTask

The TransferTask Struct is listed as follow:

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

amount

The amount of the sending NFTs

integer

app_id

The id of the app

integer

chain_id

The id of the chain. 1029-mainnet, 1-testnet

integer

chain_type

The type of the chain. 1-CFX, 2-ETH

integer

contract

The address of the nft

string

contract_type

The type of the contract. 1-ERC721, 2-ERC1155

integer

error

The error during executing tx

string

hash

The hash of the transaction

string

transfer_to

The receiver of the sending NFT

string

status

The status of the transaction. 0-pending, 1-success, 2-failed

integer

token_id

The id of the token

string

transfer_from

The sender of the sending NFT

string

tx_id

The id of the transaction

integer

{
    "count": 3,
    "items": [
        {
            "id": 3,
            "created_at": "2022-08-24T07:47:48.56Z",
            "updated_at": "2022-08-24T07:47:51.882Z",
            "deleted_at": null,
            "app_id": 2,
            "chain_type": 1,
            "chain_id": 1,
            "contract": "cfxtest:accy6epch754uamc4x55mcv3pzgae8vfvaufj6v4uj",
            "contract_type": 2,
            "tx_id": 8129,
            "hash": "",
            "status": 2,
            "error": "",
            "transfer_from": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
            "transfer_to": "cfxtest:aang4d91rejdbpgmgtmspdyefxkubj2bbywrwm9j3z",
            "token_id": "21",
            "amount": 1
        },
        {
            "id": 2,
            "created_at": "2022-08-24T07:47:48.56Z",
            "updated_at": "2022-08-24T07:47:51.877Z",
            "deleted_at": null,
            "app_id": 2,
            "chain_type": 1,
            "chain_id": 1,
            "contract": "cfxtest:accy6epch754uamc4x55mcv3pzgae8vfvaufj6v4uj",
            "contract_type": 2,
            "tx_id": 8129,
            "hash": "",
            "status": 2,
            "error": "",
            "transfer_from": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
            "transfer_to": "cfxtest:aanpu16mtgc7dke5xhuktyfyef8f00pz8a2z5mc14g",
            "token_id": "20",
            "amount": 2
        },
        {
            "id": 1,
            "created_at": "2022-08-24T07:33:59.985Z",
            "updated_at": "2022-08-24T07:34:21.757Z",
            "deleted_at": null,
            "app_id": 2,
            "chain_type": 1,
            "chain_id": 1,
            "contract": "cfxtest:accy6epch754uamc4x55mcv3pzgae8vfvaufj6v4uj",
            "contract_type": 2,
            "tx_id": 8127,
            "hash": "",
            "status": 2,
            "error": "",
            "transfer_from": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
            "transfer_to": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
            "token_id": "20",
            "amount": 1
        }
    ]
}
curl --request GET \
  --url https://api.nftrainbow.cn/v1/transfers/ \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'

Obtain Detialed NFT Transfer Information

The Obtain Detialed NFT Transfer Information API provides users with the entry to query the transferred NFT information according to its id.

Name
Meaning
Param Type
Data Type

Authorization

Bearer Token

Header

string

Name
Meaning
Param Type
Data Type
Required

id

transfer id

path

integer

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

amount

The amount of the sending NFTs

integer

app_id

The id of the app

integer

chain_id

The id of the chain. 1029-mainnet, 1-testnet

integer

chain_type

The type of the chain. 1-CFX, 2-ETH

integer

contract

The address of the nft

string

contract_type

The type of the contract. 1-ERC721, 2-ERC1155

integer

error

The error during executing tx

string

hash

The hash of the transaction

string

transfer_to

The receiver of the sending NFT

string

status

The status of the transaction. 0-pending, 1-success, 2-failed

integer

token_id

The id of the token

string

transfer_from

The sender of the sending NFT

string

tx_id

The id of the transaction

integer

{
    "id": 3,
    "created_at": "2022-08-24T07:47:48.56Z",
    "updated_at": "2022-08-24T07:47:51.882Z",
    "deleted_at": null,
    "app_id": 2,
    "chain_type": 1,
    "chain_id": 1,
    "contract": "cfxtest:accy6epch754uamc4x55mcv3pzgae8vfvaufj6v4uj",
    "contract_type": 2,
    "tx_id": 8129,
    "hash": "",
    "status": 2,
    "error": "",
    "transfer_from": "cfxtest:aam1eawbm9pzp0dnwv96tts5shnbdfv9nuwu7zgzz8",
    "transfer_to": "cfxtest:aang4d91rejdbpgmgtmspdyefxkubj2bbywrwm9j3z",
    "token_id": "21",
    "amount": 1
}
curl --request GET \
  --url https://api.nftrainbow.cn/v1/transfers/{id} \
  --header 'Authorization: Bearer {JWT}' \
  --header 'Content-Type: application/json'

Obtain the transferred NFTs list

get

Get the NFT list containing the transferred NFT information.

Query parameters
pageintegerOptional

page

limitintegerOptional

limit

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Responses
200
OK
application/json
500
Internal Server error
application/json
get
GET /v1/transfers/ HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "count": 1,
  "items": [
    {
      "amount": 1,
      "app_id": 1,
      "block_reason": 1,
      "chain_id": 1,
      "chain_type": 1,
      "contract": "text",
      "contract_type": 1,
      "created_at": "text",
      "deleted_at": {
        "time": "text",
        "valid": true
      },
      "error": "text",
      "hash": "text",
      "id": 1,
      "status": 1,
      "token_id": "text",
      "transfer_from": "text",
      "transfer_to": "text",
      "tx_id": 1,
      "updated_at": "text"
    }
  ]
}

Transfer NFT detail

get

Get NFT Transfer detail info

Path parameters
idintegerRequired

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/transfers/{id} HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Accept: */*
{
  "amount": 1,
  "app_id": 1,
  "block_reason": 1,
  "chain_id": 1,
  "chain_type": 1,
  "contract": "text",
  "contract_type": 1,
  "created_at": "text",
  "deleted_at": {
    "time": "text",
    "valid": true
  },
  "error": "text",
  "hash": "text",
  "id": 1,
  "status": 1,
  "token_id": "text",
  "transfer_from": "text",
  "transfer_to": "text",
  "tx_id": 1,
  "updated_at": "text"
}
  • Transfer Actions
  • Transfer NFT
  • POSTTransfer NFT
  • Batch Transfer NFTs
  • POSTBatch Transfer NFTs
  • Obtain Informations
  • Obtain transferred NFT list
  • GETObtain the transferred NFTs list
  • Obtain Detialed NFT Transfer Information
  • GETTransfer NFT detail

Transfer NFT

post

Transfer NFT by admin

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Body
amountintegerOptional
chainstring · enumRequiredPossible values:
contract_addressstringRequired
contract_typestring · enumRequiredPossible values:
token_idstringRequired
transfer_from_addressstringRequired
transfer_to_addressstringRequired
Responses
200
OK
application/json
400
Invalid request
application/json
500
Internal Server error
application/json
post
POST /v1/transfers/customizable HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 159

{
  "amount": 1,
  "chain": "conflux",
  "contract_address": "text",
  "contract_type": "erc721",
  "token_id": "text",
  "transfer_from_address": "text",
  "transfer_to_address": "text"
}
{
  "amount": 1,
  "app_id": 1,
  "block_reason": 1,
  "chain_id": 1,
  "chain_type": 1,
  "contract": "text",
  "contract_type": 1,
  "created_at": "text",
  "deleted_at": {
    "time": "text",
    "valid": true
  },
  "error": "text",
  "hash": "text",
  "id": 1,
  "status": 1,
  "token_id": "text",
  "transfer_from": "text",
  "transfer_to": "text",
  "tx_id": 1,
  "updated_at": "text"
}

Batch Transfer NFTs

post

Transfer several NFTs once

Header parameters
AuthorizationstringRequired

Bearer Open_JWT

Body
chainstring · enumRequiredPossible values:
contract_addressstringRequired
contract_typestring · enumRequiredPossible values:
Responses
200
OK
application/json
400
Invalid request
application/json
500
Internal Server error
application/json
post
POST /v1/transfers/customizable/batch HTTP/1.1
Host: api.nftrainbow.cn
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 171

{
  "chain": "conflux",
  "contract_address": "text",
  "contract_type": "erc721",
  "items": [
    {
      "amount": 1,
      "token_id": "text",
      "transfer_from_address": "text",
      "transfer_to_address": "text"
    }
  ]
}
[
  {
    "amount": 1,
    "app_id": 1,
    "block_reason": 1,
    "chain_id": 1,
    "chain_type": 1,
    "contract": "text",
    "contract_type": 1,
    "created_at": "text",
    "deleted_at": {
      "time": "text",
      "valid": true
    },
    "error": "text",
    "hash": "text",
    "id": 1,
    "status": 1,
    "token_id": "text",
    "transfer_from": "text",
    "transfer_to": "text",
    "tx_id": 1,
    "updated_at": "text"
  }
]