Skip to content

Structurally align @x402r/evm with @x402/evm#12

Merged
vraspar merged 3 commits intomainfrom
vraspar/structural-alignment-x402
Feb 26, 2026
Merged

Structurally align @x402r/evm with @x402/evm#12
vraspar merged 3 commits intomainfrom
vraspar/structural-alignment-x402

Conversation

@vraspar
Copy link
Copy Markdown
Contributor

@vraspar vraspar commented Feb 25, 2026

Summary

  • Split each role (client/server/facilitator) into scheme.ts + register.ts with barrel index.ts, matching x402's file organization pattern
  • Add typed config interfaces (EvmClientConfig, EvmResourceServerConfig, EvmFacilitatorConfig) with eip155:* wildcard defaults for client/server
  • Switch build system from tsc to tsup for dual ESM/CJS output
  • Use PaymentPayloadResult return type (from @x402/core@^2.4.0) instead of Pick<PaymentPayload, ...>
  • Lean root barrel (src/escrow/index.ts) exports only EscrowEvmScheme, remove ./escrow/types export path
  • Restructure tests from tests/ to test/unit/escrow/ matching x402 pattern

Test plan

  • pnpm typecheck — zero errors
  • pnpm build — tsup produces dist/esm/ + dist/cjs/ with .d.ts / .d.cts
  • pnpm test — all 72 tests pass
  • Verify subpath imports: @x402r/evm, @x402r/evm/escrow/client, @x402r/evm/escrow/server, @x402r/evm/escrow/facilitator

🤖 Generated with Claude Code

Split each role into scheme.ts + register.ts with barrel index.ts,
add typed config interfaces (EvmClientConfig, EvmResourceServerConfig,
EvmFacilitatorConfig) with eip155:* defaults, switch build from tsc to
tsup (dual ESM/CJS), use PaymentPayloadResult return type, lean root
barrel, and restructure tests to test/unit/escrow/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@A1igator A1igator self-requested a review February 25, 2026 09:40
A1igator
A1igator previously approved these changes Feb 25, 2026
- Switch tsconfig to ES2020 module + bundler resolution (matches x402)
- Align package.json export extensions: .mjs/.d.mts (ESM), .js/.d.ts (CJS)
- Remove "type": "module" and top-level main/module/types fields
- Drop .js extensions from all relative imports (source + tests)
- Remove unused Network import from facilitator/scheme.ts
- Remove unnecessary `as const` from tsup target
- Add optional context params (PaymentPayloadContext, FacilitatorContext)
  to match x402 SchemeNetworkClient/SchemeNetworkFacilitator interfaces

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add 4 GitHub Actions workflows: format check, lint check, unit tests (Node 20/22 matrix), lockfile validation
- Add .prettierrc (semi: false, singleQuote: true, printWidth: 100) matching x402
- Add eslint.config.js (flat config with @typescript-eslint)
- Add format:check and lint:check scripts to root and evm package.json
- Bump pnpm from 9.15.0 to 10.7.0
- Fix unused import (PAYMENT_INFO_COMPONENTS) and lint warnings in nonce.ts
- Reformat all source and test files with new prettier config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vraspar vraspar merged commit cccaf76 into main Feb 26, 2026
7 checks passed
@vraspar vraspar deleted the vraspar/structural-alignment-x402 branch February 26, 2026 04:10
@A1igator A1igator mentioned this pull request May 1, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants