The current IDL generation relies on parsing source code paths, which is fragile. We should move toward a systematic approach using traits that Codama can leverage.
Requirements:
- Define a
ToIDL trait for custom types to describe their own schema.
- Implement a traversal system where the program entry point calls instruction traits, which in turn call account traits to build the full IDL.
- Ensure support for Codama "plugins" to handle complex encoding (e.g., bit-packing/offsetting in zero-copy structs) so that the generated TypeScript/Go clients remain user-friendly.
The current IDL generation relies on parsing source code paths, which is fragile. We should move toward a systematic approach using traits that Codama can leverage.
Requirements:
ToIDLtrait for custom types to describe their own schema.