Register Asset with Schema
Link a collection or specific token to a schema so the Asset Registry can validate and generate the Asset Tree.
This guide covers linking:
- On-chain collections / tokens
- Off-chain collections / assets (after initial off-chain asset registration)
Register a Collection
Use registerTokenSchema to attach a schema at the collection level (omit or set tokenId to null). This supersedes the deprecated registerCollection mutation.
INFO
Authorization will require the collection/NFT contract owner (or an authorised wallet). Ensure the schema is already created via createSchema.
GraphQL Mutation (Collection-Level)
mutation RegisterTokenSchema($input: RegisterTokenSchemaInput!) {
registerTokenSchema(input: $input) {
tokenSchema {
id
collectionId
tokenId
schemaId
version
}
}
}Example variables (collection-level):
{
"input": {
"collectionId": "1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182",
"tokenId": null,
"schemaId": "http://schema.futureverse.dev/fv#TNLBoxer"
}
}Token-Level Override (Optional)
Register a specific token to a different schema (falls back to collection-level if token record absent).
{
"input": {
"collectionId": "1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182",
"tokenId": "1234",
"schemaId": "http://schema.futureverse.dev/fv#TNLBoxerVariant"
}
}Response Shape
On success:
{
"data": {
"registerTokenSchema": {
"tokenSchema": {
"collectionId": "1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182",
"tokenId": "null",
"schemaId": "http://schema.futureverse.dev/fv#TNLBoxer",
"version": 1
}
}
}
}Register Off-Chain Asset With Schema
After creating (or ensuring the existence of) an off-chain asset via registerOffChainAsset, link its collection (or optionally a specific off-chain NFT token) to a schema using the same registerTokenSchema mutation. Off-chain collection IDs use the pattern:
off-chain:{creatorId}:{creatorCollectionId} (collection-wide)
and individual NFT tokens may add a token segment when referencing the asset itself, but schema linkage for token-level overrides still supplies the collection ID plus a tokenId value (mirroring on-chain semantics).
INFO
You do NOT register schema linkage with the full did:fv-asset:off-chain:... DID. Use the raw off-chain collection ID (off-chain:...:...) and, for token-level overrides, the tokenId you used during registerOffChainAsset.
Off-Chain Collection-Level Schema Link
mutation RegisterTokenSchema($input: RegisterTokenSchemaInput!) {
registerTokenSchema(input: $input) {
tokenSchema { collectionId tokenId schemaId version }
}
}Example variables:
{
"input": {
"collectionId": "off-chain:eb117567-e455-4abd-b8e1-a7e451b96b23:20001",
"tokenId": null,
"schemaId": "http://schema.futureverse.dev/example#OffChainAvatar"
}
}Off-Chain Token-Level Override (Optional)
If a specific off-chain NFT (with tokenId) requires a divergent schema:
{
"input": {
"collectionId": "off-chain:eb117567-e455-4abd-b8e1-a7e451b96b23:20001",
"tokenId": "1",
"schemaId": "http://schema.futureverse.dev/example#OffChainAvatarVariant"
}
}For full off-chain asset registration details, see the dedicated Off-Chain Assets guide.
(Deprecated) Previous Method
registerCollection is deprecated and will be / has been removed. Use registerTokenSchema for all new integrations.