Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@meemproject/metadata

Package Overview
Dependencies
Maintainers
4
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meemproject/metadata

Meem metadata types and validator.

  • 0.19.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-22.22%
Maintainers
4
Weekly downloads
 
Created
Source

Meem Metadata

Metadata types and validator.

Types

This package contains types for all supported Meem metadata schemas. Import the metadata type as shown below to ensure metadata will pass validation when parsed by the Meem API.

See the types folder for currently supported metadata types.

import { MeemAgreement_Contract_20221116 } from '@meemproject/metadata'

const metadata: MeemAgreement_Contract_20221116 = {
    meem_metadata_version: "MeemAgreement_Contract_20221116",
    meem_metadata_type: "MeemAgreement",
    name: "Strongly typed Agreement!",
    description: "Now with tokens!",
    external_url: "",
    image: ""
}

Parser

The parser can take a metadata object or JSON string and parse/validate it against supported metadata versions.

const parser = new Parser()

try {
    const parsedMetadata = parser.parse(
        metadata as unknown as MeemMetadataLike
    )
    const { name, type, calVer, metadata } = parsedMetadata
    console.log(name, type, calVer, metadata)
} catch (e) {
    console.log(e)
}

Validator

Here's an example of how to validate metadata for a MeemAgreement contract

const metadata = {
    meem_metadata_version: "20221116",
    meem_metadata_type: "MeemAgreement_Contract",
    name: "Strongly typed Agreement!",
    description: "Now with tokens!",
    external_url: "",
    image: ""
}

const validator = new Validator(metadata)
const result = validator.validate(metadata)
const isValid = result.valid

FAQs

Package last updated on 13 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc