Get the NFT history. Internally we store the internal transactions in the organization in order histories table. Get out of our platform transaction via third party apis like alchemy and etherscan.if alchemy does’t return any provenance then calling the etherscan api in two cases tokennfttx and tokentx to store in provenance_histories table. Get and merge the order histories and provenance histories data against the NFT. and return their response.
Sample query
query getNFTHistory(
$networkId: String!
$contractAddress: String!
$tokenId: BigInt!
$nftTokenId: UUID1
$filterBy: NFTTxEventType
$orgId: UUID1!
$ownerAddress: String
) {
getNFTHistory(
networkId: $networkId
contractAddress: $contractAddress
tokenId: $tokenId
nftTokenId: $nftTokenId
filterBy: $filterBy
orgId: $orgId
ownerAddress: $ownerAddress
) {
blockNum
hash
from
to
value
tokenId
category
asset
price {
value
unit
type
__typename
}
blockTimestamp
eventType
fromUserAvatar
fromUserName
toUserAvatar
toUserName
erc1155Metadata {
tokenId
value
__typename
}
__typename
}
}
Sample variable
{
"contractAddress": "0xc2455e3aec068a7f5dd59a29e19de3d3ff9aabce",
"networkId": "c41db347-0ee3-4212-943a-ca213b8e0ea8",
"nftTokenId": "b3df9138-d837-4c69-81ae-7551bfc54193",
"orgId": "f2f5c627-5421-4c40-9913-edfd09dd98b3",
"ownerAddress": "0x208486bE2747825c05dC6B98529a99ED9252F2E6",
"tokenId": "19"
}
Sample response
"data": {
"getNFTHistory": [
{
"blockNum": null,
"hash": "",
"from": "0xf63c47ec56453020e06a3833a527b61e11bd3bb1",
"to": "",
"value": null,
"tokenId": null,
"category": null,
"asset": null,
"price": [
{
"value": 68.1046,
"unit": "USD",
"type": "FIAT",
"__typename": "NFTPrice"
},
{
"value": 0.04,
"unit": "WETH",
"type": "CRYPTO",
"__typename": "NFTPrice"
}
],
"blockTimestamp": "2023-02-16T12:00:00Z",
"eventType": "Expired",
"fromUserAvatar": "",
"fromUserName": "e9c46d9c-cf23-467f-b0a0-7ddf216f34e8",
"toUserAvatar": "",
"toUserName": "",
"erc1155Metadata": null,
"__typename": "NFTHistory"
}
]
}
}
Arguments
Name | Type | Description | Required |
---|---|---|---|
networkId | `UUID | The network id | Yes |
contractAddress | String | The nft contract address | Yes |
tokenId | Integer | The nft token id | Yes |
orgId | UUID | The organization id | Yes |
nftTokenId | UUID | Nft token unique id | No |
ownerAddress | String | Nft owner address | No |
Fields
Name | Type | Description |
---|---|---|
getNFTHistory | Object | An object that contains the getNFTHistory object information, such as token ID and owners, block no and etc. |
Example
Load the NFT transaction history.