Closed
Conversation
When the API returns HTTP 402 and a WalletConnect wallet session is active, automatically construct the x402 payment payload (EIP-712 TransferWithAuthorization), send it to the wallet for signing, and retry the request with the Payment-Signature header. - New src/x402.js module with EIP-712 typed data construction and walletconnect CLI integration - Intercept 402 responses in api.js request() with automatic retry - Add --no-auto-pay flag to disable automatic payment - 15 new tests covering x402 functions and auto-pay flow Co-Authored-By: Claude Opus 4.6 <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
TransferWithAuthorizationtyped data, signs viawalletconnect sign-typed-data, and retries the request with thePayment-Signatureheader--no-auto-payflag to disable automatic payment; existing--x402-payment-signaturemanual override still worksChanges
src/x402.js(new) — x402 payment construction, EIP-712 typed data, walletconnect CLI integrationsrc/api.js— Intercept 402 responses inrequest(), auto-sign and retry when wallet connectedsrc/cli.js— Add--no-auto-payglobal optionTest plan
npm test)--no-auto-paydisables auto-payment--x402-payment-signaturemanual override skips auto-pay🤖 Generated with Claude Code