This section explains how to retrieve detailed information about a specific collectible asset using the Asset API. Collectibles are digital assets stored on the blockchain, and this functionality allows you to fetch comprehensive data about individual assets within a collection.
import { AssetRegister } from '@futureverse/asset-register/v2'
import { AssetModel } from '@futureverse/asset-register/models';
const ar = new AssetRegister({
...
})
const collectionId = "7672:root:303204"
const tokenId = "232"
const asset = await ar.asset({
collectionId,
tokenId
}).execute()[0] as AssetModel
query GetAsset($tokenId: String!, $collectionId: CollectionId!) {
asset(tokenId: $tokenId, collectionId: $collectionId) {
metadata {
id
uri
properties
attributes
rawAttributes
}
collectionId
id
tokenId
schema {
id
namespace
version
name
schema
}
assetType
assetTree {
id
data
nodeId
}
collection {
id
chainId
chainType
location
name
}
}
}