Skip to content

Generation to trait-based collection (Codama integration) #4288

@nutafrost

Description

@nutafrost

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions