Metadata
Metadata
A standard metadata interface
This aims to be a relatively comprehensive definition of NFT metadata, but not all metadata will fit cleanly into this shape.
Attributes:
Name | Type | Description |
---|---|---|
token |
Token
|
a Token interface with all information required to uniquely identify an NFT |
raw_data |
dict
|
raw metadata object fetched from token uri. |
standard |
MetadataStandard
|
accepted metadata standard based on the format of the metadata. |
attributes |
list[Attribute]
|
list of token metadata attributes. |
name |
str
|
token name. |
description |
str
|
token description. |
mime_type |
str
|
metadata mime type, e.g. "image/png". |
image |
str
|
nested image in the metadata. |
content |
str
|
nested content, e.g. video, audio, etc., in the metadata. |
additional_fields |
list[MetadataField]
|
any additional metadata fields that don't fit in the defined schema. |
Source code in offchain/metadata/models/metadata.py
Attribute
NFT metadata atttribute
Attributes:
Name | Type | Description |
---|---|---|
trait_type |
str
|
the attribute key. |
value |
str
|
the attribute value. |
display_type |
str
|
informs how the attribute is displayed. |
Source code in offchain/metadata/models/metadata.py
MediaDetails
Metadata media information
Attributes:
Name | Type | Description |
---|---|---|
size |
int
|
size of the media. |
sha256 |
str
|
the SHA256 hash of the media. |
uri |
str
|
the uri at which the media was found. |
mime_type |
str
|
the mime type of the media. |
Source code in offchain/metadata/models/metadata.py
MetadataField
Additional metadata field that does not fit within the defined Metadata entity
Some metadata standards will have standardized additional metadata fields that are not captured in our metadata schema. For example, OpenSea allows for an 'external_url' field.
Attributes:
Name | Type | Description |
---|---|---|
field_name |
str
|
name of the metadata field. |
type |
MetadataFieldType
|
metadata field type. |
description |
str
|
a description of what this metadata field represents. |
value |
any
|
the value of the metadata field. |