Reverts wagmi.config.ts to the pre-existing simpler shape (hardhat
plugin auto-discovers artifacts) and drops our hand-rolled readFileSync
bootstrap. The plugin emits ABIs for every compiled contract; unused
ones are tree-shaken out of the production bundle, and the file itself
is gitignored so the extra bytes never hit the repo.
The plugin runs `npx hardhat compile` internally, which loads
hardhat.config.ts at import time and throws when ALCHEMY_API_KEY is
missing — env vars from our wrapper script don't propagate into the
plugin's subprocess. Fix: prewagmi:gen now bootstraps a placeholder
.env inside the submodule (gitignored there via *.env), instead of
running our own `hardhat compile` with inline env vars.
- wagmi.config.ts: hardhat({ project: 'p2pix-smart-contracts' }), no
explicit contracts/loadAbi
- package.json: contracts:compile -> contracts:setup
(bun install + create .env if absent); the wagmi hardhat plugin
handles the actual compile
Path revert (reduces churn / preserves existing imports):
- wagmi.config.ts: out -> src/blockchain/abi.ts (was src/generated.ts)
- Restore the 4 import sites (sellerMethods, events, provider,
BuyerSearchComponent) to import from './abi' / '@/blockchain/abi'
- .gitignore: ignore src/blockchain/abi.ts (was src/generated.ts)
The file keeps its original location and is no longer committed — it is
regenerated from the smart-contracts submodule artifacts on every
prestart via `bun run wagmi:gen`.
Infra polish:
- package.json: contracts:compile uses pushd/popd (instead of cd) so the
shell returns to the project root after the submodule build, even when
the script is the leaf of a longer chain
- .gitmodules: zkPix submodule pinned to `dev`
The 58KB src/blockchain/abi.ts was the output of the legacy hardhat-based
wagmi config and was being committed verbatim. Since wagmi.config.ts now
emits src/generated.ts (gitignored, regenerated on every prestart via
`bun run wagmi:gen`), keeping the old artifact in the tree was just dead
weight.
- Remove src/blockchain/abi.ts from tracking
- Repoint 4 imports (sellerMethods, events, provider, BuyerSearchComponent)
from `@/blockchain/abi` / `./abi` to `@/generated`
- contracts:compile now injects ALCHEMY_API_KEY=placeholder + a default
test MNEMONIC so hardhat.config.ts can load without a manual .env in
the submodule (matches the placeholder values used in p2pix-front-end's
submodule .env)
- wagmi.config.ts: read ABIs from p2pix-smart-contracts/artifacts/contracts
(P2Pix, Reputation, MockToken) and emit src/generated.ts with the
@wagmi/cli actions plugin
- package.json: add scripts
* contracts:compile — installs submodule deps + runs `hardhat compile`
* wagmi:gen — runs @wagmi/cli to (re)generate src/generated.ts
* prewagmi:gen — chains contracts:compile before wagmi:gen
* prestart — runs wagmi:gen, so `bun start` always has fresh ABIs
- .gitignore: ignore src/generated.ts (regenerated on every prestart)
Note: GraphQL/subgraph codegen is intentionally out of scope here — it
will land in its own branch.
- Standardized the use of quotes and spacing in various files.
- Removed unnecessary line breaks and trailing spaces in components.
- Improved the structure of computed properties and methods for better clarity.
- Enhanced the consistency of prop definitions and emit events in Vue components.
- Updated the GraphQL composable to streamline error handling and data processing.
- Refactored network configuration files for better organization and readability.
- Cleaned up model files by removing redundant lines and ensuring consistent formatting.
- Adjusted router configuration for improved readability.
- Enhanced utility functions for better maintainability and clarity.