Flatten
Use thru abi flatten when you want one self-contained ABI YAML file for review, diffing, or downstream tooling.
Use This When
Section titled “Use This When”- you want to remove the need for separate local include directories
- you need a single-file ABI artifact before another tooling step
- you want a reviewable snapshot of a multi-file ABI package
Choose another ABI command when:
- you want an on-chain publishing artifact that enforces network rules: Prep for Publish
- you want a JSON dependency manifest instead of YAML: Bundle
Syntax
Section titled “Syntax”thru abi flatten \ --file <FILE> \ --output <FILE> \ [--include-dir <DIR>...] \ [--verbose]What It Does
Section titled “What It Does”- loads the root ABI file
- resolves imports using the supplied include directories
- writes one flattened YAML file to
--output
Minimal Pattern
Section titled “Minimal Pattern”thru abi flatten \ --file ./program.abi.yaml \ --include-dir ./abi \ --output ./dist/program.flat.abi.yaml \ --verboseflattenis local-file oriented. It does not publish anything on-chain.--verboseis useful when you want to confirm which include directories were actually used.- If the next step is publishing, move to Prep for Publish instead of stopping at a flattened file.