File tree Expand file tree Collapse file tree 1 file changed +0
-32
lines changed
apps/portal/src/app/payments/x402 Expand file tree Collapse file tree 1 file changed +0
-32
lines changed Original file line number Diff line number Diff line change @@ -156,38 +156,6 @@ try {
156156}
157157```
158158
159- ### React Integration
160-
161- Use with React hooks for better UX:
162-
163- ``` typescript
164- import { useActiveWallet } from " thirdweb/react" ;
165- import { useMutation } from " @tanstack/react-query" ;
166-
167- function PayableAPICall() {
168- const wallet = useActiveWallet ();
169-
170- const paidApiCall = useMutation ({
171- mutationFn : async () => {
172- if (! wallet ) throw new Error (" Wallet not connected" );
173-
174- const fetchWithPay = wrapFetchWithPayment (fetch , client , wallet );
175- const response = await fetchWithPay (' /api/paid-endpoint' );
176- return response .json ();
177- },
178- });
179-
180- return (
181- < button
182- onClick = {() => paidApiCall.mutate()}
183- disabled = {!wallet || paidApiCall.isPending }
184- >
185- {paidApiCall .isPending ? " Processing Payment..." : " Call Paid API" }
186- < / button >
187- );
188- }
189- ```
190-
191159## Server-Side Implementation
192160
193161### Basic Middleware Setup
You can’t perform that action at this time.
0 commit comments