Coda by Ian Macalinao
    Preparing search index...
    • Creates a Codama root node from multiple Anchor IDLs.

      This function takes an array of Anchor IDL objects and converts them into a single Codama root node that can be used with Codama visitors for code generation and AST transformation.

      Parameters

      • idls: AnchorIdl[]

        An array of Anchor IDL objects to convert

      Returns RootNode

      A Codama root node containing all programs from the IDLs

      If no IDL files are provided

      If no program nodes could be created

      import { rootNodeFromAnchorIdls } from "@macalinao/codama-nodes-from-anchor-x";
      import { visit } from "codama";

      const idls = [idl1, idl2, idl3];
      const root = rootNodeFromAnchorIdls(idls);

      // Use with Codama visitors
      visit(root, myVisitor);
      • Supports both Anchor IDL v0.0.0 and v0.1.0 formats
      • The first IDL becomes the main program, others are additional programs
      • Use this when you need to work with multiple related programs together