6 releases

0.3.1 Sep 27, 2022
0.3.0 Jul 26, 2022
0.2.0 Jul 24, 2022
0.1.2 Jun 6, 2022

#1 in #anchor-cpi

Download history 196/week @ 2023-11-20 130/week @ 2023-11-27 156/week @ 2023-12-04 156/week @ 2023-12-11 249/week @ 2023-12-18 200/week @ 2023-12-25 235/week @ 2024-01-01 489/week @ 2024-01-08 289/week @ 2024-01-15 291/week @ 2024-01-22 600/week @ 2024-01-29 227/week @ 2024-02-05 221/week @ 2024-02-12 421/week @ 2024-02-19 344/week @ 2024-02-26 232/week @ 2024-03-04

1,241 downloads per month
Used in 17 crates

Apache-2.0

4KB

anchor-gen

Generates a crate for cross-program invocations to an Anchor program from a JSON IDL.

Usage

In a new crate, write:

anchor_gen::generate_cpi_crate!("../../examples/govern-cpi/idl.json");

declare_id!("GjphYQcbP1m3FuDyCTUJf2mUMxKPE3j6feWU1rxvC7Ps");

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

More examples can be found in the examples/ directory.

License: Apache-2.0


lib.rs:

Generates a crate for cross-program invocations to an Anchor program from a JSON IDL.

Usage

In a new crate, write:

anchor_gen::generate_cpi_crate!("../../examples/govern-cpi/idl.json");

declare_id!("GjphYQcbP1m3FuDyCTUJf2mUMxKPE3j6feWU1rxvC7Ps");

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

More examples can be found in the examples/ directory.

Dependencies

~4MB
~85K SLoC