#anchor #idl #solana #json #generate #cpi #macro

macro idl-macro

Generates an Anchor CPI crate from a JSON IDL

1 unstable release

0.1.0 Jun 5, 2022

#45 in #generates

Apache-2.0

9KB
171 lines

idl-macro

Generates an Anchor CPI crate from a JSON IDL.

Usage

In a new crate, write:

idl_macro::generate_cpi_crate!("src/idl.json");

declare_id!("GjphYQcbP1m3FuDyCTUJf2mUMxKPE3j6feWU1rxvC7Ps");

This will generate a fully functional Rust CPI client for your IDL.

License

Apache 2.0


lib.rs:

Generates an Anchor crate interface from a JSON IDL.

Dependencies

~3.5MB
~80K SLoC