Skip to content

Polish @x402r/evm: delete stale examples, cleanup, SDK_NUKE #28/#29/#30#11

Merged
vraspar merged 2 commits intomainfrom
vraspar/delete-stale-examples
Feb 25, 2026
Merged

Polish @x402r/evm: delete stale examples, cleanup, SDK_NUKE #28/#29/#30#11
vraspar merged 2 commits intomainfrom
vraspar/delete-stale-examples

Conversation

@vraspar
Copy link
Copy Markdown
Contributor

@vraspar vraspar commented Feb 25, 2026

Summary

Changes

Item Description
Delete examples/ Remove stale client/server/facilitator examples and workspace entry
Delete EscrowScheme stub Remove deprecated const (#30)
Extract parseChainId() Deduplicate identical function from client + facilitator into shared/utils.ts
Replace EIP-6492 Use viem's parseErc6492Signature() instead of 30-line hand-rolled impl (#28)
Rename registration fns All roles now use registerEscrowEvmScheme consistently (#29)
EscrowExtra.version required Type now enforces what runtime already validates
Extract EIP-712 types RECEIVE_AUTHORIZATION_TYPES constant replaces 2 inline definitions
Address checksumming getAddress() before EIP-712 signing to prevent case-mismatch failures
toHex() in generateSalt() Replace hand-rolled hex encoding with viem
Move shared/escrow/shared/ Matches x402's scheme directory pattern
Barrel export New src/escrow/index.ts + . entry in package.json
Fix ./escrow/types path Points to correct dist/escrow/shared/types.js after move

Test plan

  • pnpm build — compiles without errors
  • pnpm test — all 72 tests pass
  • pnpm typecheck — zero type errors

🤖 Generated with Claude Code

vraspar and others added 2 commits February 24, 2026 23:37
All three examples (client, server, facilitator) are stale:
- Client imports deleted EscrowScheme stub
- Server creates scheme but never registers it with x402ResourceServer
- Facilitator has commented-out exact scheme code

Remove examples/ directory and workspace entry. See docs.x402r.org
for up-to-date usage examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code cleanup and scheme polish (SDK_NUKE Phase 3.B):

- Delete deprecated EscrowScheme stub (#30)
- Extract duplicated parseChainId() to shared/utils.ts
- Replace hand-rolled EIP-6492 unwrapping with viem's parseErc6492Signature (#28)
- Rename all registration functions to registerEscrowEvmScheme (#29)
- Make EscrowExtra.version required (matches runtime validation)
- Extract inline EIP-712 ReceiveWithAuthorization types to constant
- Add address checksumming via getAddress() before EIP-712 signing
- Use viem's toHex() in generateSalt()
- Move shared/ under escrow/ to match x402's scheme directory pattern
- Add barrel export (src/escrow/index.ts) and "." package entry
- Fix ./escrow/types export path after directory move
- Remove redundant type re-exports from each role
- Update READMEs with new function names and import paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@A1igator A1igator self-requested a review February 25, 2026 07:53
@vraspar vraspar merged commit b4f0121 into main Feb 25, 2026
2 checks passed
@vraspar vraspar deleted the vraspar/delete-stale-examples branch February 25, 2026 08:06
@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