feat(sdk): compatibility validation harness adapter-based integrations + documentations - v1#210
Closed
zama-cremaud wants to merge 70 commits intoprereleasefrom
Closed
feat(sdk): compatibility validation harness adapter-based integrations + documentations - v1#210zama-cremaud wants to merge 70 commits intoprereleasefrom
zama-cremaud wants to merge 70 commits intoprereleasefrom
Conversation
…s (v1) Standalone Node.js tool for external integrators (Crossmint, Openfort, Turnkey, etc.) to validate their signing stack against Ethereum EOA, EIP-712, and the Zama SDK. Integrator plugs their signer into src/signer/index.ts, runs `npm test`, and gets a structured compatibility report. Four tests: EIP-712 ecrecover validation, transaction broadcast, Zama SDK credentials.allow() flow (RelayerNode + Sepolia), and signer type detection. Token address auto-detected from the on-chain registry — no extra .env config. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the vague "invalid private key" error from viem with a clear message when the key is missing or still the placeholder value from .env.example. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…vulnerability Upgrades @zama-fhe/sdk from 2.3.0-alpha.2 to 2.3.0-alpha.4 (latest published). Runs npm audit fix to patch Vite ≤7.3.1 path traversal/file read CVEs (GHSA-4w7w-66w2-5vf9, GHSA-v2wj-q39q-566r, GHSA-p9ff-h696-f583) — Vite bumped from 7.3.0 to 7.3.2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Signer interface: `signTransaction` is now optional; add optional `writeContract` for MPC / smart-account wallets - Signer profile detection runs first (never blocking) and classifies wallets as EOA, MPC, Smart Account, or Unknown - Report is split into two sections (Ethereum Compatibility / Zama SDK Compatibility); final verdict is based solely on the Zama section so MPC wallets that skip the raw-transaction test still pass - Transaction test: SKIP gracefully when only `writeContract` is provided - Add `examples/crossmint/`: full MPC adapter + compatibility report Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…obustness
Env & docs
- .env.example: clarify PRIVATE_KEY is EOA-only; add CROSSMINT_* vars section
including CROSSMINT_WALLET_ADDRESS (skip API lookup if address is known)
- README: full rewrite — separate EOA / MPC quickstarts, full Signer interface
docs with async-address pattern, env vars table split by adapter, CI/CD
GitHub Actions snippet, troubleshooting section for common failure modes
- COMPATIBILITY.md: add CROSSMINT_WALLET_ADDRESS to setup; update key findings
Crossmint adapter fix (race condition)
- Replace fragile "throw then Object.defineProperty" pattern with a proper
_address variable + exported `ready: Promise<void>`
- Add CROSSMINT_WALLET_ADDRESS env var: if set, address is available
synchronously from startup with no API call
- If not set, address resolves via GET /wallets/{locator} before tests start
Harness: await `ready` before first test
- signerType.test.ts now imports the signer module and, in beforeAll, awaits
`signerModule.ready` if it is a Promise — guarantees signer.address is
available synchronously for the entire test suite
- src/signer/index.ts: document the `ready` export convention for custom
MPC adapters; add pointer to examples/crossmint/signer.ts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Instead of copying an adapter file into src/signer/index.ts, integrators
can now point to any signer file without touching the harness source:
SIGNER_MODULE=./examples/crossmint/signer.ts npm test
vitest.config.ts intercepts imports of src/signer/index.{ts,js} at the
Vite alias level and transparently redirects them to the specified file.
Without SIGNER_MODULE the harness falls back to the built-in EOA signer.
Also adds a convenience npm script:
npm run test:crossmint → SIGNER_MODULE=./examples/crossmint/signer.ts
Docs updated: README quickstart replaces cp step with env var; COMPATIBILITY.md
setup section renumbered and run command updated.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ull specifier Rollup alias with a regex does id.replace(find, replacement) — not a full substitution. The previous regex /[/\\]signer[/\\]index\.(ts|js)$/ only matched the suffix, producing paths like ../abs/... instead of the intended absolute path. Prefixing with ^.* ensures the entire specifier is captured and replaced. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ndling Crossmint adapter: - signTypedData: use a bigIntReplacer in JSON.stringify so that uint256/uint128 fields in EIP-712 messages (which are BigInt in JS) are serialized as decimal strings rather than throwing "Do not know how to serialize a BigInt" - ready: attach a no-op .catch() to prevent Node.js unhandled rejection warnings when the initialisation promise rejects before beforeAll has a chance to await it signerType.test.ts: - Wrap `await ready` in try/catch so an init failure does not skip the test suite; individual tests will still fail with descriptive errors - Wrap `signer.address` in recordProfile call in try/catch to handle the case where async address resolution failed (falls back to "(unresolved)") Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…roadmap Covers background, problem statement, architecture, v1 issues/limitations, v2 requirements, and the end-goal (npx zero-install compatibility check). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…SUMMARY.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Public API Changes✅ No public API changes detected. |
Coverage Report
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new compatibility validation harness for Zama SDK integrations, built for real-world wallet/custody architectures (EOA, MPC, API-routed systems, and smart-account-like setups).
What this adds
PASS,FAIL,UNTESTED,UNSUPPORTED,BLOCKED,INCONCLUSIVE.doctorfor preflight checks,validatefor CI gating.Outcome
This introduces a practical, honest compatibility harness that helps partners quickly understand what is validated, what is compatible, what is blocked by infrastructure, and what remains out of scope.