anchor-gen-mod

Crates.ioanchor-gen-mod
lib.rsanchor-gen-mod
version0.3.3
sourcesrc
created_at2023-08-01 12:31:05.773403
updated_at2023-08-01 13:44:32.565113
descriptionGenerates an Anchor CPI crate from a JSON IDL.
homepage
repositoryhttps://github.com/AlphaPrime8/anchor-gen
max_upload_size
id931837
size3,128
AlphaPrime8 (AlphaPrime8)

documentation

README

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

Commit count: 39

cargo fmt