feat: x402 v2 upgrade + unit/identity fixes#153
Merged
Conversation
Replace x402/client with @x402/core and @x402/evm across client, base, and x402 packages. selectPaymentRequirements inlined (v2 doesn't export it). BaseAccount uses ExactEvmScheme + x402Client for signing. Handles both v1 (maxAmountRequired) and v2 (amount) field formats. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…TURE) - X402PaymentOption uses 'amount' not 'maxAmountRequired' - detectProtocol detects PAYMENT-SIGNATURE (v2) and X-PAYMENT (v1 fallback) - All tests updated to v2 field names and x402Version: 2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Middleware: X402 credential identity falls back to OAuth sub (matches charge) - omniChallenge: includes EIP-712 domain params (name/version) in X402 accepts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…02/evm) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Read PAYMENT-SIGNATURE header (v2) in x402Wrapper and baseAccount - x402Wrapper uses challenge x402Version (not hardcoded 2) - Stronger isX402Challenge type guard (checks x402Version + accepts) - USDC addresses + CAIP-2 networks centralized in @atxp/common/constants - Identity fallback: || instead of ?? (empty string falls through) - Inline getAtomicAmount (removes needless indirection) - PAYMENT-SIGNATURE detection tests in protocol.test.ts - EIP-712 domain comment noting USDC v2 contract dependency - TODO comments for x402 client bootstrap dedup Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ents Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Upgrades x402 from v1 to v2 packages and fixes unit/identity mismatches for on-chain settlement.
@x402/core+@x402/evmreplacex402v1 across client, base, x402 packagesamount(notmaxAmountRequired), CAIP-2 networks, x402Version 2PAYMENT-SIGNATUREheader detection (v2) alongsideX-PAYMENTfallbackE2E Verified
X402 on Base mainnet:
0x23f9260e913ca98d04c4496aaf4f2eff65dce2ef8446bbc5216e4e281b79b169🤖 Generated with Claude Code