@naculus/connect-appkit-react 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -88,6 +88,27 @@ authorizations and refreshes after `revoke(entry)`. Inspect the returned
88
88
  verifies its settlement in the background. Pending verification retries five
89
89
  times at four-second intervals by default; pass `verifyRetry` to change that.
90
90
 
91
+ For x402 with the connected browser wallet, build the paying fetch from the
92
+ hook's signer. Render the component that calls `usePaymentFetch` only after
93
+ `pay` is available, because `usePaymentFetch` accepts a paying fetch rather
94
+ than `null`:
95
+
96
+ ```tsx
97
+ const { signer } = useX402Signer();
98
+ const pay = useMemo(
99
+ () => signer && createX402Fetch({ signer }),
100
+ [signer],
101
+ );
102
+
103
+ if (!pay) return null;
104
+ return <PaidResource pay={pay} />;
105
+
106
+ function PaidResource({ pay }: { pay: PaymentFetch }) {
107
+ const { payFetch } = usePaymentFetch(pay);
108
+ // Call payFetch(url) from an event or effect.
109
+ }
110
+ ```
111
+
91
112
  ### Ask before executing
92
113
 
93
114
  ```tsx