generate_cpi_crate!() { /* proc-macro */ }
Expand description

Generates an Anchor CPI crate from a JSON file.

Arguments

  • input - Path to a JSON IDL relative to the crate’s the Cargo.toml.

Examples

anchor_generate_cpi_crate::generate_cpi_crate!("../../examples/govern-cpi/idl.json");
declare_id!("GjphYQcbP1m3FuDyCTUJf2mUMxKPE3j6feWU1rxvC7Ps");
let _my_governor = GovernanceParameters {
    quorum_votes: 0,
    timelock_delay_seconds: 0,
    voting_period: 0,
    voting_delay: 0,
};