@deployoor/wagmi
v0.3.0
Published
Source deployoor deployments into @wagmi/cli — typed contract objects for your app.
Maintainers
Readme
@deployoor/wagmi
A
@wagmi/cliplugin that sources contracts from a deployoordeployments/folder.
deployoor deploys your contracts and records each one as deployments/<chainId>-<network>/<Contract>.json. This plugin reads that folder and hands the contracts to @wagmi/cli, which generates the ABIs, per-chain address maps, and framework bindings. You write addresses nowhere — they come from your own deploys.
Install
pnpm add -D @deployoor/wagmi @wagmi/cliUsage
// wagmi.config.ts
import { defineConfig } from "@wagmi/cli";
import { actions } from "@wagmi/cli/plugins";
import { deployments } from "@deployoor/wagmi";
export default defineConfig({
out: "src/generated.ts",
plugins: [
deployments({ path: "./deployments" }), // default: './deployments'
actions(), // or react(), or nothing
],
});wagmi generateThe same deployment name across chains is folded into a single entry whose address is a { [chainId]: address } map — exactly the shape @wagmi/cli wants for multi-chain contracts. If records with the same deployment name have different ABIs, generation fails so you can give them distinct deploymentName values instead of silently getting the wrong type.
API
deployments(options?)
Returns a @wagmi/cli Plugin.
options.path— path to the deployoordeployments/folder. Default'./deployments'.
readDeploymentContracts(deploymentsPath)
The underlying reader, exported for tooling and tests. Walks the folder, validates each JSON record, and returns @wagmi/cli ContractConfig[] grouped by deployment name. JSON files that aren't deployoor deployment records are skipped.
License
MIT
