chore(codegen): keep src/blockchain/abi.ts as wagmi output + infra polish

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`
This commit is contained in:
2026-05-04 21:29:36 -03:00
committed by hueso
parent 4e65ab7ff0
commit 6c5c487874
8 changed files with 8 additions and 8 deletions

2
.gitignore vendored
View File

@@ -32,4 +32,4 @@ vendor/
.env
# Codegen output (regenerated by `bun run wagmi:gen`, runs on prestart)
src/generated.ts
src/blockchain/abi.ts

2
.gitmodules vendored
View File

@@ -5,4 +5,4 @@
[submodule "zkPix"]
path = zkPix
url = https://git.p2pix.co/doiim/zkPix.git
branch = feat/fake-bb-sandbox
branch = dev

View File

@@ -13,7 +13,7 @@
"lint:fix": "eslint . --fix",
"format": "prettier --write \"src/**/*.{ts,vue,json}\"",
"format:check": "prettier --check \"src/**/*.{ts,vue,json}\"",
"contracts:compile": "cd p2pix-smart-contracts && bun install && ALCHEMY_API_KEY=placeholder MNEMONIC='test test test test test test test test test test test junk' bunx hardhat compile",
"contracts:compile": "pushd p2pix-smart-contracts && bun install && ALCHEMY_API_KEY=placeholder MNEMONIC='test test test test test test test test test test test junk' bunx hardhat compile && popd",
"prewagmi:gen": "bun run contracts:compile",
"wagmi:gen": "bun ./node_modules/@wagmi/cli/dist/esm/cli.js generate"
},

View File

@@ -3,7 +3,7 @@ import { formatEther, toHex, stringToHex } from 'viem';
import type { PublicClient, Address } from 'viem';
import { Networks } from '@/config/networks';
import { getContract } from './provider';
import { p2PixAbi } from '@/generated';
import { p2PixAbi } from './abi';
import type { ValidDeposit } from '@/model/ValidDeposit';
import type { NetworkConfig } from '@/model/NetworkEnum';
import type { UnreleasedLock } from '@/model/UnreleasedLock';

View File

@@ -1,4 +1,4 @@
import { p2PixAbi } from '@/generated';
import { p2PixAbi } from './abi';
import { updateWalletStatus } from './wallet';
import {
createPublicClient,

View File

@@ -1,6 +1,6 @@
import { getContract, getPublicClient, getWalletClient } from './provider';
import { parseEther, toHex, ChainContract } from 'viem';
import { mockTokenAbi } from '@/generated';
import { mockTokenAbi } from './abi';
import { useUser } from '@/composables/useUser';
import { createParticipant } from '@/utils/bbPay';
import type { Participant } from '@/utils/bbPay';

View File

@@ -12,7 +12,7 @@ import { onClickOutside } from '@vueuse/core';
import { Networks } from '@/config/networks';
import { TokenEnum } from '@/model/NetworkEnum';
import { getContract } from '@/blockchain/provider';
import { reputationAbi } from '@/generated';
import { reputationAbi } from '@/blockchain/abi';
import { type Address } from 'viem';
// Store reference

View File

@@ -16,7 +16,7 @@ const loadAbi = (relPath: string) => {
};
export default defineConfig({
out: 'src/generated.ts',
out: 'src/blockchain/abi.ts',
contracts: [
{ name: 'P2Pix', abi: loadAbi('p2pix.sol/P2PIX.json') as never },
{