Building
Build command
To construct the project, execute:
Build process
The build sequence performs these actions:
-
Clean previous builds
Eliminates the output directory and generated types for a fresh build.
-
Generate TypeScript types from ABIs
Leverages TypeChain to produce TypeScript types from contract ABIs located in the
abi/ directory.
-
Compile TypeScript
Transforms all TypeScript source files into JavaScript within the
dist/ directory.
-
Copy schema files
Transfers the JSON schema file necessary for runtime configuration validation.
TypeChain configuration
TypeChain produces type-safe contract interfaces using this command:
- Target: ethers-v5 (generates types compatible with ethers.js v5)
- Output:
src/types/generated/
- Input: All JSON files in the
abi/ directory
Output directory
Build output is organized in the dist/ directory:
Build artifacts
The build process generates these outputs:
- Compiled JavaScript: All
.ts files transformed to .js in dist/
- Type declarations:
.d.ts files for TypeScript consumers
- Contract types: Generated TypeScript interfaces for smart contracts
- JSON schemas: Configuration validation schemas
Entry point
The primary entry point is configured in package.json:
Prepare hook
A prepare hook executes post-installation:
This runs:
husky install - Configures git hooks
yarn typechain - Produces contract types
yarn configschema - Generates configuration schema
Building for production
For production environments:
- Execute the complete build:
yarn build
- The
dist/ directory contains the deployable application
- Verify all dependencies in
package.json are installed in production
Docker builds
To construct the Docker image:
The Dockerfile manages the build workflow internally.Last modified on March 4, 2026