#solana #solana-anchor #anchor #declare-id #json #anchor-gen

clockwork-anchor-gen

Generates an Anchor CPI crate from a JSON IDL

2 releases

0.3.2 Apr 10, 2023
0.3.1 Mar 31, 2023

#2 in #anchor-gen

Download history 65/week @ 2025-01-31 164/week @ 2025-02-07 73/week @ 2025-02-14 84/week @ 2025-02-21 65/week @ 2025-02-28 66/week @ 2025-03-07 110/week @ 2025-03-14 64/week @ 2025-03-21 39/week @ 2025-03-28 25/week @ 2025-04-04 73/week @ 2025-04-11 54/week @ 2025-04-18 114/week @ 2025-04-25 71/week @ 2025-05-02 36/week @ 2025-05-09 19/week @ 2025-05-16

255 downloads per month
Used in 16 crates (5 directly)

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

Dependencies

~4.5MB
~99K SLoC

OSZAR »