通过Scan API查询的列表信息
合约NFT列表
user在指定合约的持有列表
NFT流转历史记录
NFT链上Transfer记录
user链上交互记录
都可以在Scan API查询
测试网:https://api-testnet.confluxscan.net/doc
主网:https://api.confluxscan.net/doc
获取Scan上NFT的链上信息示例/nft/合约地址/tokenid:https://testnet.confluxscan.net/nft/cfxtest:acc5wdm8tjcx1n2hyntkyevj5d1c03xaxypmfgbg32/210
获取指定合约地址contract,指定tokenid 的NFT的交易记录:
https://testnet.confluxscan.net/v1/transfer?address=cfxtest:acc5wdm8tjcx1n2hyntkyevj5d1c03xaxypmfgbg32&limit=10&skip=0&tokenId=210&transferType=ERC721
返回值:
{"code":50302,"message":"https://ipfs.jugugu.cn/ipfs/QmPKbTCA3dv6BoGwrkNqoE4bagRcH7NG2x2FggdvsBZ6dh Aborted","data":{"code":50302,"error":"https://ipfs.jugugu.cn/ipfs/QmPKbTCA3dv6BoGwrkNqoE4bagRcH7NG2x2FggdvsBZ6dh Aborted","detail":{"funcCall":"tokenURI(5)","tokenUri":{"raw":"https://ipfs.jugugu.cn/ipfs/QmPKbTCA3dv6BoGwrkNqoE4bagRcH7NG2x2FggdvsBZ6dh","gateway":""}},"externalMs":30006,"creator":"cfxtest:acbvh9dbbvkwzb86rh7jgz4j6da0magcmy0b9tgkfw","owner":"cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n","mintTime":"2022-06-16T09:00:24.000Z","type":"ERC721"}}
基本逻辑:①通过用户地址查参与的合约地址List ②通过合约地址查用户地址持有的NFT及其详情和属性
常用函数:
①
https://api-testnet.confluxscan.net/nft/balances?owner=cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n&skip=0&limit=10
获取指定地址持有的NFT项目
owner:用户地址
limit:返回的最大条数
skip:跳过的条数
返回值(contract合约地址,name合约名称,symbol合约符号,type合约类型,balance代表owner用户在本合约拥有的NFT的数目):
{
"code": 0,
"message": "OK",
"data": {
"total": 13,
"list": [
{
"owner": "cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n",
"contract": "cfxtest:acc5wdm8tjcx1n2hyntkyevj5d1c03xaxypmfgbg32",
"balance": "210",
"name": "创作者Mint测试",
"symbol": "MINT",
"type": "ERC721",
"webSite": null,
"iconUrl": null
},
{
"owner": "cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n",
"contract": "cfxtest:acbvcyfdg2zrypsudntpueywmhyynt9ju23z4n8tmz",
"balance": "204",
"name": "终极测试",
"symbol": "721",
"type": "ERC721",
"webSite": null,
"iconUrl": null
},
{
"owner": "cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n",
"contract": "cfxtest:acak5ztz18f83xgwc67h7ym7xncz9n66x6wc4j6x12",
"balance": "2",
"name": "自动转移admin",
"symbol": "zyadmin",
"type": "ERC721",
"webSite": null,
"iconUrl": null
},
{
"owner": "cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"balance": "119",
"name": "交易测试haha",
"symbol": "GUGUEX_Test",
"type": "ERC721",
"webSite": null,
"iconUrl": null
},
{
"owner": "cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n",
"contract": "cfxtest:acdsxjf6cbn9rn42g6h1ch150vhzhyep9a4ybp0tkb",
"balance": "1",
"name": "再次测试",
"symbol": "Admin120秒",
"type": "ERC721",
"webSite": null,
"iconUrl": null
},
{
"owner": "cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n",
"contract": "cfxtest:acdj436pd0muuhzj4w65cgwtcvuaefehcehuverk0u",
"balance": "10",
"name": "终极测试POAP",
"symbol": "1155",
"type": "ERC1155",
"webSite": null,
"iconUrl": null
},
{
"owner": "cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n",
"contract": "cfxtest:achx5ekf1bsjj5xphbf5crgn9w00gy8dzpj5mtwbks",
"balance": "1",
"name": "act测试",
"symbol": "act",
"type": "ERC721",
"webSite": null,
"iconUrl": null
},
{
"owner": "cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n",
"contract": "cfxtest:acdsrmddbr7wynuyjz262eth6bujf1xbfubjnv0w0y",
"balance": "1",
"name": "PICE",
"symbol": "PICE",
"type": "ERC1155",
"webSite": null,
"iconUrl": null
},
{
"owner": "cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n",
"contract": "cfxtest:accr7zmax2emztpefydvp684x5dxc4te9erzm9t59m",
"balance": "99",
"name": "总计测试",
"symbol": "测试",
"type": "ERC721",
"webSite": null,
"iconUrl": null
},
{
"owner": "cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n",
"contract": "cfxtest:acgm718cz25g3czd33huh55n4tdxhnd5uezfjp6n7b",
"balance": "1",
"name": "PFP",
"symbol": "PFP",
"type": "ERC721",
"webSite": null,
"iconUrl": null
}
]
}
}
②
https://api-testnet.confluxscan.net/nft/tokens?owner=cfxtest:aas0668d91rj5u31beat3nvzgv1b88c1dy7x5vcv4n&contract=cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40&skip=0&limit=10&detail=true&withBrief=true&withMetadata=false
获取指定地址指定NFT项目地址持有的所有NFT
owner:用户地址
contract:项目合约地址
detail:显示详情
withBrief:显示简介
limit:返回的最大条数
skip:跳过的条数
返回值(image图片链接可以直接显示出来,name是NFT的名称,description是NFT的简介,tokenid是NFT的ID,contract是NFT所属的合约地址):
{
"code": 0,
"message": "OK",
"data": {
"total": 119,
"list": [
{
"tokenId": "124",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"name": "交易2",
"image": "https://ipfs.jugugu.cn/ipfs/QmcZWbg8QQU4sNtLrRwvedWKCYXTHE5uBuboNbYfNZPEqT",
"description": "统一大市场交易测试2"
},
{
"tokenId": "207",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"name": "交易3",
"image": "https://ipfs.jugugu.cn/ipfs/QmTxQ2UoK6RbE3tMWp3D2pxoznKCvNvd4BrnbuAnu4FanL",
"description": "统一大市场交易测试3"
},
{
"tokenId": "121",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"name": "交易2",
"image": "https://ipfs.jugugu.cn/ipfs/QmcZWbg8QQU4sNtLrRwvedWKCYXTHE5uBuboNbYfNZPEqT",
"description": "统一大市场交易测试2"
},
{
"tokenId": "116",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"name": "交易2",
"image": "https://ipfs.jugugu.cn/ipfs/QmcZWbg8QQU4sNtLrRwvedWKCYXTHE5uBuboNbYfNZPEqT",
"description": "统一大市场交易测试2"
},
{
"tokenId": "115",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"name": "交易2",
"image": "https://ipfs.jugugu.cn/ipfs/QmcZWbg8QQU4sNtLrRwvedWKCYXTHE5uBuboNbYfNZPEqT",
"description": "统一大市场交易测试2"
},
{
"tokenId": "114",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"name": "交易2",
"image": "https://ipfs.jugugu.cn/ipfs/QmcZWbg8QQU4sNtLrRwvedWKCYXTHE5uBuboNbYfNZPEqT",
"description": "统一大市场交易测试2"
},
{
"tokenId": "113",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"name": "交易2",
"image": "https://ipfs.jugugu.cn/ipfs/QmcZWbg8QQU4sNtLrRwvedWKCYXTHE5uBuboNbYfNZPEqT",
"description": "统一大市场交易测试2"
},
{
"tokenId": "112",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"name": "交易2",
"image": "https://ipfs.jugugu.cn/ipfs/QmcZWbg8QQU4sNtLrRwvedWKCYXTHE5uBuboNbYfNZPEqT",
"description": "统一大市场交易测试2"
},
{
"tokenId": "111",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"name": "交易2",
"image": "https://ipfs.jugugu.cn/ipfs/QmcZWbg8QQU4sNtLrRwvedWKCYXTHE5uBuboNbYfNZPEqT",
"description": "统一大市场交易测试2"
},
{
"tokenId": "110",
"contract": "cfxtest:acf6nhds6nm4gsdyg8jvhw8svah0m5ua8uv5m4fe40",
"name": "交易2",
"image": "https://ipfs.jugugu.cn/ipfs/QmcZWbg8QQU4sNtLrRwvedWKCYXTHE5uBuboNbYfNZPEqT",
"description": "统一大市场交易测试2"
}
]
}
}