Skip to content

v2 · Feature 4 — Media Types for Schemas - #4

Closed
robrigo wants to merge 3 commits into
mainfrom
feat/v2-4-media-types
Closed

v2 · Feature 4 — Media Types for Schemas#4
robrigo wants to merge 3 commits into
mainfrom
feat/v2-4-media-types

Conversation

@robrigo

@robrigo robrigo commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Adds media-type support to schemas.


Mirrored into the canonical atomicassets org for the AtomicAssets v2 release + audit.
Original: wax-office-of-inspector-general/atomicassets-contract#5

⚠️ Hold — do not merge to master yet. Kept on a feature branch to avoid prod integration risk; pending the comprehensive v2 audit.

@robrigo
robrigo marked this pull request as ready for review June 2, 2026 20:49
@robrigo
robrigo requested a review from Copilot June 2, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds schema “media type / descriptor” metadata by introducing a per-collection schematypes table and an action to set/update schema attribute type metadata, supporting AtomicAssets v2 schema extensions.

Changes:

  • Introduces FORMAT_TYPE (name + mediatype + info) for annotating schema attributes.
  • Adds setschematyp action to validate and store schema type metadata keyed by schema_name.
  • Adds schematypes multi_index table and a get_schema_types accessor.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/atomicassets.cpp Implements setschematyp action validation + adds get_schema_types accessor implementation.
include/atomicdata.hpp Adds FORMAT_TYPE struct definition used for schema media-type/descriptor metadata.
include/atomicassets.hpp Exposes the new action, table (schematypes), and get_schema_types accessor in the contract interface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/atomicassets.cpp
* Emplaces or modifies a schematype for a schema
* Can be used as a descriptor of a schema attribute (i.e. "Rarity"::"Provides X bonuses to this NFT")
* Can also be used as a media type for a schema attribute (i.e. denoting an IPFS hash with a particular file type, like .obj or .gltf for 3D files)
* Must match the formating of the schema
Comment thread include/atomicassets.hpp
vector <FORMAT> schema_format_extension
);

ACTION setschematyp(
Comment thread include/atomicassets.hpp
Comment on lines +97 to +100
name authorized_creator,
name collection_name,
name schema_name,
vector <FORMAT_TYPE> schema_format_type
Comment thread include/atomicassets.hpp
uint64_t primary_key() const { return schema_name.value; }
};

typedef multi_index <name("schematypes"), schema_types_s> schema_types_t;
Comment thread src/atomicassets.cpp

// Check to see if all elements in schema_format_type have unique names && exist within the schema_format
std::set<std::string> format_type_set;
for (FORMAT_TYPE & format_type_itr : schema_format_type){
@robrigo

robrigo commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #9, which is merged. This feature is on main: setschematyp is declared in include/atomicassets.hpp and writes the schematypes table, shipped in v2.0.0-rc4 and rc5. The integration branch carried the feature under its own commits rather than these, so this PR could not close automatically. Branch kept for history.

@robrigo robrigo closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants