zksync-js is a TypeScript SDK for ZKsync cross-chain flows and helpers: deposits, withdrawals/finalization, typed zks_ RPC methods, token mapping, and contract helpers. The repository is intentionally split into adapter-agnostic src/core and adapter translation layers in src/adapters/{ethers,viem}.
For detailed guidance, start at llm/README.md.
Use these exact commands:
- Install:
bun install - Build:
bun run build - Test:
bun run test - Typecheck:
bun run typecheck - Lint:
bun run lint - Format check:
bun run format:check - Format write:
bun run format - Docs build (optional):
bun run docs:build - Docs serve (optional):
bun run docs:serve - Adapter e2e (when relevant):
bun run test:e2e:ethers,bun run test:e2e:viem
- Preserve architecture:
src/coremust stay adapter-agnostic.- Do not import
ethersorviemtypes/functions intosrc/core. - Adapters translate core abstractions into library calls.
- API Gate is mandatory for export-surface changes:
- Trigger files:
package.json(exportsortypesVersions)src/index.tssrc/core/index.tssrc/adapters/ethers/index.tssrc/adapters/viem/index.tssrc/core/types/**- Any newly exported type from those entrypoints
- If triggered, PR description must include an API Change Checklist entry, including explicit
No API changewhen applicable.
- Generated file protocol:
- Never edit generated files directly:
src/adapters/ethers/typechain/**andtypechain/**. - Regenerate using:
bun run types. - If regeneration changes outputs, include generated diffs in the same PR.
- Security and safety:
- Never commit secrets, private keys, tokens, or internal endpoints.
- Default to no network calls (no live RPC hits) during local validation.
- Network exceptions: only when explicitly requested by maintainers or when required for approved e2e execution.
- Change management:
- Ask before large refactors or dependency upgrades.
- Keep diffs minimal and scoped; avoid unrelated cleanup.
- Do not change public exports without updating docs and changelog context.
- Main public API:
- Core vs adapters:
- Examples:
- User docs:
- Agent/contributor contracts:
- Codex multi-agent config:
.codex/config.toml.codex/agents(canonical role behavior)agents/(human-readable role summaries)
- Skills are optional and should be invoked when relevant.
- Available repository skills:
- Use
$contract-interaction-patternsfor ABI edits, contract wrapper/client changes, calldata construction, and event/log decoding updates. - Do not invoke it for unrelated utility edits, docs-only formatting, or CI-only changes.
- Skill index:
.agents/skills/README.md
- Restate objective and constraints.
- Identify files to touch.
- Implement with minimal diff.
- Run verification commands.
- Update docs/contracts when public behavior or API surface changes.
-
bun run lintpasses -
bun run format:checkpasses -
bun run testpasses -
bun run typecheckpasses -
bun run docs:buildpasses when docs were touched - API checklist included when API Gate is triggered
- No secrets committed