
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
parse-cosmwasm-schema
Advanced tools
Parser for JSON schemas generated from CosmWasm, useful for creating automated contract tooling.
parse-cosmwasm-schema
Parser for JSON schemas generated from CosmWasm, useful for creating automated contract tooling.
Add to your package.json
by using Yarn or NPM.
$ yarn add parse-cosmwasm-schema
Then, in your program:
import parseSchema from "parse-cosmwasm-schema";
// any schema generated by CosmWasm
const schema = {
...
};
parseSchema(schema).then(parseTree => {
// the resultant parse tree is JSON
console.log(JSON.stringify(parseTree, null, 2));
})
Smart contracts on Terra (powered by CosmWasm) use JSON messages to define interactions. Each smart contract defines its interface through a JSON schema which specifies the structure and expected format of the messages that it can respond to. By reading the JSON schema, we are able to extract information which can be used to automatically generate tools that would otherwise require tedious manual labor.
parse-cosmwasm-schema
provides an algorithm that reads in a CosmWasm-generated JSON schema and produces a JSON-based parse tree of the original Rust data. Because it is written in TypeScript, it also provides a set of types that are helpful for walking the parse tree, for writing your own custom solutions.
The output is a parse tree represented as a JSON object, which can be one of several NodeType
definitions.
All nodes follow the format:
{
"type": "<node-type>",
"value": {
"title": "<node-title>", // or undefined
"description": "<node-description>", // or undefined
"ref": "<ref-name>" // if derived from a resolved reference, will be a string.
... // additional properties depending on node type
}
}
none
boolean
string
integer
The following node types can include other node types.
enum
struct
optional
array
vec
tuple
parse-cosmwasm-schema
is used to power a number of useful contract tools.
Name | Description |
---|---|
gen-contract-docs | Generates documentation for smart contract messages |
gen-contract-sdk | Generates Python and JavaScript SDKs for smart contracts |
gen-contract-cli | Generates a command-line interface for smart contract |
gen-contract-ui | Web-based UI tool for interacting with smart contracts |
Made something cool but not on here? Make a pull request to add it to the list.
Name | Description |
---|---|
Currently no community tools -- be the first one! |
FAQs
Parser for JSON schemas generated from CosmWasm, useful for creating automated contract tooling.
The npm package parse-cosmwasm-schema receives a total of 25 weekly downloads. As such, parse-cosmwasm-schema popularity was classified as not popular.
We found that parse-cosmwasm-schema demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.