From 9fa00f32a7821681b64a63b3e6ba8586736b2de5 Mon Sep 17 00:00:00 2001 From: lash Date: Sun, 5 Mar 2023 08:47:07 +0000 Subject: [PATCH] Initial commit --- cic.json | 50 +++++++++++++++++++++++++++++++++++++++++++++++ jsonmime.json | 26 ++++++++++++++++++++++++ nft.json | 23 ++++++++++++++++++++++ opensea_part.json | 38 +++++++++++++++++++++++++++++++++++ test_valid.json | 18 +++++++++++++++++ 5 files changed, 155 insertions(+) create mode 100644 cic.json create mode 100644 jsonmime.json create mode 100644 nft.json create mode 100644 opensea_part.json create mode 100644 test_valid.json diff --git a/cic.json b/cic.json new file mode 100644 index 0000000..0b8400e --- /dev/null +++ b/cic.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "sha256:", + "title": "CIC core metadata container", + + "type": "object", + "properties": { + "targets": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(0x)?[a-fA-F0-9]{40}" + } + + }, + "attachments": { + "type": "array", + "items": { + "$ref": "/mime" + } + } + }, + "required": ["targets", "attachments"], + "jsonmime": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/mime", + "title": "A single generic attachment for documenting any asset", + + "type": "object", + "properties": { + "contentType": { + "type": "string", + "$comment": "valid mime type" + }, + "contentTransferEncoding": { + "type": "string", + "enum": ["BASE64", "QUOTED-PRINTABLE", "8BIT", "7BIT"] + }, + "subject": { + "type": "string", + "$comment": "utf-8" + }, + "body": { + "type": "string", + "$comment": "uri including dataurl" + } + }, + "required": ["contentType", "body", "subject"] + } +} diff --git a/jsonmime.json b/jsonmime.json new file mode 100644 index 0000000..ec18a85 --- /dev/null +++ b/jsonmime.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/mime", + "title": "A single generic attachment for documenting any asset", + + "type": "object", + "properties": { + "contentType": { + "type": "string", + "$comment": "valid mime type" + }, + "contentTransferEncoding": { + "type": "string", + "enum": ["BASE64", "QUOTED-PRINTABLE", "8BIT", "7BIT"] + }, + "subject": { + "type": "string", + "$comment": "utf-8" + }, + "body": { + "type": "string", + "$comment": "uri including dataurl" + } + }, + "required": ["contentType", "body", "subject"] +} diff --git a/nft.json b/nft.json new file mode 100644 index 0000000..37a2a80 --- /dev/null +++ b/nft.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/erc721", + "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. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive.", + "format": "uri" + } + }, + "required": ["name", "description"] +} diff --git a/opensea_part.json b/opensea_part.json new file mode 100644 index 0000000..c21c119 --- /dev/null +++ b/opensea_part.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/opensea", + "title": "Partial implementation of the OpenSea token metadata standard", + + "type": "object", + "properties": { + "image_data": { + "type": "string", + "description": "Raw SVG image data, if you want to generate images on the fly (not recommended). Only use this if you're not including the image parameter." + }, + "image": { + "type": "string", + "description": "A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive." + }, + "external_url": { + "type": "string", + "description": "This is the URL that will appear below the asset's image on OpenSea and will allow users to leave OpenSea and view the item on your site." + }, + "attributes": { + "type": "object", + "description": "These are the attributes for the item, which will show up on the OpenSea page for the item. (see below)" + }, + "animation_url": { + "type": "string", + "description": "Animation_url also supports HTML pages, allowing you to build rich experiences and interactive NFTs using JavaScript canvas, WebGL, and more. Scripts and relative paths within the HTML page are now supported. However, access to browser extensions is not supported." + } + }, + "required": ["attributes"], + "oneOf": [ + { + "required": ["image"] + }, + { + "required": ["image_data"] + } + ] +} diff --git a/test_valid.json b/test_valid.json new file mode 100644 index 0000000..20e3871 --- /dev/null +++ b/test_valid.json @@ -0,0 +1,18 @@ +{ + "name": "foo", + "description": "foofoo", + "image": "data:image/svg+xml;base64,", + "targets": [ + "0xabcdef0123456789abcdef0123456789abcdef00", + "abcdef0123456789abcdef0123456789abcdef00" + ], + "attributes": {}, + "attachments": [ + { + "contentType": "text/plain", + "contentTransferEncoding": "8BIT", + "subject": "foo", + "body": "bar" + } + ] +}