declare_program!() { /* proc-macro */ }Expand description
Declare a program module from an Anchor IDL JSON file.
Looks for idls/{name}.json by walking up from CARGO_MANIFEST_DIR.
ยงExample
โ
anchor_parser::declare_program!(my_program);This generates a module my_program containing:
IDconstant (Pubkey)typesmodule (struct/enum/alias definitions)accountsmodule (account types with discriminators + fetch)eventsmodule (event types withfrom_log)instructionsmodule (instruction builders โInstruction)constantsmodule