Thanks for contributing to Chainwright. This guide covers how to set up your environment, run checks, and open a pull request.
- Node.js
>=22 pnpm(project usespnpm-lock.yaml; CI uses pnpm 10)- Chromium for Playwright:
pnpm exec playwright install chromium
Optional for local e2e workflows that mirror CI:
xvfb(Linux/headful CI-style runs)- Foundry (only needed for some dapp/e2e scenarios)
If you are on MacOS or Linux, you don't have to do anything extra. For windows users, you have to do the following:
- Biome (Formatting/Linting): Install Biome in your system's root via
npm i -g @biomejs/biome
- Fork and clone the repo.
- Install dependencies:
pnpm install
This repository uses two main long-lived branches:
maindev(base branch)
When contributing:
- Create your feature/fix branch from
dev. - Run the changeset script to log your changes.
pnpm run changeset - Open pull requests targeting
dev(notmain).
src/: core library, wallet modules, CLItests/e2e/: end-to-end wallet and dapp specstests/wallet-setup/: setup files used to build wallet cachescripts/: helper tooling (including wallet scaffolding)examples/: Contains wallet setup examples
pnpm run lint- Biome lint checks (src)pnpm run format- formatsrcwith Biomepnpm run tests- unit tests (Vitest, excludes e2e specs)pnpm run dev- setup wallet cachepnpm run build- compile package with tsuppnpm run tests:e2e:ui- open Playwright UI modepnpm run tests:e2e:debug- run e2e in debug mode
- Chainwright e2e tests run with
workers: 1to avoid extension conflicts. - Wallet extensions require headed Chromium.
- In CI/Linux you usually run with
xvfb-runto provide a virtual display. - Build wallet cache before e2e runs:
pnpm run dev
- The Dapp tests make use of the deployed
https://chainwright-dapp.vercel.app/app.
Use the wallet scaffolder:
pnpm run add:wallet: Specify the wallet name
pnpm run add:wallet foxtrotThen implement wallet-specific actions/selectors and add/update tests in tests/e2e and tests/wallet-setup.
This repository uses Changesets for versioning and releases.
When your PR changes behavior that should be released, add a changeset:
- Run
pnpm run build - Run
pnpm run changeset - Select the version bump type
- Write a short summary of the change
- Run
pnpm run version-package - Commit the generated file under
Release/versioning is handled by CI using Changesets.
Before opening or updating a PR:
- Run
pnpm run lint - Run
pnpm run tests - Run relevant e2e tests when wallet/dapp behavior changes
- Add/update docs (README, inline docs) if behavior or APIs changed
- Add a changeset for releasable changes
- Keep PRs focused and small when possible.
- Include clear descriptions of user impact and test coverage.
- Link related issues.
- If your change affects multiple wallets, call that out explicitly in the PR description.
If something is unclear, open an issue or draft PR with your proposal and context. Early feedback is welcome.