Simple anchor IDL Parser
A simple parser for partial part of anchor IDL without importing anchor types or causing build panics for WASM targets.
It only parses the address of the program and the instructions containing the instruction name and the discriminant which are useful for the scope of the wallet-adapter templates.
Macro for creating a path to the IDL
The frontend is in the same workspace as the target directory which contains the anchor IDL directory.
The directory is in path ../../target/idl/.
Pass the name of the program from /programs so that the file is located successfully.
Get the AnchorIdlPartialData data structure containing the IDL of an anchor example called temp
use *;
const IDL: &str = idl_path!;
If the directory is different you can use idl_custom_path macro:
use *;
const IDL: &str = idl_custom_path!;
The AnchorIdlPartialData
Parsed IDL is stored within a AnchorIdlPartialData struct.
LICENSE
MIT OR APACHE-2.0