Transfers
The Transfer APIs provide users the entries to tranfer the NFTs easily.
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.
{
"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
}
{
"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.
The TransferItem construct is presented in the following.
{
"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.
[
{
"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.
The TransferTask Struct
is listed as follow:
{
"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
.
{
"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'
Last updated