The Anchor IDL containing the instruction definitions with potentially nested accounts
A visitor that transforms all instruction nodes to have flattened account structures
// Use with a single program
const programNode = programNodeFromAnchor(idl);
const visitor = instructionAccountsDedupeProgramVisitor(idl);
const transformedProgram = visit(programNode, visitor);
// Or compose with other visitors
const composedVisitor = mergeVisitor(
instructionAccountsDedupeProgramVisitor(idl),
otherProgramVisitor(),
);
Creates a Codama program visitor that deduplicates and flattens nested instruction accounts from an Anchor IDL.
This is a program-level visitor that can be composed with other visitors. It transforms instruction nodes to have flattened account structures, removing nested account groups.