From 21b61d34cb45a40a9830987400441011454be87d Mon Sep 17 00:00:00 2001 From: Adinath-j Date: Mon, 4 May 2026 14:16:44 +0530 Subject: [PATCH 1/6] added new module to unlock pdf, used pdf-decrypt-lite --- package-lock.json | 53 ++---- package.json | 1 + src/App.jsx | 2 + src/pages/Home/components/ToolsGrid.jsx | 33 +++- src/pages/LockPdf/LockPdf.jsx | 2 +- src/pages/Unlockpdf/Unlockpdf.jsx | 238 ++++++++++++++++++++++++ src/services/pdf.service.js | 32 ++++ 7 files changed, 318 insertions(+), 43 deletions(-) create mode 100644 src/pages/Unlockpdf/Unlockpdf.jsx diff --git a/package-lock.json b/package-lock.json index 0e24fd5..058ffc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "quickpdf", "version": "0.0.0", "dependencies": { + "@pdfsmaller/pdf-decrypt-lite": "^1.0.0", "@pdfsmaller/pdf-encrypt-lite": "^1.0.2", "@rainbow-me/rainbowkit": "^2.2.10", "@tanstack/react-query": "^5.95.2", @@ -2761,6 +2762,18 @@ "pako": "^1.0.10" } }, + "node_modules/@pdfsmaller/pdf-decrypt-lite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@pdfsmaller/pdf-decrypt-lite/-/pdf-decrypt-lite-1.0.0.tgz", + "integrity": "sha512-M/01c0QVtHYAC43Uv6IbSHlyeOiOY4zF0AzxXuugg9vsA9hVVAB1Dz4yTXo6WEP+xZV0Bc0eYxPgw+0942AQOA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "pdf-lib": "^1.17.1" + } + }, "node_modules/@pdfsmaller/pdf-encrypt-lite": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@pdfsmaller/pdf-encrypt-lite/-/pdf-encrypt-lite-1.0.2.tgz", @@ -3195,16 +3208,6 @@ } } }, - "node_modules/@reown/appkit-controllers/node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "extraneous": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@reown/appkit-pay": { "version": "1.7.8", "resolved": "https://registry.npmjs.org/@reown/appkit-pay/-/appkit-pay-1.7.8.tgz", @@ -3562,16 +3565,6 @@ } } }, - "node_modules/@reown/appkit-utils/node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "extraneous": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@reown/appkit-wallet": { "version": "1.7.8", "resolved": "https://registry.npmjs.org/@reown/appkit-wallet/-/appkit-wallet-1.7.8.tgz", @@ -3881,16 +3874,6 @@ } } }, - "node_modules/@reown/appkit/node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "extraneous": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@rolldown/binding-android-arm64": { "version": "1.0.0-rc.17", "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.17.tgz", @@ -6561,16 +6544,6 @@ } } }, - "node_modules/@walletconnect/utils/node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "extraneous": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@walletconnect/window-getters": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@walletconnect/window-getters/-/window-getters-1.0.1.tgz", diff --git a/package.json b/package.json index 81e46e5..c8a7af7 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "test:watch": "vitest" }, "dependencies": { + "@pdfsmaller/pdf-decrypt-lite": "^1.0.0", "@pdfsmaller/pdf-encrypt-lite": "^1.0.2", "@rainbow-me/rainbowkit": "^2.2.10", "@tanstack/react-query": "^5.95.2", diff --git a/src/App.jsx b/src/App.jsx index d37a03a..8167ab6 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -21,6 +21,7 @@ import { PageNumbers } from "./pages/PageNumbers/PageNumbers"; import { LockPdf } from "./pages/LockPdf/LockPdf"; import { EditPdf } from "./pages/EditPdf/EditPdf"; import { Admin } from "./pages/Admin/Admin"; +import UnlockPdf from "./pages/Unlockpdf/Unlockpdf"; function App() { return ( @@ -44,6 +45,7 @@ function App() { } /> } /> } /> + } /> diff --git a/src/pages/Home/components/ToolsGrid.jsx b/src/pages/Home/components/ToolsGrid.jsx index e840e52..2f5d909 100644 --- a/src/pages/Home/components/ToolsGrid.jsx +++ b/src/pages/Home/components/ToolsGrid.jsx @@ -15,6 +15,7 @@ import { Hash, Lock, FileEdit, + Unlock // Added the Unlock icon here } from "lucide-react"; export function ToolsGrid() { @@ -242,7 +243,7 @@ export function ToolsGrid() { >
- , +

PDF to Images @@ -367,6 +368,34 @@ export function ToolsGrid() {

+ + {/* 13. Unlock PDF Card */} + + +
+
+ +
+

+ Unlock PDF +

+

+ Remove password security from your PDF documents for easier sharing and printing. +

+
+ Open Unlock PDF +
+ +
); -} +} \ No newline at end of file diff --git a/src/pages/LockPdf/LockPdf.jsx b/src/pages/LockPdf/LockPdf.jsx index 17cd7f1..5ab61f8 100644 --- a/src/pages/LockPdf/LockPdf.jsx +++ b/src/pages/LockPdf/LockPdf.jsx @@ -45,7 +45,7 @@ export function LockPdf() { const LIMIT_MB = FREE_LIMITS.lockPdf.maxFileSizeMb; const isOverSize = !isPremium && !!file && file.size > mbToBytes(LIMIT_MB); - const isLocked = !isPremium && (isOverSize || hasReachedGlobalLimit); + const isLocked = 0; const paywallReason = hasReachedGlobalLimit ? "global" : "size"; const strength = calcStrength(password); diff --git a/src/pages/Unlockpdf/Unlockpdf.jsx b/src/pages/Unlockpdf/Unlockpdf.jsx new file mode 100644 index 0000000..ff7427e --- /dev/null +++ b/src/pages/Unlockpdf/Unlockpdf.jsx @@ -0,0 +1,238 @@ +import React, { useState } from "react"; +import { useFileStore } from "../../hooks/useFileStore"; +import { + Unlock, Eye, EyeOff, X, Loader2, + CheckCircle2, ShieldCheck, AlertTriangle, FileText +} from "lucide-react"; +import { AnimatePresence, motion as Motion } from "framer-motion"; +import { Button } from "../../components/ui/Button"; +import { UpgradeButton } from "../../components/ui/UpgradeButton"; +import { Dropzone } from "../../components/pdf/Dropzone"; +import { formatFileSize } from "../../utils/formatters"; +import { unlockPdf, getPdfPageCount } from "../../services/pdf.service"; +import { useSubscription } from "../../hooks/useSubscription"; +import { FREE_LIMITS, mbToBytes } from "../../config/limits"; + +export function UnlockPdf() { + // Using useFileStore to persist the file state across navigation + const [file, setFile] = useFileStore("UnlockPdf_file", null); + const [password, setPassword] = useState(""); + const [showPw, setShowPw] = useState(false); + const [isProcessing, setIsProcessing] = useState(false); + const [done, setDone] = useState(false); + const [error, setError] = useState(null); + const [pageCount, setPageCount] = useState(0); + + const { isPremium, isWalletConnected: isConnected, hasReachedGlobalLimit, incrementUsage } = useSubscription(); + + // Assuming FREE_LIMITS has lockPdf/unlockPdf configurations (using lockPdf limits as a baseline) + const LIMIT_MB = FREE_LIMITS.lockPdf?.maxFileSizeMb || 50; + const isOverSize = !isPremium && !!file && file.size > mbToBytes(LIMIT_MB); + const isLocked = 0; + const paywallReason = hasReachedGlobalLimit ? "global" : "size"; + + const canSubmit = !!file && password.length > 0 && !isProcessing; + + async function handleUnlock() { + if (!canSubmit) return; + + setIsProcessing(true); + setError(null); + setDone(false); + + try { + const blob = await unlockPdf(file, password); + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = `unlocked_${file.name}`; + a.click(); + URL.revokeObjectURL(url); + + await incrementUsage(); + setDone(true); + } catch (err) { + setError("Failed to unlock the PDF. Please check that the password is correct."); + console.error(err); + } finally { + setIsProcessing(false); + } + } + + function reset() { + setFile(null); + setPassword(""); + setDone(false); + setError(null); + } + + return ( +
+ + {/* ── Header ── */} +
+ + + + +

+ Unlock PDF +

+

+ Remove password security from your document entirely in the browser — nothing is uploaded to any server. +

+ + {/* global-limit banner */} + + {hasReachedGlobalLimit && !isPremium && ( + + + Free limit reached. Connect your wallet to keep going. + + )} + +
+ + {/* ── Drop zone ── */} + {!file ? ( + { + const selectedFile = f[0]; + if (!selectedFile) return; + + setFile(selectedFile); + + const count = await getPdfPageCount(selectedFile); + setPageCount(count); + + setDone(false); + }} + multiple={false} + text="Drop a locked PDF to unlock it" + /> + ) : ( + + + {/* size warning */} + + {isOverSize && !isPremium && ( + +
+ +
+ File exceeds {LIMIT_MB} MB free limit.{" "} + {formatFileSize(file.size)} uploaded. Upgrade for unlimited sizes. +
+
+
+ )} +
+ + {/* error */} + {error && ( +
+ {error} +
+ )} + +
+ + {/* File info row */} +
+
+ +
+
+

{file.name}

+

{formatFileSize(file.size)} • {pageCount} pages

+
+ +
+ + {/* Password field */} +
+ +
+ { setPassword(e.target.value); setDone(false); setError(null); }} + placeholder="Enter the password to unlock..." + className="w-full h-12 px-4 pr-12 bg-zinc-900/60 border border-white/10 rounded-xl text-sm text-white placeholder-zinc-600 focus:outline-none focus:border-white/30 transition-colors" + autoComplete="new-password" + /> + +
+
+ + {/* Security note */} +
+ +

+ Decryption is performed entirely in your browser. No file or password is ever sent to a server. A new, unlocked copy will be downloaded to your device. +

+
+ + {/* CTA */} +
+ {isLocked ? ( + + ) : ( + + )} + +
+
+
+ )} +
+ ); +} + +export default UnlockPdf; \ No newline at end of file diff --git a/src/services/pdf.service.js b/src/services/pdf.service.js index 93a0502..5fd65c7 100644 --- a/src/services/pdf.service.js +++ b/src/services/pdf.service.js @@ -1,5 +1,6 @@ import { PDFDocument, rgb, degrees, StandardFonts } from "pdf-lib"; import { encryptPDF } from "@pdfsmaller/pdf-encrypt-lite"; +import { decryptPDF } from "@pdfsmaller/pdf-decrypt-lite"; import * as pdfjsLib from "pdfjs-dist"; // Let Vite point pdf.js at the bundled worker for us. @@ -422,6 +423,37 @@ export const lockPdf = async (file, userPassword, ownerPassword) => { return new Blob([encryptedBytes], { type: "application/pdf" }); }; +/** + * Decrypts a locked PDF and returns a password-free Blob. + * + * @param {File} file - The locked PDF file. + * @param {string} password - The password to unlock the PDF. + * @returns {Promise} - The unlocked PDF as a Blob. + */ +export const unlockPdf = async (file, password) => { + if (!file) throw new Error("No file provided."); + if (!password) throw new Error("A password is required."); + + try { + const arrayBuffer = await file.arrayBuffer(); + const encryptedBytes = new Uint8Array(arrayBuffer); + + // 1. Decrypt the raw bytes using the client-side decryption engine + const decryptedBytes = await decryptPDF(encryptedBytes, password); + + // 2. Load the decrypted bytes into pdf-lib to ensure it is structurally + // sound and to let pdf-lib cleanly rebuild the PDF without any residual + // encryption dictionary metadata. + const pdfDoc = await PDFDocument.load(decryptedBytes); + const finalBytes = await pdfDoc.save(); + + return new Blob([finalBytes], { type: 'application/pdf' }); + } catch (error) { + console.error("Error unlocking PDF:", error); + // If the password is wrong, decryptPDF will fail + throw new Error("Failed to unlock PDF. Please verify the password is correct."); + } +}; // ───────────────────────────────────────────────────────────────────────────── // applyEdits — bake canvas annotations into a PDF From 2c094d887dcad5a9d9b01f3c4efef1e77cdebd5b Mon Sep 17 00:00:00 2001 From: Adinath-j Date: Mon, 4 May 2026 14:20:06 +0530 Subject: [PATCH 2/6] fixed isLocked var --- src/pages/LockPdf/LockPdf.jsx | 2 +- src/pages/Unlockpdf/Unlockpdf.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/LockPdf/LockPdf.jsx b/src/pages/LockPdf/LockPdf.jsx index 5ab61f8..17cd7f1 100644 --- a/src/pages/LockPdf/LockPdf.jsx +++ b/src/pages/LockPdf/LockPdf.jsx @@ -45,7 +45,7 @@ export function LockPdf() { const LIMIT_MB = FREE_LIMITS.lockPdf.maxFileSizeMb; const isOverSize = !isPremium && !!file && file.size > mbToBytes(LIMIT_MB); - const isLocked = 0; + const isLocked = !isPremium && (isOverSize || hasReachedGlobalLimit); const paywallReason = hasReachedGlobalLimit ? "global" : "size"; const strength = calcStrength(password); diff --git a/src/pages/Unlockpdf/Unlockpdf.jsx b/src/pages/Unlockpdf/Unlockpdf.jsx index ff7427e..9d69258 100644 --- a/src/pages/Unlockpdf/Unlockpdf.jsx +++ b/src/pages/Unlockpdf/Unlockpdf.jsx @@ -28,7 +28,7 @@ export function UnlockPdf() { // Assuming FREE_LIMITS has lockPdf/unlockPdf configurations (using lockPdf limits as a baseline) const LIMIT_MB = FREE_LIMITS.lockPdf?.maxFileSizeMb || 50; const isOverSize = !isPremium && !!file && file.size > mbToBytes(LIMIT_MB); - const isLocked = 0; + const isLocked = !isPremium && (isOverSize || hasReachedGlobalLimit); const paywallReason = hasReachedGlobalLimit ? "global" : "size"; const canSubmit = !!file && password.length > 0 && !isProcessing; From 322b5f33ce191f3f0a6a267fdad9954a7cb9d885 Mon Sep 17 00:00:00 2001 From: Adinath-j Date: Mon, 4 May 2026 14:33:25 +0530 Subject: [PATCH 3/6] fix: force regenerate package-lock.json to resolve CI sync --- package-lock.json | 336 ++++++++++++++++++++++++++-------------------- 1 file changed, 187 insertions(+), 149 deletions(-) diff --git a/package-lock.json b/package-lock.json index 058ffc6..c098461 100644 --- a/package-lock.json +++ b/package-lock.json @@ -127,9 +127,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", - "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.3.tgz", + "integrity": "sha512-LIVqM46zQWZhj17qA8wb4nW/ixr2y1Nw+r1etiAWgRM6U1IqP+LNhL1yg440jYZR72jCWcWbLWzIosH+uP1fqg==", "dev": true, "license": "MIT", "engines": { @@ -298,9 +298,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", - "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.3.tgz", + "integrity": "sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==", "dev": true, "license": "MIT", "dependencies": { @@ -1907,6 +1907,7 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -1999,6 +2000,7 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -2073,6 +2075,7 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -2224,6 +2227,7 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -2407,6 +2411,7 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -2417,9 +2422,9 @@ } }, "node_modules/@napi-rs/canvas": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.99.tgz", - "integrity": "sha512-zN4eQlK3eBf7aJBcTHZilpBH3tDekBzPMIWC8r0s94Ecl73XfOyFi4w7yKFMRVUT0lvNQjtOL8YSrwqQj6mZFg==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.100.tgz", + "integrity": "sha512-xglYA6q3XO5P3BNJYxVZ1IV7DLVjp1Py6nwag88YntrS+3vKHyYcMqXVS4ZztJmwz2uGvz1FWhI/4LgbR5uQDA==", "license": "MIT", "optional": true, "workspaces": [ @@ -2433,23 +2438,23 @@ "url": "https://github.com/sponsors/Brooooooklyn" }, "optionalDependencies": { - "@napi-rs/canvas-android-arm64": "0.1.99", - "@napi-rs/canvas-darwin-arm64": "0.1.99", - "@napi-rs/canvas-darwin-x64": "0.1.99", - "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.99", - "@napi-rs/canvas-linux-arm64-gnu": "0.1.99", - "@napi-rs/canvas-linux-arm64-musl": "0.1.99", - "@napi-rs/canvas-linux-riscv64-gnu": "0.1.99", - "@napi-rs/canvas-linux-x64-gnu": "0.1.99", - "@napi-rs/canvas-linux-x64-musl": "0.1.99", - "@napi-rs/canvas-win32-arm64-msvc": "0.1.99", - "@napi-rs/canvas-win32-x64-msvc": "0.1.99" + "@napi-rs/canvas-android-arm64": "0.1.100", + "@napi-rs/canvas-darwin-arm64": "0.1.100", + "@napi-rs/canvas-darwin-x64": "0.1.100", + "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.100", + "@napi-rs/canvas-linux-arm64-gnu": "0.1.100", + "@napi-rs/canvas-linux-arm64-musl": "0.1.100", + "@napi-rs/canvas-linux-riscv64-gnu": "0.1.100", + "@napi-rs/canvas-linux-x64-gnu": "0.1.100", + "@napi-rs/canvas-linux-x64-musl": "0.1.100", + "@napi-rs/canvas-win32-arm64-msvc": "0.1.100", + "@napi-rs/canvas-win32-x64-msvc": "0.1.100" } }, "node_modules/@napi-rs/canvas-android-arm64": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.99.tgz", - "integrity": "sha512-9OCRt8VVxA17m32NWZKyNC2qamdaS/SC5CEOIQwFngRq0DIeVm4PDal+6Ljnhqm2whZiC63DNuKZ4xSp2nbj9w==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.100.tgz", + "integrity": "sha512-hjhCKhntPv9+t4ckHymdx0phYNcVW+GKQR6Lzw2zE+pOVjOplSmtx9nNNknTjbEDLcuLZqA1y8ufKg1XfgftzQ==", "cpu": [ "arm64" ], @@ -2467,9 +2472,9 @@ } }, "node_modules/@napi-rs/canvas-darwin-arm64": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.99.tgz", - "integrity": "sha512-lupMDMy1+H38dhyCcLirOKKVUyzzlxi7j7rGPLI3vViMHOoPjcXO1b10ivy+ad+q6MiwHfoLjKTCoLke5ySOBg==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.100.tgz", + "integrity": "sha512-2PcswRaC7Ly645DGt88///zuFDhJxJYdKAs1uU3mfk1atYkXufgcgLfBpk6Tm12nCQBaNt1wpybuPZ4qOhTo8A==", "cpu": [ "arm64" ], @@ -2487,9 +2492,9 @@ } }, "node_modules/@napi-rs/canvas-darwin-x64": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.99.tgz", - "integrity": "sha512-fdz02t4w8n6Ii/rYhWig6STb/zcTmCC/6YZTGmjoDeidDwn9Wf0ukQVynhCPEs29vqUc66wHZKsuIgMs9tycCg==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.100.tgz", + "integrity": "sha512-ePNZtj7pNIva/siZMg+HmbeozkIjqUIYdoymH8HaA3qK7LfzFN4WMBM8G6HQ9ZC+H3+Dnn5pqtiXpgLykaPOhw==", "cpu": [ "x64" ], @@ -2507,9 +2512,9 @@ } }, "node_modules/@napi-rs/canvas-linux-arm-gnueabihf": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.99.tgz", - "integrity": "sha512-w4FwVwlNo00ezeRhfY62IVIyt6G3u8wodkPtiqWc52BUHx+VDBUM2vkS3ogfANaLI7hnf3s6WK4LyZVUjBg1lA==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.100.tgz", + "integrity": "sha512-d5cDB48oWFGU8/XPhUOFAlySgb/VAu7D+s8fi55K1Pcfg8aPplHWqMgibhVLU8ky7Pyg/fuiVLz4Nf3JrSTuUA==", "cpu": [ "arm" ], @@ -2527,9 +2532,9 @@ } }, "node_modules/@napi-rs/canvas-linux-arm64-gnu": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.99.tgz", - "integrity": "sha512-8JvHeexKQ8c7g0q7YJ29NVQwnf1ePghP9ys9ZN0R0qzyqJQ9Uw6N9qnDINArlm3IYHexB7LjzArIfhQiqSDGvQ==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.100.tgz", + "integrity": "sha512-rDxgxRu69RvDlX/bh9o22DxLsGr8EqsNgotL9+RwQE1S0b0cqeatqsw6aW45mukm0B42DIAaAacKaYQ8cqS1nw==", "cpu": [ "arm64" ], @@ -2547,9 +2552,9 @@ } }, "node_modules/@napi-rs/canvas-linux-arm64-musl": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.99.tgz", - "integrity": "sha512-Z+6nyLdJXWzLPVxi4H6g9TJop4DwN3KSgHWto5JCbZV5/uKoVqcSynPs0tGlUHOoWI8S8tEvJspz51GQkvr07w==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.100.tgz", + "integrity": "sha512-K3mDW66N+xT2/V439u1alFANiBUjdEx2gLiNYnCmUsva5jZMxWTjafBYwTzYK+EMFMHrUoabuU+T1BIP5CgbYQ==", "cpu": [ "arm64" ], @@ -2567,9 +2572,9 @@ } }, "node_modules/@napi-rs/canvas-linux-riscv64-gnu": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.99.tgz", - "integrity": "sha512-jAnfOUv4IO1l8Levk5t85oVtEBOXLa07KnIUgWo1CDlPxiqpxS3uBfiE38Lvj/CQgHaNF6Nxk/SaemwLgsVJgw==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.100.tgz", + "integrity": "sha512-mooqUBTIsccZpnoQC4NgrC1v6C1vof39etLNMnBwCY+p0gajWJvAHLGQ6g/gGyS5YrpDW+GefSN4+Cvcr08UWw==", "cpu": [ "riscv64" ], @@ -2587,9 +2592,9 @@ } }, "node_modules/@napi-rs/canvas-linux-x64-gnu": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.99.tgz", - "integrity": "sha512-mIkXw3fGmbYyFjSmfWEvty4jN+rwEOmv0+Dy9bRvvTzLYWCgm3RMgUEQVfAKFw96nIRFnyNZiK83KNQaVVFjng==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.100.tgz", + "integrity": "sha512-1eCvkDCazm7FFhsT7DfGOdSaHgZVK3bt/dSBl5EWHOWmnz+I7j8tPseJqqD81NF+MH21jKUK4wQSDjN0mdhnTg==", "cpu": [ "x64" ], @@ -2607,9 +2612,9 @@ } }, "node_modules/@napi-rs/canvas-linux-x64-musl": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.99.tgz", - "integrity": "sha512-f3Uz2P0RgrtBHISxZqr6yiYXJlTDyCVBumDacxo+4AmSg7z0HiqYZKGWC/gszq3fbPhyQUya1W2AEteKxT9Y6A==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.100.tgz", + "integrity": "sha512-20arT6lnI19S68qNlii73TSEDbECNgzMz2EpldC1V3mZFuRkeujXkcebRk0LRJe9SEUAooYiLokfMViY8IX7yA==", "cpu": [ "x64" ], @@ -2627,9 +2632,9 @@ } }, "node_modules/@napi-rs/canvas-win32-arm64-msvc": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-arm64-msvc/-/canvas-win32-arm64-msvc-0.1.99.tgz", - "integrity": "sha512-XE6KUkfqRsCNejcoRMiMr3RaUeObxNf6y7dut3hrq2rn7PzfRTZgrjF1F/B2C7FcdgqY/vSHWpQeMuNz1vTNHg==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-arm64-msvc/-/canvas-win32-arm64-msvc-0.1.100.tgz", + "integrity": "sha512-DZFFT1wIAg37LJw37yhMRFfjATd3vTQzjZ1Yki8u2vhO6Hi5VE6BVaGQ1aaDu7xb4iMErz+9EOwjpS7xcxFeBw==", "cpu": [ "arm64" ], @@ -2647,9 +2652,9 @@ } }, "node_modules/@napi-rs/canvas-win32-x64-msvc": { - "version": "0.1.99", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.99.tgz", - "integrity": "sha512-plMYGVbc/vmmPF9MtmHbwNk1rL1Aj53vQZt+Gnv1oZn6gmd9jEHHJ0n9Nd2nxa5sKH7TS5IjkCDM6289O0d6PQ==", + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.100.tgz", + "integrity": "sha512-MyT1j3mHC2+Lu4pBi9mKyMJhtP6U7k7EldY7sj/uS5gJA65gTXt8MefJQXLJo5d/vZbuWmfxzkEUNc/urV3pHA==", "cpu": [ "x64" ], @@ -2799,9 +2804,9 @@ "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz", + "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { @@ -2827,9 +2832,9 @@ "license": "BSD-3-Clause" }, "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.1.tgz", + "integrity": "sha512-mnzgDV26ueAvk7rsbt9L7bE0SuAoqyuys/sMMrmVcN5x9VsxpcG3rqAUSgDyLp0UZlmNfIbQ4fHfCtreVBk8Ew==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { @@ -2845,9 +2850,9 @@ "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.1.tgz", + "integrity": "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==", "license": "BSD-3-Clause" }, "node_modules/@rainbow-me/rainbowkit": { @@ -3208,6 +3213,16 @@ } } }, + "node_modules/@reown/appkit-controllers/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "extraneous": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@reown/appkit-pay": { "version": "1.7.8", "resolved": "https://registry.npmjs.org/@reown/appkit-pay/-/appkit-pay-1.7.8.tgz", @@ -3565,6 +3580,16 @@ } } }, + "node_modules/@reown/appkit-utils/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "extraneous": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@reown/appkit-wallet": { "version": "1.7.8", "resolved": "https://registry.npmjs.org/@reown/appkit-wallet/-/appkit-wallet-1.7.8.tgz", @@ -3874,6 +3899,16 @@ } } }, + "node_modules/@reown/appkit/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "extraneous": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@rolldown/binding-android-arm64": { "version": "1.0.0-rc.17", "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.17.tgz", @@ -5461,9 +5496,9 @@ } }, "node_modules/@tanstack/query-core": { - "version": "5.100.1", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.100.1.tgz", - "integrity": "sha512-awvQhOO/2TrSCHE5LKKsXcvvj6WSBncwEcMFCB/ez0Qs0b17iyyivoGArNV3HFfXryZwCpnb/olsaBBKrIbtSw==", + "version": "5.100.9", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.100.9.tgz", + "integrity": "sha512-SJSFw1S8+kQ0+knv/XGfrbocWoAlT7vDKsSImtLx3ZPQmEcR46hkDjLSvynSy25N8Ms4tIEini1FuBd5k7IscQ==", "license": "MIT", "funding": { "type": "github", @@ -5471,12 +5506,12 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.100.1", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.100.1.tgz", - "integrity": "sha512-UgWRLhQKprC37SsO6y1zRabOqDmM2gsdTNPbqTT35yl7kOOhwXU4nyfOiGHXPwoEFJV1IpSk85hjIFjNFWVpzw==", + "version": "5.100.9", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.100.9.tgz", + "integrity": "sha512-Oa44XkaI3kCNN6ME0KByU3xT3SEUNOMfZpHxL6+wFoTm+OeUFYHKdeYVe0aOXlRDm/f15sgLwEt2HDorIdW8+A==", "license": "MIT", "dependencies": { - "@tanstack/query-core": "5.100.1" + "@tanstack/query-core": "5.100.9" }, "funding": { "type": "github", @@ -5577,9 +5612,9 @@ } }, "node_modules/@tybys/wasm-util": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", - "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", + "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", "dev": true, "license": "MIT", "optional": true, @@ -6544,6 +6579,16 @@ } } }, + "node_modules/@walletconnect/utils/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "extraneous": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@walletconnect/window-getters": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@walletconnect/window-getters/-/window-getters-1.0.1.tgz", @@ -6857,9 +6902,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.10.21", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.21.tgz", - "integrity": "sha512-Q+rUQ7Uz8AHM7DEaNdwvfFCTq7a43lNTzuS94eiWqwyxfV/wJv+oUivef51T91mmRY4d4A1u9rcSvkeufCVXlA==", + "version": "2.10.27", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.27.tgz", + "integrity": "sha512-zEs/ufmZoUd7WftKpKyXaT6RFxpQ5Qm9xytKRHvJfxFV9DFJkZph9RvJ1LcOUi0Z1ZVijMte65JbILeV+8QQEA==", "dev": true, "license": "Apache-2.0", "bin": { @@ -7062,9 +7107,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001790", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001790.tgz", - "integrity": "sha512-bOoxfJPyYo+ds6W0YfptaCWbFnJYjh2Y1Eow5lRv+vI2u8ganPZqNm1JwNh0t2ELQCqIWg4B3dWEusgAmsoyOw==", + "version": "1.0.30001791", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001791.tgz", + "integrity": "sha512-yk0l/YSrOnFZk3UROpDLQD9+kC1l4meK/wed583AXrzoarMGJcbRi2Q4RaUYbKxYAsZ8sWmaSa/DsLmdBeI1vQ==", "dev": true, "funding": [ { @@ -7671,9 +7716,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.344", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.344.tgz", - "integrity": "sha512-4MxfbmNDm+KPh066EZy+eUnkcDPcZ35wNmOWzFuh/ijvHsve6kbLTLURy88uCNK5FbpN+yk2nQY6BYh1GEt+wg==", + "version": "1.5.349", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.349.tgz", + "integrity": "sha512-QsWVGyRuY07Aqb234QytTfwd5d9AJlfNIQ5wIOl1L+PZDzI9d9+Fn0FRale/QYlFxt/bUnB0/nLd1jFPGxGK1A==", "dev": true, "license": "ISC" }, @@ -7766,9 +7811,9 @@ } }, "node_modules/es-module-lexer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", - "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz", + "integrity": "sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==", "dev": true, "license": "MIT" }, @@ -8661,9 +8706,9 @@ } }, "node_modules/globals": { - "version": "17.5.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-17.5.0.tgz", - "integrity": "sha512-qoV+HK2yFl/366t2/Cb3+xxPUo5BuMynomoDmiaZBIdbs+0pYbjfZU+twLhGKp4uCZ/+NbtpVepH5bGCxRyy2g==", + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.6.0.tgz", + "integrity": "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==", "dev": true, "license": "MIT", "engines": { @@ -8788,9 +8833,9 @@ } }, "node_modules/hono": { - "version": "4.12.15", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.15.tgz", - "integrity": "sha512-qM0jDhFEaCBb4TxoW7f53Qrpv9RBiayUHo0S52JudprkhvpjIrGoU1mnnr29Fvd1U335ZFPZQY1wlkqgfGXyLg==", + "version": "4.12.16", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.16.tgz", + "integrity": "sha512-jN0ZewiNAWSe5khM3EyCmBb250+b40wWbwNILNfEvq84VREWwOIkuUsFONk/3i3nqkz7Oe1PcpM2mwQEK2L9Kg==", "license": "MIT", "engines": { "node": ">=16.9.0" @@ -9103,9 +9148,9 @@ } }, "node_modules/jose": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.2.tgz", - "integrity": "sha512-d7kPDd34KO/YnzaDOlikGpOurfF0ByC2sEV4cANCtdqLlTfBlw2p14O/5d/zv40gJPbIQxfES3nSx1/oYNyuZQ==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.3.tgz", + "integrity": "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/panva" @@ -9132,28 +9177,28 @@ } }, "node_modules/jsdom": { - "version": "29.0.2", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-29.0.2.tgz", - "integrity": "sha512-9VnGEBosc/ZpwyOsJBCQ/3I5p7Q5ngOY14a9bf5btenAORmZfDse1ZEheMiWcJ3h81+Fv7HmJFdS0szo/waF2w==", + "version": "29.1.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-29.1.1.tgz", + "integrity": "sha512-ECi4Fi2f7BdJtUKTflYRTiaMxIB0O6zfR1fX0GXpUrf6flp8QIYn1UT20YQqdSOfk2dfkCwS8LAFoJDEppNK5Q==", "dev": true, "license": "MIT", "dependencies": { - "@asamuzakjp/css-color": "^5.1.5", - "@asamuzakjp/dom-selector": "^7.0.6", + "@asamuzakjp/css-color": "^5.1.11", + "@asamuzakjp/dom-selector": "^7.1.1", "@bramus/specificity": "^2.4.2", - "@csstools/css-syntax-patches-for-csstree": "^1.1.1", + "@csstools/css-syntax-patches-for-csstree": "^1.1.3", "@exodus/bytes": "^1.15.0", "css-tree": "^3.2.1", "data-urls": "^7.0.0", "decimal.js": "^10.6.0", "html-encoding-sniffer": "^6.0.0", "is-potential-custom-element-name": "^1.0.1", - "lru-cache": "^11.2.7", - "parse5": "^8.0.0", + "lru-cache": "^11.3.5", + "parse5": "^8.0.1", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^6.0.1", - "undici": "^7.24.5", + "undici": "^7.25.0", "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^8.0.1", "whatwg-mimetype": "^5.0.0", @@ -9843,9 +9888,9 @@ "license": "(Apache-2.0 AND MIT)" }, "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", "dev": true, "funding": [ { @@ -9939,13 +9984,6 @@ "integrity": "sha512-8DY+kFsDkNXy1sJglUfuODx1/opAGJGyrTuFqEoN90oRc2Vk0ZbD4K2qmKXBBEhZQzdKHIVfEJpDU8Ak2NJEvQ==", "license": "MIT" }, - "node_modules/node-readable-to-web-readable-stream": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/node-readable-to-web-readable-stream/-/node-readable-to-web-readable-stream-0.4.2.tgz", - "integrity": "sha512-/cMZNI34v//jUTrI+UIo4ieHAB5EZRY/+7OmXZgBxaWBMcW2tGdceIw06RFxWxrKZ5Jp3sI2i5TsRo+CBhtVLQ==", - "license": "MIT", - "optional": true - }, "node_modules/node-releases": { "version": "2.0.38", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.38.tgz", @@ -10191,16 +10229,15 @@ "license": "0BSD" }, "node_modules/pdfjs-dist": { - "version": "5.6.205", - "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-5.6.205.tgz", - "integrity": "sha512-tlUj+2IDa7G1SbvBNN74UHRLJybZDWYom+k6p5KIZl7huBvsA4APi6mKL+zCxd3tLjN5hOOEE9Tv7VdzO88pfg==", + "version": "5.7.284", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-5.7.284.tgz", + "integrity": "sha512-h4EdYQczmGhbOlqc3PPZwxevn7ApdWPbovAuWXOB/DjIyigSnwfy2oze7c6mRcSr9XgLp3eN3EeL4DyySTPMFw==", "license": "Apache-2.0", "engines": { - "node": ">=20.19.0 || >=22.13.0 || >=24" + "node": ">=22.13.0 || >=24" }, "optionalDependencies": { - "@napi-rs/canvas": "^0.1.96", - "node-readable-to-web-readable-stream": "^0.4.2" + "@napi-rs/canvas": "^0.1.100" } }, "node_modules/picocolors": { @@ -10382,9 +10419,9 @@ } }, "node_modules/postcss": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.10.tgz", - "integrity": "sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==", + "version": "8.5.13", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.13.tgz", + "integrity": "sha512-qif0+jGGZoLWdHey3UFHHWP0H7Gbmsk8T5VEqyYFbWqPr1XqvLGBbk/sl8V5exGmcYJklJOhOQq1pV9IcsiFag==", "dev": true, "funding": [ { @@ -10489,22 +10526,22 @@ "license": "MIT" }, "node_modules/protobufjs": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.5.tgz", - "integrity": "sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.6.tgz", + "integrity": "sha512-M71sTMB146U3u0di3yup8iM+zv8yPRNQVr1KK4tyBitl3qFvEGucq/rGDRShD2rsJhtN02RJaJ7j5X5hmy8SJg==", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", + "@protobufjs/codegen": "^2.0.5", "@protobufjs/eventemitter": "^1.1.0", "@protobufjs/fetch": "^1.1.0", "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", + "@protobufjs/inquire": "^1.1.1", "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", + "@protobufjs/utf8": "^1.1.1", "@types/node": ">=13.7.0", "long": "^5.0.0" }, @@ -10545,9 +10582,9 @@ } }, "node_modules/qr": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/qr/-/qr-0.5.5.tgz", - "integrity": "sha512-iQBvKj7MRKO+co+MY0IZpyLO+ezvttxsmV86WywrgPuAmgBkv0pytyi03wourniSoPgzffeBW6cBgIkpqcvjTg==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/qr/-/qr-0.6.0.tgz", + "integrity": "sha512-P23VoX7SipHALdiIYG+D+LT/6n22dNKwV92FAb3d+Nlki/5WisSsfLt0UDFz2XEBtuwrECTznvu+chKKFCSYhA==", "license": "(MIT OR Apache-2.0)", "engines": { "node": ">= 20.19.0" @@ -11370,9 +11407,9 @@ "license": "MIT" }, "node_modules/tinyexec": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.1.1.tgz", - "integrity": "sha512-VKS/ZaQhhkKFMANmAOhhXVoIfBXblQxGX1myCQ2faQrfmobMftXeJPcZGp0gS07ocvGJWDLZGyOZDadDBqYIJg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.1.2.tgz", + "integrity": "sha512-dAqSqE/RabpBKI8+h26GfLq6Vb3JVXs30XYQjdMjaj/c2tS8IYYMbIzP599KtRj7c57/wYApb3QjgRgXmrCukA==", "dev": true, "license": "MIT", "engines": { @@ -11407,22 +11444,22 @@ } }, "node_modules/tldts": { - "version": "7.0.28", - "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.0.28.tgz", - "integrity": "sha512-+Zg3vWhRUv8B1maGSTFdev9mjoo8Etn2Ayfs4cnjlD3CsGkxXX4QyW3j2WJ0wdjYcYmy7Lx2RDsZMhgCWafKIw==", + "version": "7.0.30", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.0.30.tgz", + "integrity": "sha512-ELrFxuqsDdHUwoh0XxDbxuLD3Wnz49Z57IFvTtvWy1hJdcMZjXLIuonjilCiWHlT2GbE4Wlv1wKVTzDFnXH1aw==", "dev": true, "license": "MIT", "dependencies": { - "tldts-core": "^7.0.28" + "tldts-core": "^7.0.30" }, "bin": { "tldts": "bin/cli.js" } }, "node_modules/tldts-core": { - "version": "7.0.28", - "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.0.28.tgz", - "integrity": "sha512-7W5Efjhsc3chVdFhqtaU0KtK32J37Zcr9RKtID54nG+tIpcY79CQK/veYPODxtD/LJ4Lue66jvrQzIX2Z2/pUQ==", + "version": "7.0.30", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.0.30.tgz", + "integrity": "sha512-uiHN8PIB1VmWyS98eZYja4xzlYqeFZVjb4OuYlJQnZAuJhMw4PbKQOKgHKhBdJR3FE/t5mUQ1Kd80++B+qhD1Q==", "dev": true, "license": "MIT" }, @@ -11552,9 +11589,9 @@ } }, "node_modules/ufo": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.3.tgz", - "integrity": "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==", + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz", + "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==", "license": "MIT" }, "node_modules/uint8arrays": { @@ -11822,6 +11859,7 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", "license": "MIT", "bin": { "uuid": "dist/bin/uuid" @@ -11863,9 +11901,9 @@ } }, "node_modules/viem": { - "version": "2.48.4", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.48.4.tgz", - "integrity": "sha512-mReP/rgY2P+WeeRSG4sUvccCLKfyAW1C73Y3KkobAqgzYmVna9qyUMNE44xIUkDtfvRuC33r24UhF4baBYovsg==", + "version": "2.48.8", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.48.8.tgz", + "integrity": "sha512-Xj3Nrt66SKtn06kczU91ELn9Difr84ZM5A62BTlaisT5lpgt058i2mBkfMZCXHGb1ocOLjzC2ztPhD0Lvky7uQ==", "funding": [ { "type": "github", @@ -12373,9 +12411,9 @@ } }, "node_modules/zod": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", - "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" From 9d926453c6c03e432bf5372f989534782598e8ee Mon Sep 17 00:00:00 2001 From: Adinath-j Date: Mon, 4 May 2026 15:57:23 +0530 Subject: [PATCH 4/6] fix: sync package-lock.json to resolve CI failure --- package-lock.json | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index c098461..bf54866 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3213,16 +3213,6 @@ } } }, - "node_modules/@reown/appkit-controllers/node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "extraneous": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@reown/appkit-pay": { "version": "1.7.8", "resolved": "https://registry.npmjs.org/@reown/appkit-pay/-/appkit-pay-1.7.8.tgz", @@ -3580,16 +3570,6 @@ } } }, - "node_modules/@reown/appkit-utils/node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "extraneous": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@reown/appkit-wallet": { "version": "1.7.8", "resolved": "https://registry.npmjs.org/@reown/appkit-wallet/-/appkit-wallet-1.7.8.tgz", @@ -3899,16 +3879,6 @@ } } }, - "node_modules/@reown/appkit/node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "extraneous": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@rolldown/binding-android-arm64": { "version": "1.0.0-rc.17", "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.17.tgz", @@ -6579,16 +6549,6 @@ } } }, - "node_modules/@walletconnect/utils/node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "extraneous": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@walletconnect/window-getters": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@walletconnect/window-getters/-/window-getters-1.0.1.tgz", From 6da1a7d535bcd30fd8ca2505ac475153237f6856 Mon Sep 17 00:00:00 2001 From: Adinath-j Date: Mon, 4 May 2026 16:01:39 +0530 Subject: [PATCH 5/6] fix: explicitly install zod and decrypt-lite to resolve CI lock sync --- package-lock.json | 27 ++++++++++++++------------- package.json | 3 ++- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index bf54866..e7a0f42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,8 @@ "react-dom": "^19.2.4", "react-router-dom": "^7.13.1", "viem": "^2.47.6", - "wagmi": "^2.19.5" + "wagmi": "^2.19.5", + "zod": "^3.25.76" }, "devDependencies": { "@eslint/js": "^9.39.4", @@ -502,15 +503,6 @@ } } }, - "node_modules/@coinbase/cdp-sdk/node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@coinbase/wallet-sdk": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/@coinbase/wallet-sdk/-/wallet-sdk-4.3.6.tgz", @@ -10369,6 +10361,15 @@ } } }, + "node_modules/porto/node_modules/zod": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/possible-typed-array-names": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", @@ -12371,9 +12372,9 @@ } }, "node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index c8a7af7..850546a 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "react-dom": "^19.2.4", "react-router-dom": "^7.13.1", "viem": "^2.47.6", - "wagmi": "^2.19.5" + "wagmi": "^2.19.5", + "zod": "^3.25.76" }, "devDependencies": { "@eslint/js": "^9.39.4", From 3969808ea25c27ed62edd35eb088ff483acb42b8 Mon Sep 17 00:00:00 2001 From: Adinath-j Date: Mon, 4 May 2026 16:55:05 +0530 Subject: [PATCH 6/6] fix: resolve ESLint no-undef error in setupTests --- src/providers/Web3Provider.test.jsx | 78 ++++++++++++++++------------- src/setupTests.js | 16 ++++++ 2 files changed, 59 insertions(+), 35 deletions(-) diff --git a/src/providers/Web3Provider.test.jsx b/src/providers/Web3Provider.test.jsx index da0fcfb..932e5eb 100644 --- a/src/providers/Web3Provider.test.jsx +++ b/src/providers/Web3Provider.test.jsx @@ -1,20 +1,21 @@ -import {describe, it, expect, vi, beforeEach} from 'vitest'; +import { describe, it, expect, vi, beforeEach } from 'vitest'; const getDefaultConfigMock = vi.fn(); -//mock all the libraries, so that it doesn't run out of time! +// Mock all the Web3 libraries to prevent infinite background network polling vi.mock('@rainbow-me/rainbowkit', () => ({ getDefaultConfig: (args) => { getDefaultConfigMock(args); - return {}; + return { connectors: [] }; // Return a dummy object so Wagmi doesn't crash }, - RainbowKitProvider: ({ children }) => children, // Just pass the UI through + RainbowKitProvider: ({ children }) => children, darkTheme: vi.fn(), })); vi.mock('wagmi', () => ({ WagmiProvider: ({ children }) => children, - + createConfig: vi.fn(), + http: vi.fn(), })); vi.mock('@tanstack/react-query', () => ({ @@ -22,34 +23,41 @@ vi.mock('@tanstack/react-query', () => ({ QueryClientProvider: ({ children }) => children, })); -describe('Web3Provider Fallback', () => { - - // This is the Spy where we clean up previously run test - beforeEach(() => { - vi.resetModules(); //This resets - vi.restoreAllMocks(); - }); - - it('should trigger the NSoC Dev Tip warning when no Project ID is provided', async () => { - // //Let's think we don't have the projectID - // //stub here means forcing to be empty - // vi.stubEnv('VITE_WALLETCONNECT_PROJECT_ID', ' '); - - //This is hidden camera on console.warn - // const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}); - - - //importing the code to execute this logic - await import('./Web3Provider'); - - //verify the results - // expect(warnSpy).toHaveBeenCalledWith( - // expect.stringContaining("NSoC Dev Tip") - // ); - - const lastCall = getDefaultConfigMock.mock.calls[0][0]; - - expect(lastCall.projectId).toBe("3324687d602334057884d59a72179836"); - },15000); -}); +// CRITICAL: Mock Reown/AppKit/Web3Modal to stop background network requests! +vi.mock('@reown/appkit/react', () => ({ + createAppKit: vi.fn(), +})); +vi.mock('@web3modal/wagmi/react', () => ({ + createWeb3Modal: vi.fn(), +})); +describe('Web3Provider Fallback', () => { + beforeEach(() => { + // Reset modules ensures the dynamic import runs fresh every time + vi.resetModules(); + vi.restoreAllMocks(); + }); + + it('should trigger the NSoC Dev Tip warning when no Project ID is provided', async () => { + // 1. Force the environment variable to be empty so the fallback triggers + vi.stubEnv('VITE_WALLETCONNECT_PROJECT_ID', ''); + + // 2. Hide the console.warn output but spy on it + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}); + + // 3. Dynamically import the provider to execute top-level logic + await import('./Web3Provider'); + + // 4. Verify the fallback warning was printed to the console + expect(warnSpy).toHaveBeenCalledWith( + expect.stringContaining("NSoC Dev Tip") + ); + + // 5. Verify the fallback ID was properly passed into the RainbowKit config + const lastCall = getDefaultConfigMock.mock.calls[0][0]; + expect(lastCall.projectId).toBe("3324687d602334057884d59a72179836"); + + // 6. Clean up the mocked environment + vi.unstubAllEnvs(); + }); +}); \ No newline at end of file diff --git a/src/setupTests.js b/src/setupTests.js index 3ad32e1..78959ae 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -6,3 +6,19 @@ import { afterEach } from 'vitest'; afterEach(() => { cleanup(); }); + +/* global global */ + +// Polyfill DOMMatrix for pdfjs-dist in the Vitest environment +if (typeof global.DOMMatrix === 'undefined') { + global.DOMMatrix = class DOMMatrix { + constructor() { + this.a = 1; + this.b = 0; + this.c = 0; + this.d = 1; + this.e = 0; + this.f = 0; + } + }; +} \ No newline at end of file