uvd-x402-sdk 2.89.0 → 2.90.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/dist/react/index.js
CHANGED
|
@@ -3251,13 +3251,13 @@ function useBalance() {
|
|
|
3251
3251
|
};
|
|
3252
3252
|
}
|
|
3253
3253
|
function usePayment() {
|
|
3254
|
-
const { client
|
|
3254
|
+
const { client } = useX402();
|
|
3255
3255
|
const [isPaying, setIsPaying] = react.useState(false);
|
|
3256
3256
|
const [error, setError] = react.useState(null);
|
|
3257
3257
|
const [lastResult, setLastResult] = react.useState(null);
|
|
3258
3258
|
const pay = react.useCallback(
|
|
3259
3259
|
async (paymentInfo) => {
|
|
3260
|
-
if (!
|
|
3260
|
+
if (!client.getState().connected) {
|
|
3261
3261
|
throw new Error("Wallet not connected");
|
|
3262
3262
|
}
|
|
3263
3263
|
setIsPaying(true);
|
|
@@ -3274,7 +3274,7 @@ function usePayment() {
|
|
|
3274
3274
|
setIsPaying(false);
|
|
3275
3275
|
}
|
|
3276
3276
|
},
|
|
3277
|
-
[client
|
|
3277
|
+
[client]
|
|
3278
3278
|
);
|
|
3279
3279
|
const reset = react.useCallback(() => {
|
|
3280
3280
|
setError(null);
|