Skip to content

Liqwid-Labs/polymer

Repository files navigation

Polymer

Keep your pipes leak-free!

Polymer is a library for generating Rust types from a CIP-57 blueprint schema.

Implementation status

CIP-57 is largely implemented. There are some minor quality of life improvements that could be made, however. Example, rationals are currently not recognized as a special case, and so the user will need to manually convert them to num_rational.

Currently, Option types from Aiken are converted to AikenOption<T>, which needs to be converted to Option<T> manually.

Usage

// Define a module to contain the generated types
mod my_module {
polymer::blueprint!("static/plutus.json");
}

// Use the generated types elsewhere in your code
use my_module::root::*;
let my_datum = MyDatum { field: 10 };

// Encoding works with `minicbor`
let encoded = hex::encode(minicbor::to_vec(my_datum).unwrap());

// Yay, we have some CBOR!

About

CIP-57 macro for Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published