-
Notifications
You must be signed in to change notification settings - Fork 2
Metadata schema
All collection and tokens contains metadata - link to JSON file (or store JSON file on blockchain)
We borrow well known and industry adopted ERC721-metadata standard for metadata store
Schema of metadata
{
"title": "Asset Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Identifies the asset to which this NFT represents"
},
"description": {
"type": "string",
"description": "Describes the asset to which this NFT represents"
},
"image": {
"type": "string",
"description": "A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents"
},
"attributes": {
"type": "array",
"description": "Additional attributes"
},
}
}
Sample of data
{
"name": "Some nice name",
"description": "Some nice description",
"image_url": "https://storage.tonium.io/creature/33.jpg",
"attributes": [...]
}
On collection (smart contract) method called "getTokenURI". It will return URL to json file with metadata.
Url can be https url on base64 url
https://api.tonium.io/json/{collectonID}/{tokenID}
https://api.tonium.io/json/1/1
"data:application/json;base64,{base64decoded string}"
Sample "data:application/json;base64, eyJuYW1lIjoiVGhpcyBhIGxpdHRsZSBraXR0eSIsImRlc2NyaXB0aW9uIjoiU2hlIGFkb3B0ZWQgYnkgbmljZSBwZW9wbGVzIGFuZCBsaXZpbmcgd2l0aCA1IGxpdHRseSBraWRzIGluIG9uZSBob3VzZSIsImltYWdlX3VybCI6Imh0dHBzOi8vaW1hZ2VzLnBleGVscy5jb20vcGhvdG9zLzEwNTYyNTEvcGV4ZWxzLXBob3RvLTEwNTYyNTEuanBlZz9hdXRvPWNvbXByZXNzJmNzPXRpbnlzcmdiJmRwcj0zJmg9NzUwJnc9MTI2MCJ9"
We implemented three options to store images
Upload files happened on endpoint /files/:collectionId/:tokenId? Endpoint going to return file url
File schema then will started by "https://"
Use ipfs upload File schema then will started by "ipft://"
Use method addBytes(tokenId,data)
File schema then will started by "toniumTonFile://{collectonID}/{tokenID}"