terp_metadata/
lib.rs

1use cosmwasm_schema::cw_serde;
2
3/// An attribute of the token as defined by the
4/// [OpenSea metadata standard](https://docs.opensea.io/docs/metadata-standards#attributes).
5#[cw_serde]
6pub struct Trait {
7    pub display_type: Option<String>,
8    pub trait_type: String,
9    pub value: String,
10}
11
12/// OpenSea metadata standard, used by Terp marketplace.
13/// See [this link](https://docs.opensea.io/docs/metadata-standards) for details.
14#[cw_serde]
15#[derive(Default)]
16pub struct Metadata {
17    /// This is the URL to the image of the item. Can be just about any type of image (including
18    /// SVGs, which will be cached into PNGs by OpenSea), and can be
19    /// [IPFS](https://github.com/ipfs/is-ipfs) URLs or paths. We recommend using a 350 x 350 image.
20    pub image: Option<String>,
21    /// Raw SVG image data, if you want to generate images on the fly (not recommended). Only use
22    /// this if you're not including the `image` parameter.
23    pub image_data: Option<String>,
24    /// This is the URL that will appear below the asset's image on OpenSea and will allow users to
25    /// leave OpenSea and view the item on your site.
26    pub external_url: Option<String>,
27    /// A human readable description of the item. Markdown is supported.
28    pub description: Option<String>,
29    /// Name of the item.
30    pub name: Option<String>,
31    /// These are the attributes for the item, which will show up on the OpenSea page for the item.
32    pub attributes: Option<Vec<Trait>>,
33    /// Background color of the item on OpenSea. Must be a six-character hexadecimal without a
34    /// pre-pended #.
35    pub background_color: Option<String>,
36    /// A URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4,
37    /// M4V, OGV, and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA.
38    ///
39    /// Animation_url also supports HTML pages, allowing you to build rich experiences and
40    /// interactive NFTs using JavaScript canvas, WebGL, and more. Scripts and relative paths within
41    /// the HTML page are now supported. However, access to browser extensions is not supported.
42    pub animation_url: Option<String>,
43    /// A URL to a YouTube video.
44    pub youtube_url: Option<String>,
45}