Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| import { useEffect, useMemo, useState } from "react"; | ||
|
|
||
| import { useChain } from "../../hooks"; | ||
| import { useChain } from "../../hooks/useChain"; |
There was a problem hiding this comment.
This is to eliminate the circular import.
| setError(err instanceof Error ? err.message : "Request failed."); | ||
| } finally { | ||
| setIsLoading(false); | ||
| } |
There was a problem hiding this comment.
Solana demo missing state reset before fetch
Low Severity
SolanaX402FetchDemo's execute callback is missing setData(null) at the start and in the catch block, unlike the equivalent EvmX402FetchDemo which resets data in both places. This means stale response data from a prior successful request will persist visually alongside a new error message on subsequent failures.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| updatedAt: new Date().toISOString(), | ||
| }, | ||
| }); | ||
| }); |
There was a problem hiding this comment.
/weather-plain skips payment verification entirely
Medium Severity
The /weather-plain endpoint only checks whether an x-payment or payment-signature header exists — it never validates the payment through resourceServer. Any request with an arbitrary non-empty header value bypasses the 402 gate and receives the protected content for free, making this endpoint unsuitable for verifying the client-side x402 v2 body-based shim actually works end-to-end.


Motivation and Context
Jira Link: https://consensyssoftware.atlassian.net/browse/EMBED-143?atlOrigin=eyJpIjoiYzYxN2I1NDE1OTQ4NDY0NjhlOGUzMzA4YTc0ZjUzMDMiLCJwIjoiaiJ9
Description
@web3auth/no-modaland exposeuseX402Fetchfrom both theno-modalandmodalReact/Vue entry points.402responses that return payment requirements in the response body.x402-test-server, a wagmi React example, and Vue demo updates for Base Sepolia and Solana network switching.Changes
packages/no-modal/src/base/x402, including helpers to build EVM/Solana payment-aware fetch clients.useX402Fetchhooks for React and Vue in@web3auth/no-modal, then re-export the hook and related types through@web3auth/modal.402responses into thePAYMENT-REQUIREDheader so the underlying@x402/fetchclient can handle servers that return payment requirements in the JSON body.demo/x402-test-server, an Express app with free and paid endpoints like/weather,/premium-data, and/weather-plainfor testing x402 flows against EVM and Solana networks.demo/wagmi-react-appto include anX402demo component, Base Sepolia chain config, and an env var for the x402 test content URL.demo/vue-app-newto expose x402 actions in the dashboard, add Base Sepolia and Solana network switching helpers, and include the required config, translation, and env updates.Test Plan
demo/x402-test-serverwith valid EVM and Solana recipient addresses.useX402Fetchsucceeds fromdemo/wagmi-react-appon Base Sepolia.useX402Fetchsucceeds fromdemo/vue-app-newfor both EVM and Solana wallets./weather-plainreturns a body-based402response that is still handled correctly by the client shim.@web3auth/no-modaland@web3auth/modal.Recordings (if appropriate):
React Hook
Screen.Recording.2026-03-20.at.7.52.48.PM.mov
Vue Composable
Screen.Recording.2026-03-20.at.7.51.42.PM.mov
Types of changes
Checklist:
AI Reviews
x402_auth_2.md
x402_auth_1.md
Note
Medium Risk
Adds new x402 payment-flow demo code (including an Express server with paid endpoints) and updates demo chain configuration; risk is mainly around dependency/lockfile churn and correctness of payment/chain-switching demo flows.
Overview
Adds end-to-end x402 payment-fetch demo coverage across the Vue and wagmi React demo apps, including new UI components that call
useX402Fetch, allow configuring the test URL viaVITE_APP_X402_TEST_CONTENT_URL, and (for EVM) guide switching to Base Sepolia.Introduces a new
demo/x402-test-serverExpress app with free and paid routes (e.g./weather,/premium-data,/weather-plain) protected by@x402/expressmiddleware and configurable EVM/Solana recipients/networks via env vars.Updates demo chain configuration to include Base Sepolia (
0x14a34/ 84532) and broadens the Vue demo’s default chain list; also refreshes demo lockfiles to include the new@x402/*dependencies and adjusts.gitignoreto ignore.npmrc.Written by Cursor Bugbot for commit a875599. This will update automatically on new commits. Configure here.